Skip to content

Commit cc0fa30

Browse files
committed
feat: Public NKTrash initializer.
This is necessary to make the initializer available outside of the NextcloudKit module, in example in test implementations of NextcloudFileProviderKit. Signed-off-by: Iva Horn <iva.horn@icloud.com>
1 parent fe114aa commit cc0fa30

1 file changed

Lines changed: 36 additions & 15 deletions

File tree

Sources/NextcloudKit/Models/NKTrash.swift

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,41 @@
55

66
import Foundation
77

8+
///
9+
/// Representation of a trashed item.
10+
///
811
public struct NKTrash: Sendable {
9-
public var ocId = ""
10-
public var contentType = ""
11-
public var typeIdentifier = ""
12-
public var date = Date()
13-
public var directory: Bool = false
14-
public var fileId = ""
15-
public var fileName = ""
16-
public var filePath = ""
17-
public var hasPreview: Bool = false
18-
public var iconName = ""
19-
public var size: Int64 = 0
20-
public var classFile = ""
21-
public var trashbinFileName = ""
22-
public var trashbinOriginalLocation = ""
23-
public var trashbinDeletionTime = Date()
12+
public var ocId: String
13+
public var contentType: String
14+
public var typeIdentifier: String
15+
public var date: Date
16+
public var directory: Bool
17+
public var fileId: String
18+
public var fileName: String
19+
public var filePath: String
20+
public var hasPreview: Bool
21+
public var iconName: String
22+
public var size: Int64
23+
public var classFile: String
24+
public var trashbinFileName: String
25+
public var trashbinOriginalLocation: String
26+
public var trashbinDeletionTime: Date
27+
28+
public init(ocId: String = "", contentType: String = "", typeIdentifier: String = "", date: Date = Date(), directory: Bool = false, fileId: String = "", fileName: String = "", filePath: String = "", hasPreview: Bool = false, iconName: String = "", size: Int64 = 0, classFile: String = "", trashbinFileName: String = "", trashbinOriginalLocation: String = "", trashbinDeletionTime: Date = Date()) {
29+
self.ocId = ocId
30+
self.contentType = contentType
31+
self.typeIdentifier = typeIdentifier
32+
self.date = date
33+
self.directory = directory
34+
self.fileId = fileId
35+
self.fileName = fileName
36+
self.filePath = filePath
37+
self.hasPreview = hasPreview
38+
self.iconName = iconName
39+
self.size = size
40+
self.classFile = classFile
41+
self.trashbinFileName = trashbinFileName
42+
self.trashbinOriginalLocation = trashbinOriginalLocation
43+
self.trashbinDeletionTime = trashbinDeletionTime
44+
}
2445
}

0 commit comments

Comments
 (0)