/* Options: Date: 2025-08-04 04:27:16 SwiftVersion: 5.0 Version: 6.110 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://szallitoiportal-be.veolia.hu //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: BrowseAllSupplierFile.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/supplier/{supplierid}/file", "GET") public class BrowseAllSupplierFile : IReturn, IGet, Codable { public typealias Return = BrowseAllSupplierFileResponse public var supplierId:Int required public init(){} } public class BrowseAllSupplierFileResponse : ResponseBase { public var supplierFiles:[SupplierFileDetails] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case supplierFiles } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) supplierFiles = try container.decodeIfPresent([SupplierFileDetails].self, forKey: .supplierFiles) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if supplierFiles.count > 0 { try container.encode(supplierFiles, forKey: .supplierFiles) } } } public enum SupplierDocumentType : Int, Codable { case RegistrationForm = 0 case SpecimenSignature = 1 } public class ResponseBase : Codable { public var responseStatus:ResponseStatus required public init(){} } public class SupplierFileDetails : BrowseFileResponseBase { public var supplierId:Int public var documentType:SupplierDocumentType required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case supplierId case documentType } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) supplierId = try container.decodeIfPresent(Int.self, forKey: .supplierId) documentType = try container.decodeIfPresent(SupplierDocumentType.self, forKey: .documentType) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if supplierId != nil { try container.encode(supplierId, forKey: .supplierId) } if documentType != nil { try container.encode(documentType, forKey: .documentType) } } } public class BrowseFileResponseBase : Codable { public var id:Int public var fileContentId:Int public var fileName:String public var size:Int required public init(){} }