/* Options: Date: 2025-07-17 21:20:50 SwiftVersion: 5.0 Version: 6.40 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://hcbtas-q-albamfs-api.azurewebsites.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: SectionContentItemReq.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/content/item/{Country}/{Lang}/{Section}") // @Route("/content/item/{Country}/{Lang}/{Section}/{ItemCode}") // @Route("/content/item", "GET") public class SectionContentItemReq : IReturn, Codable { public typealias Return = Content public var country:String? public var lang:String? public var section:String? public var itemId:String? public var itemCode:String? required public init(){} } // @Route("/content", "POST,PUT") public class Content : Entity, IReturn { public typealias Return = Content public var section:String? public var itemId:String? public var itemCode:String? public var country:String? public var lang:String? public var app:String? public var companyId:String? public var company:String? public var elements:[String:String] = [:] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case section case itemId case itemCode case country case lang case app case companyId case company case elements } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) section = try container.decodeIfPresent(String.self, forKey: .section) itemId = try container.decodeIfPresent(String.self, forKey: .itemId) itemCode = try container.decodeIfPresent(String.self, forKey: .itemCode) country = try container.decodeIfPresent(String.self, forKey: .country) lang = try container.decodeIfPresent(String.self, forKey: .lang) app = try container.decodeIfPresent(String.self, forKey: .app) companyId = try container.decodeIfPresent(String.self, forKey: .companyId) company = try container.decodeIfPresent(String.self, forKey: .company) elements = try container.decodeIfPresent([String:String].self, forKey: .elements) ?? [:] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if section != nil { try container.encode(section, forKey: .section) } if itemId != nil { try container.encode(itemId, forKey: .itemId) } if itemCode != nil { try container.encode(itemCode, forKey: .itemCode) } if country != nil { try container.encode(country, forKey: .country) } if lang != nil { try container.encode(lang, forKey: .lang) } if app != nil { try container.encode(app, forKey: .app) } if companyId != nil { try container.encode(companyId, forKey: .companyId) } if company != nil { try container.encode(company, forKey: .company) } if elements.count > 0 { try container.encode(elements, forKey: .elements) } } } public class Entity : IEntity, Codable { public var id:String? required public init(){} } public class Entity : Codable { public var logoUri:String? public var name:String? public var contactDetails:ContactDetails? required public init(){} }