Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Point to stone with better objc wrapper #400

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 113 additions & 9 deletions Source/SwiftyDropboxObjC/Shared/Generated/DBXFiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,18 @@ public class DBXFilesDeleteBatchResult: DBXFilesFileOpsResult {
public class DBXFilesDeleteBatchResultData: NSObject {
/// Metadata of the deleted object.
@objc
public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) }
public var metadata: DBXFilesMetadata {
switch swift.metadata {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return DBXFilesMetadata(swift: swift.metadata)
}
}

@objc
public init(metadata: DBXFilesMetadata) {
Expand Down Expand Up @@ -1505,7 +1516,18 @@ public class DBXFilesDeleteErrorOther: DBXFilesDeleteError {
public class DBXFilesDeleteResult: DBXFilesFileOpsResult {
/// Metadata of the deleted object.
@objc
public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: subSwift.metadata) }
public var metadata: DBXFilesMetadata {
switch subSwift.metadata {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return DBXFilesMetadata(swift: subSwift.metadata)
}
}

@objc
public init(metadata: DBXFilesMetadata) {
Expand Down Expand Up @@ -2830,7 +2852,19 @@ public class DBXFilesGetCopyReferenceErrorOther: DBXFilesGetCopyReferenceError {
public class DBXFilesGetCopyReferenceResult: NSObject {
/// Metadata of the file or folder.
@objc
public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) }
public var metadata: DBXFilesMetadata {
switch swift.metadata {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return DBXFilesMetadata(swift: swift.metadata)
}
}

/// A copy reference to the file or folder.
@objc
public var copyReference: String { swift.copyReference }
Expand Down Expand Up @@ -3833,7 +3867,21 @@ public class DBXFilesListFolderLongpollResult: NSObject {
public class DBXFilesListFolderResult: NSObject {
/// The files and (direct) subfolders in the folder.
@objc
public var entries: [DBXFilesMetadata] { swift.entries.map { DBXFilesMetadata(swift: $0) } }
public var entries: [DBXFilesMetadata] {
swift.entries.map {
switch $0 {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return 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 }
Expand Down Expand Up @@ -4319,7 +4367,19 @@ public class DBXFilesLockFileErrorOther: DBXFilesLockFileError {
public class DBXFilesLockFileResult: NSObject {
/// Metadata of the file.
@objc
public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) }
public var metadata: DBXFilesMetadata {
switch swift.metadata {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return DBXFilesMetadata(swift: swift.metadata)
}
}

/// The file lock state after the operation.
@objc
public var lock: DBXFilesFileLock { DBXFilesFileLock(swift: swift.lock) }
Expand Down Expand Up @@ -6838,7 +6898,18 @@ public class DBXFilesRelocationBatchResult: DBXFilesFileOpsResult {
public class DBXFilesRelocationBatchResultData: NSObject {
/// Metadata of the relocated object.
@objc
public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: swift.metadata) }
public var metadata: DBXFilesMetadata {
switch swift.metadata {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return DBXFilesMetadata(swift: swift.metadata)
}
}

@objc
public init(metadata: DBXFilesMetadata) {
Expand Down Expand Up @@ -7087,7 +7158,18 @@ public class DBXFilesRelocationBatchV2Result: DBXFilesFileOpsResult {
public class DBXFilesRelocationResult: DBXFilesFileOpsResult {
/// Metadata of the relocated object.
@objc
public var metadata: DBXFilesMetadata { DBXFilesMetadata(swift: subSwift.metadata) }
public var metadata: DBXFilesMetadata {
switch subSwift.metadata {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return DBXFilesMetadata(swift: subSwift.metadata)
}
}

@objc
public init(metadata: DBXFilesMetadata) {
Expand Down Expand Up @@ -7500,7 +7582,18 @@ public class DBXFilesSaveCopyReferenceErrorOther: DBXFilesSaveCopyReferenceError
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) }
public var metadata: DBXFilesMetadata {
switch swift.metadata {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return DBXFilesMetadata(swift: swift.metadata)
}
}

@objc
public init(metadata: DBXFilesMetadata) {
Expand Down Expand Up @@ -7934,7 +8027,18 @@ public class DBXFilesSearchMatch: NSObject {
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) }
public var metadata: DBXFilesMetadata {
switch swift.metadata {
case let fileMetadata as Files.FileMetadata:
return DBXFilesFileMetadata(swift: fileMetadata)
case let folderMetadata as Files.FolderMetadata:
return DBXFilesFolderMetadata(swift: folderMetadata)
case let deletedMetadata as Files.DeletedMetadata:
return DBXFilesDeletedMetadata(swift: deletedMetadata)
default:
return DBXFilesMetadata(swift: swift.metadata)
}
}

@objc
public init(matchType: DBXFilesSearchMatchType, metadata: DBXFilesMetadata) {
Expand Down
27 changes: 25 additions & 2 deletions Source/SwiftyDropboxObjC/Shared/Generated/DBXSharing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3501,7 +3501,18 @@ public class DBXSharingGetSharedLinksErrorOther: DBXSharingGetSharedLinksError {
public class DBXSharingGetSharedLinksResult: NSObject {
/// Shared links applicable to the path argument.
@objc
public var links: [DBXSharingLinkMetadata] { swift.links.map { DBXSharingLinkMetadata(swift: $0) } }
public var links: [DBXSharingLinkMetadata] {
swift.links.map {
switch $0 {
case let pathLinkMetadata as Sharing.PathLinkMetadata:
return DBXSharingPathLinkMetadata(swift: pathLinkMetadata)
case let collectionLinkMetadata as Sharing.CollectionLinkMetadata:
return DBXSharingCollectionLinkMetadata(swift: collectionLinkMetadata)
default:
return DBXSharingLinkMetadata(swift: $0)
}
}
}

@objc
public init(links: [DBXSharingLinkMetadata]) {
Expand Down Expand Up @@ -5900,7 +5911,19 @@ public class DBXSharingListSharedLinksErrorOther: DBXSharingListSharedLinksError
public class DBXSharingListSharedLinksResult: NSObject {
/// Shared links applicable to the path argument.
@objc
public var links: [DBXSharingSharedLinkMetadata] { swift.links.map { DBXSharingSharedLinkMetadata(swift: $0) } }
public var links: [DBXSharingSharedLinkMetadata] {
swift.links.map {
switch $0 {
case let fileLinkMetadata as Sharing.FileLinkMetadata:
return DBXSharingFileLinkMetadata(swift: fileLinkMetadata)
case let folderLinkMetadata as Sharing.FolderLinkMetadata:
return DBXSharingFolderLinkMetadata(swift: folderLinkMetadata)
default:
return 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
Expand Down
80 changes: 74 additions & 6 deletions Source/SwiftyDropboxObjC/Shared/Generated/DBXTeamLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2560,7 +2560,18 @@ public class DBXTeamLogApiSessionLogInfo: NSObject {
public class DBXTeamLogAppBlockedByPermissionsDetails: NSObject {
/// Relevant application details.
@objc
public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) }
public var appInfo: DBXTeamLogAppLogInfo {
switch swift.appInfo {
case let userOrTeamLinkedAppLogInfo as TeamLog.UserOrTeamLinkedAppLogInfo:
return DBXTeamLogUserOrTeamLinkedAppLogInfo(swift: userOrTeamLinkedAppLogInfo)
case let userLinkedAppLogInfo as TeamLog.UserLinkedAppLogInfo:
return DBXTeamLogUserLinkedAppLogInfo(swift: userLinkedAppLogInfo)
case let teamLinkedAppLogInfo as TeamLog.TeamLinkedAppLogInfo:
return DBXTeamLogTeamLinkedAppLogInfo(swift: teamLinkedAppLogInfo)
default:
return DBXTeamLogAppLogInfo(swift: swift.appInfo)
}
}

@objc
public init(appInfo: DBXTeamLogAppLogInfo) {
Expand Down Expand Up @@ -2604,7 +2615,18 @@ public class DBXTeamLogAppBlockedByPermissionsType: NSObject {
public class DBXTeamLogAppLinkTeamDetails: NSObject {
/// Relevant application details.
@objc
public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) }
public var appInfo: DBXTeamLogAppLogInfo {
switch swift.appInfo {
case let userOrTeamLinkedAppLogInfo as TeamLog.UserOrTeamLinkedAppLogInfo:
return DBXTeamLogUserOrTeamLinkedAppLogInfo(swift: userOrTeamLinkedAppLogInfo)
case let userLinkedAppLogInfo as TeamLog.UserLinkedAppLogInfo:
return DBXTeamLogUserLinkedAppLogInfo(swift: userLinkedAppLogInfo)
case let teamLinkedAppLogInfo as TeamLog.TeamLinkedAppLogInfo:
return DBXTeamLogTeamLinkedAppLogInfo(swift: teamLinkedAppLogInfo)
default:
return DBXTeamLogAppLogInfo(swift: swift.appInfo)
}
}

@objc
public init(appInfo: DBXTeamLogAppLogInfo) {
Expand Down Expand Up @@ -2648,7 +2670,18 @@ public class DBXTeamLogAppLinkTeamType: NSObject {
public class DBXTeamLogAppLinkUserDetails: NSObject {
/// Relevant application details.
@objc
public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) }
public var appInfo: DBXTeamLogAppLogInfo {
switch swift.appInfo {
case let userOrTeamLinkedAppLogInfo as TeamLog.UserOrTeamLinkedAppLogInfo:
return DBXTeamLogUserOrTeamLinkedAppLogInfo(swift: userOrTeamLinkedAppLogInfo)
case let userLinkedAppLogInfo as TeamLog.UserLinkedAppLogInfo:
return DBXTeamLogUserLinkedAppLogInfo(swift: userLinkedAppLogInfo)
case let teamLinkedAppLogInfo as TeamLog.TeamLinkedAppLogInfo:
return DBXTeamLogTeamLinkedAppLogInfo(swift: teamLinkedAppLogInfo)
default:
return DBXTeamLogAppLogInfo(swift: swift.appInfo)
}
}

@objc
public init(appInfo: DBXTeamLogAppLogInfo) {
Expand Down Expand Up @@ -2783,7 +2816,18 @@ public class DBXTeamLogAppPermissionsChangedType: NSObject {
public class DBXTeamLogAppUnlinkTeamDetails: NSObject {
/// Relevant application details.
@objc
public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) }
public var appInfo: DBXTeamLogAppLogInfo {
switch swift.appInfo {
case let userOrTeamLinkedAppLogInfo as TeamLog.UserOrTeamLinkedAppLogInfo:
return DBXTeamLogUserOrTeamLinkedAppLogInfo(swift: userOrTeamLinkedAppLogInfo)
case let userLinkedAppLogInfo as TeamLog.UserLinkedAppLogInfo:
return DBXTeamLogUserLinkedAppLogInfo(swift: userLinkedAppLogInfo)
case let teamLinkedAppLogInfo as TeamLog.TeamLinkedAppLogInfo:
return DBXTeamLogTeamLinkedAppLogInfo(swift: teamLinkedAppLogInfo)
default:
return DBXTeamLogAppLogInfo(swift: swift.appInfo)
}
}

@objc
public init(appInfo: DBXTeamLogAppLogInfo) {
Expand Down Expand Up @@ -2827,7 +2871,18 @@ public class DBXTeamLogAppUnlinkTeamType: NSObject {
public class DBXTeamLogAppUnlinkUserDetails: NSObject {
/// Relevant application details.
@objc
public var appInfo: DBXTeamLogAppLogInfo { DBXTeamLogAppLogInfo(swift: swift.appInfo) }
public var appInfo: DBXTeamLogAppLogInfo {
switch swift.appInfo {
case let userOrTeamLinkedAppLogInfo as TeamLog.UserOrTeamLinkedAppLogInfo:
return DBXTeamLogUserOrTeamLinkedAppLogInfo(swift: userOrTeamLinkedAppLogInfo)
case let userLinkedAppLogInfo as TeamLog.UserLinkedAppLogInfo:
return DBXTeamLogUserLinkedAppLogInfo(swift: userLinkedAppLogInfo)
case let teamLinkedAppLogInfo as TeamLog.TeamLinkedAppLogInfo:
return DBXTeamLogTeamLinkedAppLogInfo(swift: teamLinkedAppLogInfo)
default:
return DBXTeamLogAppLogInfo(swift: swift.appInfo)
}
}

@objc
public init(appInfo: DBXTeamLogAppLogInfo) {
Expand Down Expand Up @@ -5807,7 +5862,20 @@ public class DBXTeamLogDeviceApprovalsRemoveExceptionType: NSObject {
public class DBXTeamLogDeviceChangeIpDesktopDetails: NSObject {
/// Device's session logged information.
@objc
public var deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo { DBXTeamLogDeviceSessionLogInfo(swift: swift.deviceSessionInfo) }
public var deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo {
switch swift.deviceSessionInfo {
case let desktopDeviceSessionLogInfo as TeamLog.DesktopDeviceSessionLogInfo:
return DBXTeamLogDesktopDeviceSessionLogInfo(swift: desktopDeviceSessionLogInfo)
case let mobileDeviceSessionLogInfo as TeamLog.MobileDeviceSessionLogInfo:
return DBXTeamLogMobileDeviceSessionLogInfo(swift: mobileDeviceSessionLogInfo)
case let webDeviceSessionLogInfo as TeamLog.WebDeviceSessionLogInfo:
return DBXTeamLogWebDeviceSessionLogInfo(swift: webDeviceSessionLogInfo)
case let legacyDeviceSessionLogInfo as TeamLog.LegacyDeviceSessionLogInfo:
return DBXTeamLogLegacyDeviceSessionLogInfo(swift: legacyDeviceSessionLogInfo)
default:
return DBXTeamLogDeviceSessionLogInfo(swift: swift.deviceSessionInfo)
}
}

@objc
public init(deviceSessionInfo: DBXTeamLogDeviceSessionLogInfo) {
Expand Down
11 changes: 10 additions & 1 deletion Source/SwiftyDropboxObjC/Shared/Generated/DBXUsers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,16 @@ public class DBXUsersFullAccount: DBXUsersAccount {
public var accountType: DBXUsersCommonAccountType { DBXUsersCommonAccountType(swift: subSwift.accountType) }
/// The root info for this account.
@objc
public var rootInfo: DBXCommonRootInfo { DBXCommonRootInfo(swift: subSwift.rootInfo) }
public var rootInfo: DBXCommonRootInfo {
switch subSwift.rootInfo {
case let teamRootInfo as Common.TeamRootInfo:
return DBXCommonTeamRootInfo(swift: teamRootInfo)
case let userRootInfo as Common.UserRootInfo:
return DBXCommonUserRootInfo(swift: userRootInfo)
default:
return DBXCommonRootInfo(swift: subSwift.rootInfo)
}
}

@objc
public init(
Expand Down
2 changes: 1 addition & 1 deletion stone
Loading