FrameAppWS

<back to all web services

CreateUserAdm

Requires Authentication
The following routes are available for this service:
All Verbs/admin/crearusuario
import Foundation
import ServiceStack

public class CreateUserAdm : GuardarDatosFormaRS
{
    public var identificacion:String?
    public var nombres:String?
    public var direccion:String?
    public var telefonos:String?
    public var email:String?
    public var usuarioCreo:String?
    public var estado:String?
    public var loginAdicional:String?
    public var id:Int?
    public var codSistema:Int?
    public var codEmpresa:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case identificacion
        case nombres
        case direccion
        case telefonos
        case email
        case usuarioCreo
        case estado
        case loginAdicional
        case id
        case codSistema
        case codEmpresa
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        identificacion = try container.decodeIfPresent(String.self, forKey: .identificacion)
        nombres = try container.decodeIfPresent(String.self, forKey: .nombres)
        direccion = try container.decodeIfPresent(String.self, forKey: .direccion)
        telefonos = try container.decodeIfPresent(String.self, forKey: .telefonos)
        email = try container.decodeIfPresent(String.self, forKey: .email)
        usuarioCreo = try container.decodeIfPresent(String.self, forKey: .usuarioCreo)
        estado = try container.decodeIfPresent(String.self, forKey: .estado)
        loginAdicional = try container.decodeIfPresent(String.self, forKey: .loginAdicional)
        id = try container.decodeIfPresent(Int.self, forKey: .id)
        codSistema = try container.decodeIfPresent(Int.self, forKey: .codSistema)
        codEmpresa = try container.decodeIfPresent(Int.self, forKey: .codEmpresa)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if identificacion != nil { try container.encode(identificacion, forKey: .identificacion) }
        if nombres != nil { try container.encode(nombres, forKey: .nombres) }
        if direccion != nil { try container.encode(direccion, forKey: .direccion) }
        if telefonos != nil { try container.encode(telefonos, forKey: .telefonos) }
        if email != nil { try container.encode(email, forKey: .email) }
        if usuarioCreo != nil { try container.encode(usuarioCreo, forKey: .usuarioCreo) }
        if estado != nil { try container.encode(estado, forKey: .estado) }
        if loginAdicional != nil { try container.encode(loginAdicional, forKey: .loginAdicional) }
        if id != nil { try container.encode(id, forKey: .id) }
        if codSistema != nil { try container.encode(codSistema, forKey: .codSistema) }
        if codEmpresa != nil { try container.encode(codEmpresa, forKey: .codEmpresa) }
    }
}

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?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case respuesta
        case idEjecucion
        case urlArchivo
        case tipoRespuesta
        case background
        case tiempoRespuestaBD
        case tiempoRespuestaTotal
    }

    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)
    }

    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) }
    }
}

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 CreateUserAdm DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /admin/crearusuario HTTP/1.1 
Host: ws.jimsnwa.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Identificacion: String,
	Nombres: String,
	Direccion: String,
	Telefonos: String,
	Email: String,
	UsuarioCreo: String,
	Estado: String,
	LoginAdicional: String,
	ID: 0,
	CodSistema: 0,
	CodEmpresa: 0,
	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
	}
}
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
	}
}