Mercedes.VehicleManagement.API

<back to all web services

GetCentralVehicleFiltersRequest

Filter
Requires Authentication
The following routes are available for this service:
GET/v1/Vehicle/Filters/CentralGet Central Stock Vehicle Filters
<?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 AgeFilter implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ageLowerBound=0,
        /** @var int */
        public int $ageUpperBound=0,
        /** @var string */
        public string $label=''
    ) {
    }

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

class VehicleFilters implements JsonSerializable
{
    public function __construct(
        /** @var array<AgeFilter>|null */
        public ?array $ageFilters=null,
        /** @var AgeFilter|null */
        public ?AgeFilter $ageRange=null
    ) {
    }

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

class VehicleFiltersResponse implements JsonSerializable
{
    public function __construct(
        /** @var VehicleFilters|null */
        public ?VehicleFilters $vehicleFilters=null
    ) {
    }

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

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

PHP GetCentralVehicleFiltersRequest 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/Filters/Central 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

{"vehicleFilters":{"ageRange":{"ageLowerBound":0,"ageUpperBound":0,"label":"String"}}}