Mercedes.Agency.Orchestration.API

<back to all web services

GetMotabilityVehiclesRequest

Vehicle
Requires Authentication
The following routes are available for this service:
GET/v1/vehicle/MotabilityVehiclesGet motability eligible vehicles
<?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 GetMotabilityVehiclesRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

class Package implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Description=null
    ) {
    }

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

class MotabilityVehicle implements IPackages, IMotabilityFilterFields, JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $CommissionNumber='',
        /** @var string */
        public string $Vin='',
        /** @var string|null */
        public ?string $Vtn=null,
        /** @var string */
        public string $Description='',
        /** @var string */
        public string $Model='',
        /** @var string */
        public string $BM7NST='',
        /** @var string */
        public string $ModelYearCode='',
        /** @var string */
        public string $HalfModelYearCode='',
        /** @var string */
        public string $FullModelYearCode='',
        /** @var string */
        public string $Fuel='',
        /** @var string */
        public string $PrimaryPaintColourCode='',
        /** @var string */
        public string $Colour='',
        /** @var string */
        public string $PrimaryUpholsteryCode='',
        /** @var string */
        public string $Upholstery='',
        /** @var array<Package>|null */
        public ?array $Packages=null,
        /** @var string */
        public string $Account='',
        /** @var string */
        public string $Location='',
        /** @var bool|null */
        public ?bool $IsDisplayStock=null,
        /** @var string */
        public string $DisplayStockAgent='',
        /** @var bool|null */
        public ?bool $IsSellable=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CommissionNumber'])) $this->CommissionNumber = $o['CommissionNumber'];
        if (isset($o['Vin'])) $this->Vin = $o['Vin'];
        if (isset($o['Vtn'])) $this->Vtn = $o['Vtn'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Model'])) $this->Model = $o['Model'];
        if (isset($o['BM7NST'])) $this->BM7NST = $o['BM7NST'];
        if (isset($o['ModelYearCode'])) $this->ModelYearCode = $o['ModelYearCode'];
        if (isset($o['HalfModelYearCode'])) $this->HalfModelYearCode = $o['HalfModelYearCode'];
        if (isset($o['FullModelYearCode'])) $this->FullModelYearCode = $o['FullModelYearCode'];
        if (isset($o['Fuel'])) $this->Fuel = $o['Fuel'];
        if (isset($o['PrimaryPaintColourCode'])) $this->PrimaryPaintColourCode = $o['PrimaryPaintColourCode'];
        if (isset($o['Colour'])) $this->Colour = $o['Colour'];
        if (isset($o['PrimaryUpholsteryCode'])) $this->PrimaryUpholsteryCode = $o['PrimaryUpholsteryCode'];
        if (isset($o['Upholstery'])) $this->Upholstery = $o['Upholstery'];
        if (isset($o['Packages'])) $this->Packages = JsonConverters::fromArray('Package', $o['Packages']);
        if (isset($o['Account'])) $this->Account = $o['Account'];
        if (isset($o['Location'])) $this->Location = $o['Location'];
        if (isset($o['IsDisplayStock'])) $this->IsDisplayStock = $o['IsDisplayStock'];
        if (isset($o['DisplayStockAgent'])) $this->DisplayStockAgent = $o['DisplayStockAgent'];
        if (isset($o['IsSellable'])) $this->IsSellable = $o['IsSellable'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CommissionNumber)) $o['CommissionNumber'] = $this->CommissionNumber;
        if (isset($this->Vin)) $o['Vin'] = $this->Vin;
        if (isset($this->Vtn)) $o['Vtn'] = $this->Vtn;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Model)) $o['Model'] = $this->Model;
        if (isset($this->BM7NST)) $o['BM7NST'] = $this->BM7NST;
        if (isset($this->ModelYearCode)) $o['ModelYearCode'] = $this->ModelYearCode;
        if (isset($this->HalfModelYearCode)) $o['HalfModelYearCode'] = $this->HalfModelYearCode;
        if (isset($this->FullModelYearCode)) $o['FullModelYearCode'] = $this->FullModelYearCode;
        if (isset($this->Fuel)) $o['Fuel'] = $this->Fuel;
        if (isset($this->PrimaryPaintColourCode)) $o['PrimaryPaintColourCode'] = $this->PrimaryPaintColourCode;
        if (isset($this->Colour)) $o['Colour'] = $this->Colour;
        if (isset($this->PrimaryUpholsteryCode)) $o['PrimaryUpholsteryCode'] = $this->PrimaryUpholsteryCode;
        if (isset($this->Upholstery)) $o['Upholstery'] = $this->Upholstery;
        if (isset($this->Packages)) $o['Packages'] = JsonConverters::toArray('Package', $this->Packages);
        if (isset($this->Account)) $o['Account'] = $this->Account;
        if (isset($this->Location)) $o['Location'] = $this->Location;
        if (isset($this->IsDisplayStock)) $o['IsDisplayStock'] = $this->IsDisplayStock;
        if (isset($this->DisplayStockAgent)) $o['DisplayStockAgent'] = $this->DisplayStockAgent;
        if (isset($this->IsSellable)) $o['IsSellable'] = $this->IsSellable;
        return empty($o) ? new class(){} : $o;
    }
}

/**
 * @template T
 */
class MotabilityStockResponse implements JsonSerializable
{
    public array $genericArgs = [];
    public static function create(array $genericArgs=[]): MotabilityStockResponse {
        $to = new MotabilityStockResponse();
        $to->genericArgs = $genericArgs;
        return $to;
    }

    public function __construct(
        /** @var int */
        public mixed $TotalVehicles=0,
        /** @var array<MotabilityVehicle>|null */
        public mixed $Vehicles=null
    ) {
    }

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

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

GET /v1/vehicle/MotabilityVehicles HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<MotabilityStockResponseOfMotabilityVehicleQN4VPG_PB xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.API.Shared.POCO">
  <TotalVehicles>0</TotalVehicles>
  <Vehicles xmlns:d2p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO">
    <d2p1:MotabilityVehicle>
      <d2p1:Account>String</d2p1:Account>
      <d2p1:BM7NST>String</d2p1:BM7NST>
      <d2p1:Colour>String</d2p1:Colour>
      <d2p1:CommissionNumber>String</d2p1:CommissionNumber>
      <d2p1:Description>String</d2p1:Description>
      <d2p1:DisplayStockAgent>String</d2p1:DisplayStockAgent>
      <d2p1:Fuel>String</d2p1:Fuel>
      <d2p1:HalfModelYearCode>String</d2p1:HalfModelYearCode>
      <d2p1:IsDisplayStock>false</d2p1:IsDisplayStock>
      <d2p1:IsSellable>false</d2p1:IsSellable>
      <d2p1:Location>String</d2p1:Location>
      <d2p1:Model>String</d2p1:Model>
      <d2p1:ModelYearCode>String</d2p1:ModelYearCode>
      <d2p1:Packages xmlns:d4p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO.Filters.v3" i:nil="true" />
      <d2p1:PrimaryPaintColourCode>String</d2p1:PrimaryPaintColourCode>
      <d2p1:PrimaryUpholsteryCode>String</d2p1:PrimaryUpholsteryCode>
      <d2p1:Upholstery>String</d2p1:Upholstery>
      <d2p1:Vin>String</d2p1:Vin>
      <d2p1:Vtn>String</d2p1:Vtn>
    </d2p1:MotabilityVehicle>
  </Vehicles>
</MotabilityStockResponseOfMotabilityVehicleQN4VPG_PB>