FrameAppWS

<back to all web services

EjecutaQueryRQ

Requires Authentication
The following routes are available for this service:
All Verbs/Utilidades/Consultas/Listados/Ejecucion
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class EjecutaQueryRS implements JsonSerializable
{
    public function __construct(
        /** @var array<array<string,Object>>|null */
        public ?array $DatosConsulta=null,
        /** @var int */
        public int $TotalRegistros=0,
        /** @var int */
        public int $TotalGrupos=0,
        /** @var array<Object>|null */
        public ?array $SummaryList=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DatosConsulta'])) $this->DatosConsulta = JsonConverters::fromArray('Dictionary<String,Object>', $o['DatosConsulta']);
        if (isset($o['TotalRegistros'])) $this->TotalRegistros = $o['TotalRegistros'];
        if (isset($o['TotalGrupos'])) $this->TotalGrupos = $o['TotalGrupos'];
        if (isset($o['SummaryList'])) $this->SummaryList = JsonConverters::fromArray('Object', $o['SummaryList']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DatosConsulta)) $o['DatosConsulta'] = JsonConverters::toArray('Dictionary<String,Object>', $this->DatosConsulta);
        if (isset($this->TotalRegistros)) $o['TotalRegistros'] = $this->TotalRegistros;
        if (isset($this->TotalGrupos)) $o['TotalGrupos'] = $this->TotalGrupos;
        if (isset($this->SummaryList)) $o['SummaryList'] = JsonConverters::toArray('Object', $this->SummaryList);
        return empty($o) ? new class(){} : $o;
    }
}

enum Lenguajes : string
{
    case ES = 'ES';
    case PT = 'PT';
    case EN = 'EN';
}

class gridSortOptions implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $selector=null,
        /** @var bool|null */
        public ?bool $desc=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['selector'])) $this->selector = $o['selector'];
        if (isset($o['desc'])) $this->desc = $o['desc'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->selector)) $o['selector'] = $this->selector;
        if (isset($this->desc)) $o['desc'] = $this->desc;
        return empty($o) ? new class(){} : $o;
    }
}

class gridGroupOptions implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $selector=null,
        /** @var bool|null */
        public ?bool $desc=null,
        /** @var bool|null */
        public ?bool $isExpanded=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['selector'])) $this->selector = $o['selector'];
        if (isset($o['desc'])) $this->desc = $o['desc'];
        if (isset($o['isExpanded'])) $this->isExpanded = $o['isExpanded'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->selector)) $o['selector'] = $this->selector;
        if (isset($this->desc)) $o['desc'] = $this->desc;
        if (isset($this->isExpanded)) $o['isExpanded'] = $this->isExpanded;
        return empty($o) ? new class(){} : $o;
    }
}

class EjecutaQueryRQ implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $IDVista=0,
        /** @var bool|null */
        public ?bool $DatosDetalles=null,
        /** @var array<string,Object>|null */
        public ?array $Parametros=null,
        /** @var Lenguajes|null */
        public ?Lenguajes $Lenguaje=null,
        /** @var int */
        public int $RecordSkip=0,
        /** @var int */
        public int $RecordTake=0,
        /** @var array<Object>|null */
        public ?array $Filter=null,
        /** @var gridSortOptions|null */
        public ?gridSortOptions $Sort=null,
        /** @var gridGroupOptions|null */
        public ?gridGroupOptions $Group=null,
        /** @var gridSummaryOptions[]|null */
        public ?array $SummaryGroupItems=null,
        /** @var gridSummaryOptions[]|null */
        public ?array $SummaryTotalItems=null,
        /** @var bool|null */
        public ?bool $omitirPaginacion=null,
        /** @var bool|null */
        public ?bool $multiEmpresaSel=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['IDVista'])) $this->IDVista = $o['IDVista'];
        if (isset($o['DatosDetalles'])) $this->DatosDetalles = $o['DatosDetalles'];
        if (isset($o['Parametros'])) $this->Parametros = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','Object']), $o['Parametros']);
        if (isset($o['Lenguaje'])) $this->Lenguaje = JsonConverters::from('Lenguajes', $o['Lenguaje']);
        if (isset($o['RecordSkip'])) $this->RecordSkip = $o['RecordSkip'];
        if (isset($o['RecordTake'])) $this->RecordTake = $o['RecordTake'];
        if (isset($o['Filter'])) $this->Filter = JsonConverters::fromArray('Object', $o['Filter']);
        if (isset($o['Sort'])) $this->Sort = JsonConverters::from('gridSortOptions', $o['Sort']);
        if (isset($o['Group'])) $this->Group = JsonConverters::from('gridGroupOptions', $o['Group']);
        if (isset($o['SummaryGroupItems'])) $this->SummaryGroupItems = JsonConverters::fromArray('gridSummaryOptions', $o['SummaryGroupItems']);
        if (isset($o['SummaryTotalItems'])) $this->SummaryTotalItems = JsonConverters::fromArray('gridSummaryOptions', $o['SummaryTotalItems']);
        if (isset($o['omitirPaginacion'])) $this->omitirPaginacion = $o['omitirPaginacion'];
        if (isset($o['multiEmpresaSel'])) $this->multiEmpresaSel = $o['multiEmpresaSel'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->IDVista)) $o['IDVista'] = $this->IDVista;
        if (isset($this->DatosDetalles)) $o['DatosDetalles'] = $this->DatosDetalles;
        if (isset($this->Parametros)) $o['Parametros'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','Object']), $this->Parametros);
        if (isset($this->Lenguaje)) $o['Lenguaje'] = JsonConverters::to('Lenguajes', $this->Lenguaje);
        if (isset($this->RecordSkip)) $o['RecordSkip'] = $this->RecordSkip;
        if (isset($this->RecordTake)) $o['RecordTake'] = $this->RecordTake;
        if (isset($this->Filter)) $o['Filter'] = JsonConverters::toArray('Object', $this->Filter);
        if (isset($this->Sort)) $o['Sort'] = JsonConverters::to('gridSortOptions', $this->Sort);
        if (isset($this->Group)) $o['Group'] = JsonConverters::to('gridGroupOptions', $this->Group);
        if (isset($this->SummaryGroupItems)) $o['SummaryGroupItems'] = JsonConverters::toArray('gridSummaryOptions', $this->SummaryGroupItems);
        if (isset($this->SummaryTotalItems)) $o['SummaryTotalItems'] = JsonConverters::toArray('gridSummaryOptions', $this->SummaryTotalItems);
        if (isset($this->omitirPaginacion)) $o['omitirPaginacion'] = $this->omitirPaginacion;
        if (isset($this->multiEmpresaSel)) $o['multiEmpresaSel'] = $this->multiEmpresaSel;
        return empty($o) ? new class(){} : $o;
    }
}

class gridSummaryOptions implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $selector=null,
        /** @var string|null */
        public ?string $summaryType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['selector'])) $this->selector = $o['selector'];
        if (isset($o['summaryType'])) $this->summaryType = $o['summaryType'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->selector)) $o['selector'] = $this->selector;
        if (isset($this->summaryType)) $o['summaryType'] = $this->summaryType;
        return empty($o) ? new class(){} : $o;
    }
}

PHP EjecutaQueryRQ 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 /Utilidades/Consultas/Listados/Ejecucion HTTP/1.1 
Host: soluser-recaudo.sgsas.co 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	IDVista: 0,
	DatosDetalles: False,
	Parametros: 
	{
		String: {}
	},
	Lenguaje: ES,
	RecordSkip: 0,
	RecordTake: 0,
	Filter: 
	[
		{
			
		}
	],
	Sort: 
	{
		selector: String,
		desc: False
	},
	Group: 
	{
		selector: String,
		desc: False,
		isExpanded: False
	},
	SummaryGroupItems: 
	[
		{
			selector: String,
			summaryType: String
		}
	],
	SummaryTotalItems: 
	[
		{
			selector: String,
			summaryType: String
		}
	],
	omitirPaginacion: False,
	multiEmpresaSel: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	DatosConsulta: 
	[
		{
			String: {}
		}
	],
	TotalRegistros: 0,
	TotalGrupos: 0,
	SummaryList: 
	[
		{
			
		}
	]
}