Mercedes.Agency.Orchestration.API

<back to all web services

VehicleSwapHistoricalRequest

VehicleSwapHistorical
Requires Authentication
The following routes are available for this service:
GET/v1/VehicleSwap/HistoricalGet Historical Vehicle RecordsThis endpoint calls the same named endpoint in the Agency API to return historical Vehicle Swap records.
<?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 VehicleSwapHistorical implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Reference='',
        /** @var string */
        public string $OrderType='',
        /** @var string */
        public string $VehicleSwapGuid='',
        /** @var string */
        public string $OrderGuid='',
        /** @var string|null */
        public ?string $Showroom=null,
        /** @var string|null */
        public ?string $GasUserId=null,
        /** @var string|null */
        public ?string $OldCommissionNumber=null,
        /** @var string|null */
        public ?string $NewCommissionNumber=null,
        /** @var string|null */
        public ?string $RequestReason=null,
        /** @var bool|null */
        public ?bool $SentToCesar=null,
        /** @var int */
        public int $StatusId=0,
        /** @var string */
        public string $Status='',
        /** @var DateTime */
        public DateTime $SwapCreated=new DateTime(),
        /** @var DateTime|null */
        public ?DateTime $SwapUpdated=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['OrderType'])) $this->OrderType = $o['OrderType'];
        if (isset($o['VehicleSwapGuid'])) $this->VehicleSwapGuid = $o['VehicleSwapGuid'];
        if (isset($o['OrderGuid'])) $this->OrderGuid = $o['OrderGuid'];
        if (isset($o['Showroom'])) $this->Showroom = $o['Showroom'];
        if (isset($o['GasUserId'])) $this->GasUserId = $o['GasUserId'];
        if (isset($o['OldCommissionNumber'])) $this->OldCommissionNumber = $o['OldCommissionNumber'];
        if (isset($o['NewCommissionNumber'])) $this->NewCommissionNumber = $o['NewCommissionNumber'];
        if (isset($o['RequestReason'])) $this->RequestReason = $o['RequestReason'];
        if (isset($o['SentToCesar'])) $this->SentToCesar = $o['SentToCesar'];
        if (isset($o['StatusId'])) $this->StatusId = $o['StatusId'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['SwapCreated'])) $this->SwapCreated = JsonConverters::from('DateTime', $o['SwapCreated']);
        if (isset($o['SwapUpdated'])) $this->SwapUpdated = JsonConverters::from('DateTime', $o['SwapUpdated']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->OrderType)) $o['OrderType'] = $this->OrderType;
        if (isset($this->VehicleSwapGuid)) $o['VehicleSwapGuid'] = $this->VehicleSwapGuid;
        if (isset($this->OrderGuid)) $o['OrderGuid'] = $this->OrderGuid;
        if (isset($this->Showroom)) $o['Showroom'] = $this->Showroom;
        if (isset($this->GasUserId)) $o['GasUserId'] = $this->GasUserId;
        if (isset($this->OldCommissionNumber)) $o['OldCommissionNumber'] = $this->OldCommissionNumber;
        if (isset($this->NewCommissionNumber)) $o['NewCommissionNumber'] = $this->NewCommissionNumber;
        if (isset($this->RequestReason)) $o['RequestReason'] = $this->RequestReason;
        if (isset($this->SentToCesar)) $o['SentToCesar'] = $this->SentToCesar;
        if (isset($this->StatusId)) $o['StatusId'] = $this->StatusId;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->SwapCreated)) $o['SwapCreated'] = JsonConverters::to('DateTime', $this->SwapCreated);
        if (isset($this->SwapUpdated)) $o['SwapUpdated'] = JsonConverters::to('DateTime', $this->SwapUpdated);
        return empty($o) ? new class(){} : $o;
    }
}

class VehicleSwapHistoricalResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<VehicleSwapHistorical>|null */
        public ?array $HistoricalVehicleSwaps=null
    ) {
    }

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

class VehicleSwapHistoricalRequest implements IPost, JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP VehicleSwapHistoricalRequest 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.

GET /v1/VehicleSwap/Historical HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	HistoricalVehicleSwaps: 
	[
		{
			Reference: String,
			OrderType: String,
			VehicleSwapGuid: 00000000000000000000000000000000,
			OrderGuid: 00000000000000000000000000000000,
			Showroom: String,
			GasUserId: String,
			OldCommissionNumber: String,
			NewCommissionNumber: String,
			RequestReason: String,
			SentToCesar: False,
			StatusId: 0,
			SwapCreated: 0001-01-01,
			SwapUpdated: 0001-01-01
		}
	]
}