/* Options: Date: 2024-12-22 21:44:00 SwiftVersion: 6.0 Version: 8.51 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://blazor-gallery.servicestack.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True //MakePropertiesOptional: True IncludeTypes: QueryFileSystemItems.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: False //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack public class QueryFileSystemItems : QueryDb, IReturn { public typealias Return = QueryResponse public var appUserId:Int? public var fileAccessType:FileAccessType? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case appUserId case fileAccessType } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) appUserId = try container.decodeIfPresent(Int.self, forKey: .appUserId) fileAccessType = try container.decodeIfPresent(FileAccessType.self, forKey: .fileAccessType) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if appUserId != nil { try container.encode(appUserId, forKey: .appUserId) } if fileAccessType != nil { try container.encode(fileAccessType, forKey: .fileAccessType) } } } public enum FileAccessType : String, Codable { case Public case Team case Private } public class FileSystemFile : IFile, Codable { public var id:Int? public var fileName:String? public var filePath:String? public var contentType:String? public var contentLength:Int? // @References(typeof(FileSystemItem)) public var fileSystemItemId:Int? required public init(){} } public class FileSystemItem : IFileItem, Codable { public var id:Int? public var fileAccessType:FileAccessType? public var file:FileSystemFile? public var appUserId:String? required public init(){} } public protocol IFileItem { var fileAccessType:FileAccessType? { get set } } public protocol IFile { var id:Int? { get set } var fileName:String? { get set } var filePath:String? { get set } var contentType:String? { get set } var contentLength:Int? { get set } }