Skip to content

Commit 1ba2873

Browse files
committed
Add a public initialiser for NKFile
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
1 parent 387d1c0 commit 1ba2873

1 file changed

Lines changed: 126 additions & 0 deletions

File tree

Sources/NextcloudKit/Models/NKFile.swift

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,130 @@ public struct NKFile: Sendable {
8080
}
8181
public var exifPhotos = [[String: String?]]()
8282
public var placePhotos: String?
83+
84+
public init(
85+
account: String = "",
86+
classFile: String = "",
87+
commentsUnread: Bool = false,
88+
contentType: String = "",
89+
checksums: String = "",
90+
creationDate: Date? = nil,
91+
dataFingerprint: String = "",
92+
date: Date = Date(),
93+
directory: Bool = false,
94+
downloadURL: String = "",
95+
downloadLimits: [NKDownloadLimit] = .init(),
96+
e2eEncrypted: Bool = false,
97+
etag: String = "",
98+
favorite: Bool = false,
99+
fileId: String = "",
100+
fileName: String = "",
101+
hasPreview: Bool = false,
102+
iconName: String = "",
103+
mountType: String = "",
104+
name: String = "",
105+
note: String = "",
106+
ocId: String = "",
107+
ownerId: String = "",
108+
ownerDisplayName: String = "",
109+
lock: Bool = false,
110+
lockOwner: String = "",
111+
lockOwnerEditor: String = "",
112+
lockOwnerType: Int = 0,
113+
lockOwnerDisplayName: String = "",
114+
lockTime: Date? = nil,
115+
lockTimeOut: Date? = nil,
116+
path: String = "",
117+
permissions: String = "",
118+
quotaUsedBytes: Int64 = 0,
119+
quotaAvailableBytes: Int64 = 0,
120+
resourceType: String = "",
121+
richWorkspace: String? = nil,
122+
sharePermissionsCollaborationServices: Int = 0,
123+
sharePermissionsCloudMesh: [String] = [],
124+
shareType: [Int] = [],
125+
size: Int64 = 0,
126+
serverUrl: String = "",
127+
tags: [String] = [],
128+
trashbinFileName: String = "",
129+
trashbinOriginalLocation: String = "",
130+
trashbinDeletionTime: Date = Date(),
131+
uploadDate: Date? = nil,
132+
urlBase: String = "",
133+
user: String = "",
134+
userId: String = "",
135+
latitude: Double = 0,
136+
longitude: Double = 0,
137+
altitude: Double = 0,
138+
height: Double = 0,
139+
width: Double = 0,
140+
hidden: Bool = false,
141+
livePhotoFile: String = "",
142+
isFlaggedAsLivePhotoByServer: Bool = false,
143+
datePhotosOriginal: Date? = nil,
144+
exifPhotos: [[String : String?]] = .init(),
145+
placePhotos: String? = nil) {
146+
147+
self.account = account
148+
self.classFile = classFile
149+
self.commentsUnread = commentsUnread
150+
self.contentType = contentType
151+
self.checksums = checksums
152+
self.creationDate = creationDate
153+
self.dataFingerprint = dataFingerprint
154+
self.date = date
155+
self.directory = directory
156+
self.downloadURL = downloadURL
157+
self.downloadLimits = downloadLimits
158+
self.e2eEncrypted = e2eEncrypted
159+
self.etag = etag
160+
self.favorite = favorite
161+
self.fileId = fileId
162+
self.fileName = fileName
163+
self.hasPreview = hasPreview
164+
self.iconName = iconName
165+
self.mountType = mountType
166+
self.name = name
167+
self.note = note
168+
self.ocId = ocId
169+
self.ownerId = ownerId
170+
self.ownerDisplayName = ownerDisplayName
171+
self.lock = lock
172+
self.lockOwner = lockOwner
173+
self.lockOwnerEditor = lockOwnerEditor
174+
self.lockOwnerType = lockOwnerType
175+
self.lockOwnerDisplayName = lockOwnerDisplayName
176+
self.lockTime = lockTime
177+
self.lockTimeOut = lockTimeOut
178+
self.path = path
179+
self.permissions = permissions
180+
self.quotaUsedBytes = quotaUsedBytes
181+
self.quotaAvailableBytes = quotaAvailableBytes
182+
self.resourceType = resourceType
183+
self.richWorkspace = richWorkspace
184+
self.sharePermissionsCollaborationServices = sharePermissionsCollaborationServices
185+
self.sharePermissionsCloudMesh = sharePermissionsCloudMesh
186+
self.shareType = shareType
187+
self.size = size
188+
self.serverUrl = serverUrl
189+
self.tags = tags
190+
self.trashbinFileName = trashbinFileName
191+
self.trashbinOriginalLocation = trashbinOriginalLocation
192+
self.trashbinDeletionTime = trashbinDeletionTime
193+
self.uploadDate = uploadDate
194+
self.urlBase = urlBase
195+
self.user = user
196+
self.userId = userId
197+
self.latitude = latitude
198+
self.longitude = longitude
199+
self.altitude = altitude
200+
self.height = height
201+
self.width = width
202+
self.hidden = hidden
203+
self.livePhotoFile = livePhotoFile
204+
self.isFlaggedAsLivePhotoByServer = isFlaggedAsLivePhotoByServer
205+
self.datePhotosOriginal = datePhotosOriginal
206+
self.exifPhotos = exifPhotos
207+
self.placePhotos = placePhotos
208+
}
83209
}

0 commit comments

Comments
 (0)