All Verbs | /Utilidades/Formas/GuardarDatos |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NovedadesCarga:
fila: int = 0
columna: int = 0
tipo_error: Optional[str] = None
novedad: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GuardarDatosFormaDetalleRS:
id_detalle: Decimal = decimal.Decimal(0)
novedades: Optional[List[NovedadesCarga]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GeneralRS:
# @ApiMember(DataType="int", Description="Id del código de respuesta 1: Correcto, -1: Error", IsRequired=true, ParameterType="body")
codigo: int = 0
"""
Id del código de respuesta 1: Correcto, -1: Error
"""
# @ApiMember(DataType="string", Description="Mensaje que se envía al ejecutar el servicio", IsRequired=true, ParameterType="body")
mensaje: Optional[str] = None
"""
Mensaje que se envía al ejecutar el servicio
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ExecuteDBFunctionRS(GeneralRS):
respuesta: Optional[Object] = None
id_ejecucion: Decimal = decimal.Decimal(0)
url_archivo: Optional[str] = None
tipo_respuesta: Optional[str] = None
background: bool = False
tiempo_respuesta_b_d: int = 0
tiempo_respuesta_total: int = 0
# @ApiMember(DataType="int", Description="Id del código de respuesta 1: Correcto, -1: Error", IsRequired=true, ParameterType="body")
codigo: int = 0
"""
Id del código de respuesta 1: Correcto, -1: Error
"""
# @ApiMember(DataType="string", Description="Mensaje que se envía al ejecutar el servicio", IsRequired=true, ParameterType="body")
mensaje: Optional[str] = None
"""
Mensaje que se envía al ejecutar el servicio
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GuardarDatosFormaRS:
success: bool = False
error: Optional[str] = None
datos_llave_maestro: Optional[Dict[str, Object]] = None
novedades_detalles: Optional[List[GuardarDatosFormaDetalleRS]] = None
respuesta_proc_almacenado: Optional[ExecuteDBFunctionRS] = None
class OperacionDatos(str, Enum):
INSERT = 'INSERT'
UPDATE = 'UPDATE'
DELETE = 'DELETE'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GuardarDatosDetalle:
id_detalle: int = 0
datos_insert: Optional[List[Dict[str, Object]]] = None
datos_update: Optional[List[Dict[str, Object]]] = None
datos_delete: Optional[List[Dict[str, Object]]] = None
nombre_archivo: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GuardarDatosFormaRQ:
id_forma: int = 0
operacion: Optional[OperacionDatos] = None
datos_maestro: Optional[Dict[str, Object]] = None
datos_detalle: Optional[List[GuardarDatosDetalle]] = None
formas_dep: Optional[List[GuardarDatosFormaRQ]] = None
token_carga_archivos: Optional[str] = None
Python GuardarDatosFormaRQ 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/Formas/GuardarDatos HTTP/1.1
Host: soluser-recaudo.sgsas.co
Accept: application/json
Content-Type: application/json
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"}],"FormasDep":null,"TokenCargaArchivos":"String"}],"TokenCargaArchivos":"String"}],"TokenCargaArchivos":"String"}],"TokenCargaArchivos":"String"}
HTTP/1.1 200 OK Content-Type: application/json 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"}}