/* Options: Date: 2026-01-22 01:54:43 SwiftVersion: 5.0 Version: 6.110 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://pecuario-backend.develsystems.com //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: GetRegionsByCountry.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/api/v1/utils/regions/{CountryId}", "GET") // @Route("/api/v1/utils/regions", "GET") public class GetRegionsByCountry : IReturn, IGet, Codable { public typealias Return = GetRegionsByCountryResponse public var countryId:Int? required public init(){} } public class GetRegionsByCountryResponse : BaseResponse { public var regions:[Region] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case regions } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) regions = try container.decodeIfPresent([Region].self, forKey: .regions) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if regions.count > 0 { try container.encode(regions, forKey: .regions) } } } public class Status : Codable { public var message:String public var statusCode:Int required public init(){} } public class BaseResponse : Codable { public var status:Status required public init(){} } public class Country : Codable { public var id:Int // @Required() // @StringLength(2) public var code:String? // @Required() // @StringLength(3) public var phoneCode:String? // @Required() // @StringLength(200) public var name:String? // @Required() // @StringLength(5) public var currencySymbol:String? // @Required() // @StringLength(200) public var currencyName:String? // @Required() public var order:Int? required public init(){} } public class Region : Codable { public var id:Int // @References(typeof(Country)) public var countryId:Int // @Required() // @StringLength(200) public var name:String? required public init(){} }