/* Options: Date: 2025-09-05 04:28:35 SwiftVersion: 5.0 Version: 6.10 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://foundrystage-api-app.azurewebsites.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: CreateMachineRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/machines", "POST") public class CreateMachineRequest : PostOperationTenanted, IReturn { public typealias Return = CreateMachineResponse public var name:String? public var type:String? public var manufacturedOn:Date? public var location:String? public var timezone:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case name case type case manufacturedOn case location case timezone } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) name = try container.decodeIfPresent(String.self, forKey: .name) type = try container.decodeIfPresent(String.self, forKey: .type) manufacturedOn = try container.decodeIfPresent(Date.self, forKey: .manufacturedOn) location = try container.decodeIfPresent(String.self, forKey: .location) timezone = try container.decodeIfPresent(String.self, forKey: .timezone) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if name != nil { try container.encode(name, forKey: .name) } if type != nil { try container.encode(type, forKey: .type) } if manufacturedOn != nil { try container.encode(manufacturedOn, forKey: .manufacturedOn) } if location != nil { try container.encode(location, forKey: .location) } if timezone != nil { try container.encode(timezone, forKey: .timezone) } } } public class CreateMachineResponse : Codable { public var responseStatus:ResponseStatus? public var machine:Machine? public var apiKey:String? required public init(){} } public class PostOperationUnTenanted : IPost, Codable { required public init(){} } public protocol ITenantedRequest { var organisationId:String? { get set } } public class PostOperationTenanted : PostOperationUnTenanted, ITenantedRequest { public var organisationId:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case organisationId } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) organisationId = try container.decodeIfPresent(String.self, forKey: .organisationId) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if organisationId != nil { try container.encode(organisationId, forKey: .organisationId) } } } public class Machine : IIdentifiableResource, Codable { public var name:String? public var type:String? public var manufacturedOn:Date? public var location:String? public var configuration:String? public var id:String? required public init(){} } public protocol IIdentifiableResource { var id:String? { get set } }