FirstChoice.API

<back to all web services

AuctionFloorVehicle

Requires Authentication
<?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;
    }
}

PHP AuctionFloorVehicle DTOs

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

HTTP + XML

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

POST /xml/reply/AuctionFloorVehicle HTTP/1.1 
Host: staging-api.my1stchoicefs.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AuctionFloorVehicle xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/FirstChoice.API.ServiceModel">
  <BOSAmount>0</BOSAmount>
  <BOSDate>0001-01-01T00:00:00</BOSDate>
  <Color>String</Color>
  <DealerId>00000000-0000-0000-0000-000000000000</DealerId>
  <Make>String</Make>
  <Miles>0</Miles>
  <Model>String</Model>
  <TitleNumber>String</TitleNumber>
  <TitleState>String</TitleState>
  <Vin>String</Vin>
  <Year>0</Year>
</AuctionFloorVehicle>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GenericResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/FirstChoice.API.ServiceModel">
  <Message>String</Message>
  <Success>false</Success>
</GenericResponse>