All Verbs | /Utilidades/Formas/GuardarDatos |
---|
import Foundation
import ServiceStack
public class GuardarDatosFormaRQ : Codable
{
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 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 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 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) }
}
}
public class GeneralRS : Codable
{
/**
* 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(){}
}
Swift GuardarDatosFormaRQ DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Utilidades/Formas/GuardarDatos HTTP/1.1
Host: soluser-recaudo.sgsas.co
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
IDForma: 0,
Operacion: INSERT,
DatosMaestro:
{
String: {}
},
DatosDetalle:
[
{
IDDetalle: 0,
DatosInsert:
[
{
String: {}
}
],
DatosUpdate:
[
{
String: {}
}
],
DatosDelete:
[
{
String: {}
}
],
NombreArchivo: String
}
],
FormasDep:
[
{
IDForma: 0,
Operacion: INSERT,
DatosMaestro:
{
String: {}
},
DatosDetalle:
[
{
IDDetalle: 0,
DatosInsert:
[
{
String: {}
}
],
DatosUpdate:
[
{
String: {}
}
],
DatosDelete:
[
{
String: {}
}
],
NombreArchivo: String
}
],
FormasDep:
[
{
IDForma: 0,
Operacion: INSERT,
DatosMaestro:
{
String: {}
},
DatosDetalle:
[
{
IDDetalle: 0,
DatosInsert:
[
{
String: {}
}
],
DatosUpdate:
[
{
String: {}
}
],
DatosDelete:
[
{
String: {}
}
],
NombreArchivo: String
}
],
FormasDep:
[
{
IDForma: 0,
Operacion: INSERT,
DatosMaestro:
{
String: {}
},
DatosDetalle:
[
{
IDDetalle: 0,
DatosInsert:
[
{
String: {}
}
],
DatosUpdate:
[
{
String: {}
}
],
DatosDelete:
[
{
String: {}
}
],
NombreArchivo: String
}
],
TokenCargaArchivos: String
}
],
TokenCargaArchivos: String
}
],
TokenCargaArchivos: String
}
],
TokenCargaArchivos: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Success: False, Error: String, DatosLlaveMaestro: { String: {} }, NovedadesDetalles: [ { IDDetalle: 0, Novedades: [ { Fila: 0, Columna: 0, TipoError: String, Novedad: String } ] } ], RespuestaProcAlmacenado: { Respuesta: {}, IDEjecucion: 0, URLArchivo: String, TipoRespuesta: String, Background: False, TiempoRespuestaBD: 0, TiempoRespuestaTotal: 0, Codigo: 0, Mensaje: String } }