-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSendableItemMetadata.swift
More file actions
265 lines (260 loc) · 9.34 KB
/
SendableItemMetadata.swift
File metadata and controls
265 lines (260 loc) · 9.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
//
// SendableItemMetadata.swift
// NextcloudFileProviderKit
//
// Created by Claudio Cambra on 15/4/25.
//
import Foundation
/// Realm objects are inherently unsendable and not thread-safe. **DON'T EXPOSE THEM.**
/// Make sure this is the only type that is returned to other code that is unaware of Realm.
public struct SendableItemMetadata: ItemMetadata, Sendable {
public var ocId: String
public var account: String
public var checksums: String
public var chunkUploadId: String?
public var classFile: String
public var commentsUnread: Bool
public var contentType: String
public var creationDate: Date
public var dataFingerprint: String
public var date: Date
public var directory: Bool
public var downloadURL: String
public var e2eEncrypted: Bool
public var etag: String
public var favorite: Bool
public var fileId: String
public var fileName: String
public var fileNameView: String
public var hasPreview: Bool
public var hidden: Bool
public var iconName: String
public var iconUrl: String
public var mountType: String
public var name: String
public var note: String
public var ownerId: String
public var ownerDisplayName: String
public var livePhotoFile: String?
public var lock: Bool
public var lockOwner: String?
public var lockOwnerEditor: String?
public var lockOwnerType: Int?
public var lockOwnerDisplayName: String?
public var lockTime: Date?
public var lockTimeOut: Date?
public var path: String
public var permissions: String
public var quotaUsedBytes: Int64
public var quotaAvailableBytes: Int64
public var resourceType: String
public var richWorkspace: String?
public var serverUrl: String
public var session: String?
public var sessionError: String?
public var sessionTaskIdentifier: Int?
public var sharePermissionsCollaborationServices: Int
public var sharePermissionsCloudMesh: [String]
public var shareType: [Int]
public var size: Int64
public var status: Int
public var tags: [String]
public var downloaded: Bool
public var uploaded: Bool
public var keepOffline: Bool
public var trashbinFileName: String
public var trashbinOriginalLocation: String
public var trashbinDeletionTime: Date
public var uploadDate: Date
public var urlBase: String
public var user: String
public var userId: String
public init(
ocId: String,
account: String,
checksums: String = "",
chunkUploadId: String? = nil,
classFile: String,
commentsUnread: Bool = false,
contentType: String,
creationDate: Date,
dataFingerprint: String = "",
date: Date = Date(),
directory: Bool,
downloadURL: String = "",
e2eEncrypted: Bool,
etag: String,
favorite: Bool = false,
fileId: String,
fileName: String,
fileNameView: String,
hasPreview: Bool,
hidden: Bool = false,
iconName: String,
iconUrl: String = "",
livePhotoFile: String? = nil,
mountType: String,
name: String = "",
note: String = "",
ownerId: String,
ownerDisplayName: String,
lock: Bool = false,
lockOwner: String? = nil,
lockOwnerEditor: String? = nil,
lockOwnerType: Int? = nil,
lockOwnerDisplayName: String? = nil,
lockTime: Date? = nil,
lockTimeOut: Date? = nil,
path: String,
permissions: String = "RGDNVW",
quotaUsedBytes: Int64 = 0,
quotaAvailableBytes: Int64 = 0,
resourceType: String = "",
richWorkspace: String? = nil,
serverUrl: String,
session: String? = nil,
sessionError: String? = nil,
sessionTaskIdentifier: Int? = nil,
sharePermissionsCollaborationServices: Int = 0,
sharePermissionsCloudMesh: [String] = [],
shareType: [Int] = [],
size: Int64,
status: Int = 0,
tags: [String] = [],
downloaded: Bool = false,
uploaded: Bool = false,
keepOffline: Bool = false,
trashbinFileName: String = "",
trashbinOriginalLocation: String = "",
trashbinDeletionTime: Date = Date(),
uploadDate: Date = Date(),
urlBase: String,
user: String,
userId: String
) {
self.ocId = ocId
self.account = account
self.checksums = checksums
self.chunkUploadId = chunkUploadId
self.classFile = classFile
self.commentsUnread = commentsUnread
self.contentType = contentType
self.creationDate = creationDate
self.dataFingerprint = dataFingerprint
self.date = date
self.directory = directory
self.downloadURL = downloadURL
self.e2eEncrypted = e2eEncrypted
self.etag = etag
self.favorite = favorite
self.fileId = fileId
self.fileName = fileName
self.fileNameView = fileNameView
self.hasPreview = hasPreview
self.hidden = hidden
self.iconName = iconName
self.iconUrl = iconUrl
self.livePhotoFile = livePhotoFile
self.mountType = mountType
self.name = name
self.note = note
self.ownerId = ownerId
self.ownerDisplayName = ownerDisplayName
self.lock = lock
self.lockOwner = lockOwner
self.lockOwnerEditor = lockOwnerEditor
self.lockOwnerType = lockOwnerType
self.lockOwnerDisplayName = lockOwnerDisplayName
self.lockTime = lockTime
self.lockTimeOut = lockTimeOut
self.path = path
self.permissions = permissions
self.quotaUsedBytes = quotaUsedBytes
self.quotaAvailableBytes = quotaAvailableBytes
self.resourceType = resourceType
self.richWorkspace = richWorkspace
self.serverUrl = serverUrl
self.session = session
self.sessionError = sessionError
self.sessionTaskIdentifier = sessionTaskIdentifier
self.sharePermissionsCollaborationServices = sharePermissionsCollaborationServices
self.sharePermissionsCloudMesh = sharePermissionsCloudMesh
self.shareType = shareType
self.size = size
self.status = status
self.tags = tags
self.downloaded = downloaded
self.uploaded = uploaded
self.keepOffline = keepOffline
self.trashbinFileName = trashbinFileName
self.trashbinOriginalLocation = trashbinOriginalLocation
self.trashbinDeletionTime = trashbinDeletionTime
self.uploadDate = uploadDate
self.urlBase = urlBase
self.user = user
self.userId = userId
}
init(value: any ItemMetadata) {
self.ocId = value.ocId
self.account = value.account
self.checksums = value.checksums
self.chunkUploadId = value.chunkUploadId
self.classFile = value.classFile
self.commentsUnread = value.commentsUnread
self.contentType = value.contentType
self.creationDate = value.creationDate
self.dataFingerprint = value.dataFingerprint
self.date = value.date
self.directory = value.directory
self.downloadURL = value.downloadURL
self.e2eEncrypted = value.e2eEncrypted
self.etag = value.etag
self.favorite = value.favorite
self.fileId = value.fileId
self.fileName = value.fileName
self.fileNameView = value.fileNameView
self.hasPreview = value.hasPreview
self.hidden = value.hidden
self.iconName = value.iconName
self.iconUrl = value.iconUrl
self.livePhotoFile = value.livePhotoFile
self.mountType = value.mountType
self.name = value.name
self.note = value.note
self.ownerId = value.ownerId
self.ownerDisplayName = value.ownerDisplayName
self.lock = value.lock
self.lockOwner = value.lockOwner
self.lockOwnerEditor = value.lockOwnerEditor
self.lockOwnerType = value.lockOwnerType
self.lockOwnerDisplayName = value.lockOwnerDisplayName
self.lockTime = value.lockTime
self.lockTimeOut = value.lockTimeOut
self.path = value.path
self.permissions = value.permissions
self.quotaUsedBytes = value.quotaUsedBytes
self.quotaAvailableBytes = value.quotaAvailableBytes
self.resourceType = value.resourceType
self.richWorkspace = value.richWorkspace
self.serverUrl = value.serverUrl
self.session = value.session
self.sessionError = value.sessionError
self.sessionTaskIdentifier = value.sessionTaskIdentifier
self.sharePermissionsCollaborationServices = value.sharePermissionsCollaborationServices
self.sharePermissionsCloudMesh = value.sharePermissionsCloudMesh
self.shareType = value.shareType
self.size = value.size
self.status = value.status
self.downloaded = value.downloaded
self.uploaded = value.uploaded
self.keepOffline = value.keepOffline
self.tags = value.tags
self.trashbinFileName = value.trashbinFileName
self.trashbinOriginalLocation = value.trashbinOriginalLocation
self.trashbinDeletionTime = value.trashbinDeletionTime
self.uploadDate = value.uploadDate
self.urlBase = value.urlBase
self.user = value.user
self.userId = value.userId
}
}