Mercedes.VehicleManagement.API

<back to all web services

DataProcessListByTypeRequest

Requires Authentication
The following routes are available for this service:
POST/v1/GetAllDataProcessListGet list of all data processes by the type
POST/v1/GetDataProcessListGet list of data processes created by the user
<?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 DataProcessResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $id=0,
        /** @var int */
        public int $type=0,
        /** @var string */
        public string $typeName='',
        /** @var string */
        public string $statusName='',
        /** @var int */
        public int $status=0,
        /** @var int */
        public int $totalRecords=0,
        /** @var int */
        public int $processedRecords=0,
        /** @var string */
        public string $fileName='',
        /** @var string */
        public string $originalFileName='',
        /** @var string */
        public string $dateCreated='',
        /** @var string */
        public string $dateStarted='',
        /** @var string */
        public string $dateFinished='',
        /** @var string */
        public string $gasId=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['type'])) $this->type = $o['type'];
        if (isset($o['typeName'])) $this->typeName = $o['typeName'];
        if (isset($o['statusName'])) $this->statusName = $o['statusName'];
        if (isset($o['status'])) $this->status = $o['status'];
        if (isset($o['totalRecords'])) $this->totalRecords = $o['totalRecords'];
        if (isset($o['processedRecords'])) $this->processedRecords = $o['processedRecords'];
        if (isset($o['fileName'])) $this->fileName = $o['fileName'];
        if (isset($o['originalFileName'])) $this->originalFileName = $o['originalFileName'];
        if (isset($o['dateCreated'])) $this->dateCreated = $o['dateCreated'];
        if (isset($o['dateStarted'])) $this->dateStarted = $o['dateStarted'];
        if (isset($o['dateFinished'])) $this->dateFinished = $o['dateFinished'];
        if (isset($o['gasId'])) $this->gasId = $o['gasId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->type)) $o['type'] = $this->type;
        if (isset($this->typeName)) $o['typeName'] = $this->typeName;
        if (isset($this->statusName)) $o['statusName'] = $this->statusName;
        if (isset($this->status)) $o['status'] = $this->status;
        if (isset($this->totalRecords)) $o['totalRecords'] = $this->totalRecords;
        if (isset($this->processedRecords)) $o['processedRecords'] = $this->processedRecords;
        if (isset($this->fileName)) $o['fileName'] = $this->fileName;
        if (isset($this->originalFileName)) $o['originalFileName'] = $this->originalFileName;
        if (isset($this->dateCreated)) $o['dateCreated'] = $this->dateCreated;
        if (isset($this->dateStarted)) $o['dateStarted'] = $this->dateStarted;
        if (isset($this->dateFinished)) $o['dateFinished'] = $this->dateFinished;
        if (isset($this->gasId)) $o['gasId'] = $this->gasId;
        return empty($o) ? new class(){} : $o;
    }
}

class DataProcessListResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<DataProcessResponse>|null */
        public ?array $dataProcesses=null
    ) {
    }

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

class DataProcessListRequest implements IPost, JsonSerializable
{
    public function __construct(
        /** @var array<int>|null */
        public ?array $type=null
    ) {
    }

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

class DataProcessListByTypeRequest extends DataProcessListRequest implements JsonSerializable
{
    /**
     * @param array<int>|null $type
     */
    public function __construct(
        ?array $type=null
    ) {
        parent::__construct($type);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        return empty($o) ? new class(){} : $o;
    }
}

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

POST /v1/GetAllDataProcessList HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	type: 
	[
		0
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	dataProcesses: 
	[
		{
			id: 0,
			type: 0,
			typeName: String,
			statusName: String,
			status: 0,
			totalRecords: 0,
			processedRecords: 0,
			fileName: String,
			originalFileName: String,
			dateCreated: String,
			dateStarted: String,
			dateFinished: String,
			gasId: String
		}
	]
}