FrameAppWS

<back to all web services

FileUtilsRQ

Requires Authentication
The following routes are available for this service:
All Verbs/utilidades/FilesConvertPdf
<?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 FilesRS implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Nombre=null,
        /** @var string|null */
        public ?string $Base64File=null,
        /** @var string|null */
        public ?string $Ext=null
    ) {
    }

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

class FileUtilsRS implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Success=null,
        /** @var string|null */
        public ?string $ErrorMessage=null,
        /** @var array<FilesRS>|null */
        public ?array $Archivos=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Success'])) $this->Success = $o['Success'];
        if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
        if (isset($o['Archivos'])) $this->Archivos = JsonConverters::fromArray('FilesRS', $o['Archivos']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Success)) $o['Success'] = $this->Success;
        if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
        if (isset($this->Archivos)) $o['Archivos'] = JsonConverters::toArray('FilesRS', $this->Archivos);
        return empty($o) ? new class(){} : $o;
    }
}

class FilesData implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Nombre=null,
        /** @var string|null */
        public ?string $Base64File=null,
        /** @var string|null */
        public ?string $ExtRQ=null
    ) {
    }

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

class FileUtilsRQ implements JsonSerializable
{
    public function __construct(
        /** @var array<FilesData>|null */
        public ?array $Files=null,
        /** @var bool|null */
        public ?bool $DocMerge=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Files'])) $this->Files = JsonConverters::fromArray('FilesData', $o['Files']);
        if (isset($o['DocMerge'])) $this->DocMerge = $o['DocMerge'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Files)) $o['Files'] = JsonConverters::toArray('FilesData', $this->Files);
        if (isset($this->DocMerge)) $o['DocMerge'] = $this->DocMerge;
        return empty($o) ? new class(){} : $o;
    }
}

PHP FileUtilsRQ DTOs

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

HTTP + OTHER

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

POST /utilidades/FilesConvertPdf HTTP/1.1 
Host: soluser-recaudo.sgsas.co 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Files":[{"Nombre":"String","Base64File":"String","ExtRQ":"String"}],"DocMerge":false}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Success":false,"ErrorMessage":"String","Archivos":[{"Nombre":"String","Base64File":"String","Ext":"String"}]}