All Verbs | /utilidades/executeDBFunction |
---|
import Foundation
import ServiceStack
public class ExecuteDBFunctionRQ : Codable
{
public var nombreServicio:String
public var parametros:[String:Object] = [:]
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 ExecuteDBFunctionRQ DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /utilidades/executeDBFunction HTTP/1.1
Host: soluser-recaudo.sgsas.co
Accept: application/json
Content-Type: application/json
Content-Length: length
{"NombreServicio":"String","Parametros":{"String":{}}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Respuesta":{},"IDEjecucion":0,"URLArchivo":"String","TipoRespuesta":"String","Background":false,"TiempoRespuestaBD":0,"TiempoRespuestaTotal":0,"Codigo":0,"Mensaje":"String"}