/* Options: Date: 2025-09-03 19:00:50 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: UpdateMachineRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/machines/{Id}", "PUT,PATCH") public class UpdateMachineRequest : PutPatchOperationTenanted, IReturn { public typealias Return = UpdateMachineResponse public var id:String? public var name:String? public var type:String? public var manufacturedOn:Date? public var location:String? public var configuration:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case name case type case manufacturedOn case location case configuration } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(String.self, forKey: .id) 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) configuration = try container.decodeIfPresent(String.self, forKey: .configuration) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } 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 configuration != nil { try container.encode(configuration, forKey: .configuration) } } } public class UpdateMachineResponse : Codable { public var responseStatus:ResponseStatus? public var machine:Machine? required public init(){} } public protocol ITenantedRequest { var organisationId:String? { get set } } public class PutPatchOperationUnTenanted : IPatch, IPut, Codable { required public init(){} } public class PutPatchOperationTenanted : PutPatchOperationUnTenanted, 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 } }