Mercedes.VehicleManagement.API

<back to all web services

SecuredOfflineVehicleRequest

Requires Authentication
The following routes are available for this service:
GET/v1/Vehicle/SecuredOfflineGet all secured vehicles which are offlineGet audit of all secured vehicles which are currently offline, including the user who secured it, the date and the reason.
<?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 SecuredOfflineVehicle implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $commissionNumber='',
        /** @var string|null */
        public ?string $vin=null,
        /** @var string */
        public string $salesDescription='',
        /** @var string */
        public string $model='',
        /** @var string */
        public string $colour='',
        /** @var string */
        public string $fuelType='',
        /** @var string */
        public string $upholstery='',
        /** @var string */
        public string $account='',
        /** @var string */
        public string $gasId='',
        /** @var string */
        public string $secureReason='',
        /** @var string */
        public string $secureDate='',
        /** @var string */
        public string $offlineDate=''
    ) {
    }

    /** @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['salesDescription'])) $this->salesDescription = $o['salesDescription'];
        if (isset($o['model'])) $this->model = $o['model'];
        if (isset($o['colour'])) $this->colour = $o['colour'];
        if (isset($o['fuelType'])) $this->fuelType = $o['fuelType'];
        if (isset($o['upholstery'])) $this->upholstery = $o['upholstery'];
        if (isset($o['account'])) $this->account = $o['account'];
        if (isset($o['gasId'])) $this->gasId = $o['gasId'];
        if (isset($o['secureReason'])) $this->secureReason = $o['secureReason'];
        if (isset($o['secureDate'])) $this->secureDate = $o['secureDate'];
        if (isset($o['offlineDate'])) $this->offlineDate = $o['offlineDate'];
    }
    
    /** @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->salesDescription)) $o['salesDescription'] = $this->salesDescription;
        if (isset($this->model)) $o['model'] = $this->model;
        if (isset($this->colour)) $o['colour'] = $this->colour;
        if (isset($this->fuelType)) $o['fuelType'] = $this->fuelType;
        if (isset($this->upholstery)) $o['upholstery'] = $this->upholstery;
        if (isset($this->account)) $o['account'] = $this->account;
        if (isset($this->gasId)) $o['gasId'] = $this->gasId;
        if (isset($this->secureReason)) $o['secureReason'] = $this->secureReason;
        if (isset($this->secureDate)) $o['secureDate'] = $this->secureDate;
        if (isset($this->offlineDate)) $o['offlineDate'] = $this->offlineDate;
        return empty($o) ? new class(){} : $o;
    }
}

class SecuredOfflineVehicleResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<SecuredOfflineVehicle>|null */
        public ?array $vehicles=null
    ) {
    }

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

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

PHP SecuredOfflineVehicleRequest DTOs

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

HTTP + OTHER

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

GET /v1/Vehicle/SecuredOffline HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{Unable to show example output for type 'SecuredOfflineVehicleResponse' using the custom 'other' filter}Cannot dynamically create an instance of type 'Mercedes.VehicleManagement.API.Shared.Clients.Vehicle.SecuredOfflineVehicleResponse'. Reason: No parameterless constructor defined.