All Verbs | /restfiles/InsertReportRQ |
---|
<?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 InsertReportRS implements JsonSerializable
{
public function __construct(
/** @var bool|null */
public ?bool $isInsertado=null,
/** @var string|null */
public ?string $Error=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['isInsertado'])) $this->isInsertado = $o['isInsertado'];
if (isset($o['Error'])) $this->Error = $o['Error'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->isInsertado)) $o['isInsertado'] = $this->isInsertado;
if (isset($this->Error)) $o['Error'] = $this->Error;
return empty($o) ? new class(){} : $o;
}
}
class InsertReportRQ implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $usua_login=null,
/** @var float */
public float $carp_carp=0.0,
/** @var float */
public float $rept_rept=0.0,
/** @var string|null */
public ?string $rept_nombre=null,
/** @var int */
public int $rept_tipo=0,
/** @var DateTime */
public DateTime $rept_fecmodi=new DateTime(),
/** @var DateTime */
public DateTime $rept_fecelimi=new DateTime(),
/** @var string|null */
public ?string $rept_version=null,
/** @var int */
public int $rept_tamano=0,
/** @var float */
public float $blob_blob=0.0,
/** @var float */
public float $vist_vist=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['usua_login'])) $this->usua_login = $o['usua_login'];
if (isset($o['carp_carp'])) $this->carp_carp = $o['carp_carp'];
if (isset($o['rept_rept'])) $this->rept_rept = $o['rept_rept'];
if (isset($o['rept_nombre'])) $this->rept_nombre = $o['rept_nombre'];
if (isset($o['rept_tipo'])) $this->rept_tipo = $o['rept_tipo'];
if (isset($o['rept_fecmodi'])) $this->rept_fecmodi = JsonConverters::from('DateTime', $o['rept_fecmodi']);
if (isset($o['rept_fecelimi'])) $this->rept_fecelimi = JsonConverters::from('DateTime', $o['rept_fecelimi']);
if (isset($o['rept_version'])) $this->rept_version = $o['rept_version'];
if (isset($o['rept_tamano'])) $this->rept_tamano = $o['rept_tamano'];
if (isset($o['blob_blob'])) $this->blob_blob = $o['blob_blob'];
if (isset($o['vist_vist'])) $this->vist_vist = $o['vist_vist'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->usua_login)) $o['usua_login'] = $this->usua_login;
if (isset($this->carp_carp)) $o['carp_carp'] = $this->carp_carp;
if (isset($this->rept_rept)) $o['rept_rept'] = $this->rept_rept;
if (isset($this->rept_nombre)) $o['rept_nombre'] = $this->rept_nombre;
if (isset($this->rept_tipo)) $o['rept_tipo'] = $this->rept_tipo;
if (isset($this->rept_fecmodi)) $o['rept_fecmodi'] = JsonConverters::to('DateTime', $this->rept_fecmodi);
if (isset($this->rept_fecelimi)) $o['rept_fecelimi'] = JsonConverters::to('DateTime', $this->rept_fecelimi);
if (isset($this->rept_version)) $o['rept_version'] = $this->rept_version;
if (isset($this->rept_tamano)) $o['rept_tamano'] = $this->rept_tamano;
if (isset($this->blob_blob)) $o['blob_blob'] = $this->blob_blob;
if (isset($this->vist_vist)) $o['vist_vist'] = $this->vist_vist;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /restfiles/InsertReportRQ HTTP/1.1
Host: soluser-recaudo.sgsas.co
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"usua_login":"String","carp_carp":0,"rept_rept":0,"rept_nombre":"String","rept_tipo":0,"rept_fecmodi":null,"rept_fecelimi":null,"rept_version":"String","rept_tamano":0,"blob_blob":0,"vist_vist":0}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"isInsertado":false,"Error":"String"}