Mercedes.Agency.Orchestration.API

<back to all web services

VehicleSwapActiveRequest

VehicleSwapActive
Requires Authentication
The following routes are available for this service:
GET/v1/VehicleSwap/ActiveGet Active Vehicle Swap recordsThis endpoint calls the same named endpoint in the Agency API to return active 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 VehicleSwapActive implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @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 $CommissionNumber=null,
        /** @var string|null */
        public ?string $RequestReason=null,
        /** @var bool|null */
        public ?bool $SentToCesar=null,
        /** @var DateTime */
        public DateTime $CreationDate=new DateTime(),
        /** @var DateTime|null */
        public ?DateTime $MaintenanceDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        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['CommissionNumber'])) $this->CommissionNumber = $o['CommissionNumber'];
        if (isset($o['RequestReason'])) $this->RequestReason = $o['RequestReason'];
        if (isset($o['SentToCesar'])) $this->SentToCesar = $o['SentToCesar'];
        if (isset($o['CreationDate'])) $this->CreationDate = JsonConverters::from('DateTime', $o['CreationDate']);
        if (isset($o['MaintenanceDate'])) $this->MaintenanceDate = JsonConverters::from('DateTime', $o['MaintenanceDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        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->CommissionNumber)) $o['CommissionNumber'] = $this->CommissionNumber;
        if (isset($this->RequestReason)) $o['RequestReason'] = $this->RequestReason;
        if (isset($this->SentToCesar)) $o['SentToCesar'] = $this->SentToCesar;
        if (isset($this->CreationDate)) $o['CreationDate'] = JsonConverters::to('DateTime', $this->CreationDate);
        if (isset($this->MaintenanceDate)) $o['MaintenanceDate'] = JsonConverters::to('DateTime', $this->MaintenanceDate);
        return empty($o) ? new class(){} : $o;
    }
}

class VehicleSwapActiveResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<VehicleSwapActive>|null */
        public ?array $ActiveVehicleSwaps=null
    ) {
    }

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

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

PHP VehicleSwapActiveRequest DTOs

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

HTTP + CSV

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

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

{"ActiveVehicleSwaps":[{"Id":0,"Reference":"String","OrderType":"String","VehicleSwapGuid":"00000000000000000000000000000000","OrderGuid":"00000000000000000000000000000000","Showroom":"String","CommissionNumber":"String","RequestReason":"String","SentToCesar":false,"CreationDate":"\/Date(-62135596800000-0000)\/","MaintenanceDate":"\/Date(-62135596800000-0000)\/"}]}