<?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 GenericResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Message=null,
/** @var bool|null */
public ?bool $Success=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Message'])) $this->Message = $o['Message'];
if (isset($o['Success'])) $this->Success = $o['Success'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Message)) $o['Message'] = $this->Message;
if (isset($this->Success)) $o['Success'] = $this->Success;
return empty($o) ? new class(){} : $o;
}
}
class AuctionFloorVehicle implements JsonSerializable
{
public function __construct(
// @ApiMember(IsRequired=true)
/** @var DateTime */
public DateTime $BOSDate=new DateTime(),
// @ApiMember(IsRequired=true)
/** @var string */
public string $DealerId='',
/** @description Must be 17 characters */
// @ApiMember(Description="Must be 17 characters", IsRequired=true)
/** @var string */
public string $Vin='',
// @ApiMember(IsRequired=true)
/** @var int */
public int $Year=0,
// @ApiMember(IsRequired=true)
/** @var string */
public string $Make='',
// @ApiMember(IsRequired=true)
/** @var string */
public string $Model='',
// @ApiMember(IsRequired=true)
/** @var int */
public int $Miles=0,
// @ApiMember(IsRequired=true)
/** @var string */
public string $Color='',
// @ApiMember(IsRequired=true)
/** @var float */
public float $BOSAmount=0.0,
// @ApiMember()
/** @var string|null */
public ?string $TitleNumber=null,
// @ApiMember()
/** @var string|null */
public ?string $TitleState=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BOSDate'])) $this->BOSDate = JsonConverters::from('DateTime', $o['BOSDate']);
if (isset($o['DealerId'])) $this->DealerId = $o['DealerId'];
if (isset($o['Vin'])) $this->Vin = $o['Vin'];
if (isset($o['Year'])) $this->Year = $o['Year'];
if (isset($o['Make'])) $this->Make = $o['Make'];
if (isset($o['Model'])) $this->Model = $o['Model'];
if (isset($o['Miles'])) $this->Miles = $o['Miles'];
if (isset($o['Color'])) $this->Color = $o['Color'];
if (isset($o['BOSAmount'])) $this->BOSAmount = $o['BOSAmount'];
if (isset($o['TitleNumber'])) $this->TitleNumber = $o['TitleNumber'];
if (isset($o['TitleState'])) $this->TitleState = $o['TitleState'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->BOSDate)) $o['BOSDate'] = JsonConverters::to('DateTime', $this->BOSDate);
if (isset($this->DealerId)) $o['DealerId'] = $this->DealerId;
if (isset($this->Vin)) $o['Vin'] = $this->Vin;
if (isset($this->Year)) $o['Year'] = $this->Year;
if (isset($this->Make)) $o['Make'] = $this->Make;
if (isset($this->Model)) $o['Model'] = $this->Model;
if (isset($this->Miles)) $o['Miles'] = $this->Miles;
if (isset($this->Color)) $o['Color'] = $this->Color;
if (isset($this->BOSAmount)) $o['BOSAmount'] = $this->BOSAmount;
if (isset($this->TitleNumber)) $o['TitleNumber'] = $this->TitleNumber;
if (isset($this->TitleState)) $o['TitleState'] = $this->TitleState;
return empty($o) ? new class(){} : $o;
}
}
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 /json/reply/AuctionFloorVehicle HTTP/1.1
Host: staging-api.my1stchoicefs.net
Accept: application/json
Content-Type: application/json
Content-Length: length
{"BOSDate":"0001-01-01T00:00:00.0000000","Vin":"String","Year":0,"Make":"String","Model":"String","Miles":0,"Color":"String","BOSAmount":0,"TitleNumber":"String","TitleState":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Message":"String","Success":false}