/* Options: Date: 2025-06-07 18:20:04 SwiftVersion: 5.0 Version: 8.12 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://soluser-recaudo.sgsas.co //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: GuardarDatosFormaRQ.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/Utilidades/Formas/GuardarDatos") public class GuardarDatosFormaRQ : IReturn, Codable { public typealias Return = GuardarDatosFormaRS public var idForma:Int public var operacion:OperacionDatos public var datosMaestro:[String:Object] = [:] public var datosDetalle:[GuardarDatosDetalle] = [] public var formasDep:[GuardarDatosFormaRQ] = [] public var tokenCargaArchivos:String required public init(){} } public class GuardarDatosFormaRS : Codable { public var success:Bool public var error:String public var datosLlaveMaestro:[String:Object] = [:] public var novedadesDetalles:[GuardarDatosFormaDetalleRS] = [] public var respuestaProcAlmacenado:ExecuteDBFunctionRS required public init(){} } public enum OperacionDatos : String, Codable { case INSERT case UPDATE case DELETE } public class GuardarDatosDetalle : Codable { public var idDetalle:Int public var datosInsert:[[String:Object]] = [] public var datosUpdate:[[String:Object]] = [] public var datosDelete:[[String:Object]] = [] public var nombreArchivo:String required public init(){} } public class GuardarDatosFormaDetalleRS : Codable { public var idDetalle:Double public var novedades:[NovedadesCarga] = [] required public init(){} } public class NovedadesCarga : Codable { public var fila:Int public var columna:Int public var tipoError:String public var novedad:String required public init(){} } public class ExecuteDBFunctionRS : GeneralRS { //respuesta:Object ignored. Type could not be extended in Swift public var idEjecucion:Double public var urlArchivo:String public var tipoRespuesta:String public var background:Bool public var tiempoRespuestaBD:Int public var tiempoRespuestaTotal:Int /** * Id del código de respuesta 1: Correcto, -1: Error */ // @ApiMember(DataType="int", Description="Id del código de respuesta 1: Correcto, -1: Error", IsRequired=true, ParameterType="body") public var codigo:Int /** * Mensaje que se envía al ejecutar el servicio */ // @ApiMember(DataType="string", Description="Mensaje que se envía al ejecutar el servicio", IsRequired=true, ParameterType="body") public var mensaje:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case respuesta case idEjecucion case urlArchivo case tipoRespuesta case background case tiempoRespuestaBD case tiempoRespuestaTotal case codigo case mensaje } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) respuesta = try container.decodeIfPresent(Object.self, forKey: .respuesta) idEjecucion = try container.decodeIfPresent(Double.self, forKey: .idEjecucion) urlArchivo = try container.decodeIfPresent(String.self, forKey: .urlArchivo) tipoRespuesta = try container.decodeIfPresent(String.self, forKey: .tipoRespuesta) background = try container.decodeIfPresent(Bool.self, forKey: .background) tiempoRespuestaBD = try container.decodeIfPresent(Int.self, forKey: .tiempoRespuestaBD) tiempoRespuestaTotal = try container.decodeIfPresent(Int.self, forKey: .tiempoRespuestaTotal) codigo = try container.decodeIfPresent(Int.self, forKey: .codigo) mensaje = try container.decodeIfPresent(String.self, forKey: .mensaje) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if respuesta != nil { try container.encode(respuesta, forKey: .respuesta) } if idEjecucion != nil { try container.encode(idEjecucion, forKey: .idEjecucion) } if urlArchivo != nil { try container.encode(urlArchivo, forKey: .urlArchivo) } if tipoRespuesta != nil { try container.encode(tipoRespuesta, forKey: .tipoRespuesta) } if background != nil { try container.encode(background, forKey: .background) } if tiempoRespuestaBD != nil { try container.encode(tiempoRespuestaBD, forKey: .tiempoRespuestaBD) } if tiempoRespuestaTotal != nil { try container.encode(tiempoRespuestaTotal, forKey: .tiempoRespuestaTotal) } if codigo != nil { try container.encode(codigo, forKey: .codigo) } if mensaje != nil { try container.encode(mensaje, forKey: .mensaje) } } }