Mercedes.VehicleManagement.API

<back to all web services

BaumusterOffersCSVRequest

Requires Authentication
The following routes are available for this service:
GET/v1/Vehicle/Baumuster/csvReturns Baumuster Data in CSV format
<?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};


interface IVirtualDirectory
{
}

/**
 * @property IVirtualDirectory|null $rootDirectory
 * @property string|null $virtualPathSeparator
 * @property string|null $realPathSeparator
 */
interface IVirtualPathProvider
{
}

/**
 * @property IVirtualPathProvider|null $virtualPathProvider
 * @property string|null $extension
 * @property int $length
 */
interface IVirtualFile
{
}

// @Flags()
enum CacheControl : int
{
    case None = 0;
    case Public = 1;
    case Private = 2;
    case MustRevalidate = 4;
    case NoCache = 8;
    case NoStore = 16;
    case NoTransform = 32;
    case ProxyRevalidate = 64;
}

interface IContentTypeWriter
{
}

/**
 * @property Object|null $originalResponse
 * @property IRequest|null $request
 * @property int $statusCode
 * @property string|null $statusDescription
 * @property string|null $contentType
 * @property ByteArray|null $outputStream
 * @property Object|null $dto
 * @property bool $useBufferedStream
 * @property bool $isClosed
 * @property bool $keepAlive
 * @property bool $hasStarted
 * @property array<string,Object>|null $items
 */
interface IResponse
{
}

// @Flags()
enum RequestAttributes : int
{
    case None = 0;
    case Localhost = 1;
    case LocalSubnet = 2;
    case External = 4;
    case Secure = 8;
    case InSecure = 16;
    case AnySecurityMode = 24;
    case HttpHead = 32;
    case HttpGet = 64;
    case HttpPost = 128;
    case HttpPut = 256;
    case HttpDelete = 512;
    case HttpPatch = 1024;
    case HttpOptions = 2048;
    case HttpOther = 4096;
    case AnyHttpMethod = 8160;
    case OneWay = 8192;
    case Reply = 16384;
    case AnyCallStyle = 24576;
    case Soap11 = 32768;
    case Soap12 = 65536;
    case Xml = 131072;
    case Json = 262144;
    case Jsv = 524288;
    case ProtoBuf = 1048576;
    case Csv = 2097152;
    case Html = 4194304;
    case Jsonl = 8388608;
    case MsgPack = 16777216;
    case FormatOther = 33554432;
    case AnyFormat = 67076096;
    case Http = 67108864;
    case MessageQueue = 134217728;
    case Tcp = 268435456;
    case Grpc = 536870912;
    case EndpointOther = 1073741824;
    case AnyEndpoint = 2080374784;
    case InProcess = -2147483648;
    case InternalNetworkAccess = -2147483645;
    case AnyNetworkAccessType = -2147483641;
    case Any = -1;
}

/**
 * @property bool $acceptsBrotli
 * @property bool $acceptsDeflate
 * @property bool $acceptsGzip
 */
interface IRequestPreferences
{
}

/**
 * @property string|null $name
 * @property string|null $fileName
 * @property int $contentLength
 * @property string|null $contentType
 * @property ByteArray|null $inputStream
 */
interface IHttpFile
{
}

/**
 * @property Object|null $originalRequest
 * @property IResponse|null $response
 * @property string|null $operationName
 * @property string|null $verb
 * @property RequestAttributes $requestAttributes
 * @property IRequestPreferences|null $requestPreferences
 * @property Object|null $dto
 * @property string|null $contentType
 * @property bool $isLocal
 * @property string|null $userAgent
 * @property array<string,Cookie>|null $cookies
 * @property string|null $responseContentType
 * @property bool $hasExplicitResponseContentType
 * @property array<string,Object>|null $items
 * @property NameValueCollection|null $headers
 * @property NameValueCollection|null $queryString
 * @property NameValueCollection|null $formData
 * @property bool $useBufferedStream
 * @property string|null $rawUrl
 * @property string|null $absoluteUri
 * @property string|null $userHostAddress
 * @property string|null $remoteIp
 * @property string|null $authorization
 * @property bool $isSecureConnection
 * @property string[]|null $acceptTypes
 * @property string|null $pathInfo
 * @property string|null $originalPathInfo
 * @property ByteArray|null $inputStream
 * @property int $contentLength
 * @property IHttpFile[]|null $files
 * @property string|null $urlReferrer
 */
interface IRequest
{
}

class HttpResult implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $responseText=null,
        /** @var ByteArray|null */
        public ?ByteArray $responseStream=null,
        /** @var FileInfo|null */
        public ?FileInfo $fileInfo=null,
        /** @var IVirtualFile|null */
        public ?IVirtualFile $virtualFile=null,
        /** @var string|null */
        public ?string $contentType=null,
        /** @var array<string,string>|null */
        public ?array $headers=null,
        /** @var array<Cookie>|null */
        public ?array $cookies=null,
        /** @var string|null */
        public ?string $eTag=null,
        /** @var DateInterval|null */
        public ?DateInterval $age=null,
        /** @var DateInterval|null */
        public ?DateInterval $maxAge=null,
        /** @var DateTime|null */
        public ?DateTime $expires=null,
        /** @var DateTime|null */
        public ?DateTime $lastModified=null,
        /** @var CacheControl|null */
        public ?CacheControl $cacheControl=null,
        /** @var Func<IDisposable>|null */
        public ?Func $resultScope=null,
        /** @var bool|null */
        public ?bool $allowsPartialResponse=null,
        /** @var array<string,string>|null */
        public ?array $options=null,
        /** @var int */
        public int $status=0,
        /** @var HttpStatusCode|null */
        public ?HttpStatusCode $statusCode=null,
        /** @var string|null */
        public ?string $statusDescription=null,
        /** @var Object|null */
        public ?Object $response=null,
        /** @var IContentTypeWriter|null */
        public ?IContentTypeWriter $responseFilter=null,
        /** @var IRequest|null */
        public ?IRequest $requestContext=null,
        /** @var string|null */
        public ?string $view=null,
        /** @var string|null */
        public ?string $template=null,
        /** @var int */
        public int $paddingLength=0,
        /** @var bool|null */
        public ?bool $isPartialRequest=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['responseText'])) $this->responseText = $o['responseText'];
        if (isset($o['responseStream'])) $this->responseStream = JsonConverters::from('ByteArray', $o['responseStream']);
        if (isset($o['fileInfo'])) $this->fileInfo = JsonConverters::from('FileInfo', $o['fileInfo']);
        if (isset($o['virtualFile'])) $this->virtualFile = JsonConverters::from('IVirtualFile', $o['virtualFile']);
        if (isset($o['contentType'])) $this->contentType = $o['contentType'];
        if (isset($o['headers'])) $this->headers = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['headers']);
        if (isset($o['cookies'])) $this->cookies = JsonConverters::fromArray('Cookie', $o['cookies']);
        if (isset($o['eTag'])) $this->eTag = $o['eTag'];
        if (isset($o['age'])) $this->age = JsonConverters::from('TimeSpan', $o['age']);
        if (isset($o['maxAge'])) $this->maxAge = JsonConverters::from('TimeSpan', $o['maxAge']);
        if (isset($o['expires'])) $this->expires = JsonConverters::from('DateTime', $o['expires']);
        if (isset($o['lastModified'])) $this->lastModified = JsonConverters::from('DateTime', $o['lastModified']);
        if (isset($o['cacheControl'])) $this->cacheControl = JsonConverters::from('CacheControl', $o['cacheControl']);
        if (isset($o['resultScope'])) $this->resultScope = JsonConverters::from(JsonConverters::context('Func',genericArgs:['IDisposable']), $o['resultScope']);
        if (isset($o['allowsPartialResponse'])) $this->allowsPartialResponse = $o['allowsPartialResponse'];
        if (isset($o['options'])) $this->options = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['options']);
        if (isset($o['status'])) $this->status = $o['status'];
        if (isset($o['statusCode'])) $this->statusCode = JsonConverters::from('HttpStatusCode', $o['statusCode']);
        if (isset($o['statusDescription'])) $this->statusDescription = $o['statusDescription'];
        if (isset($o['response'])) $this->response = JsonConverters::from('Object', $o['response']);
        if (isset($o['responseFilter'])) $this->responseFilter = JsonConverters::from('IContentTypeWriter', $o['responseFilter']);
        if (isset($o['requestContext'])) $this->requestContext = JsonConverters::from('IRequest', $o['requestContext']);
        if (isset($o['view'])) $this->view = $o['view'];
        if (isset($o['template'])) $this->template = $o['template'];
        if (isset($o['paddingLength'])) $this->paddingLength = $o['paddingLength'];
        if (isset($o['isPartialRequest'])) $this->isPartialRequest = $o['isPartialRequest'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->responseText)) $o['responseText'] = $this->responseText;
        if (isset($this->responseStream)) $o['responseStream'] = JsonConverters::to('ByteArray', $this->responseStream);
        if (isset($this->fileInfo)) $o['fileInfo'] = JsonConverters::to('FileInfo', $this->fileInfo);
        if (isset($this->virtualFile)) $o['virtualFile'] = JsonConverters::to('IVirtualFile', $this->virtualFile);
        if (isset($this->contentType)) $o['contentType'] = $this->contentType;
        if (isset($this->headers)) $o['headers'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->headers);
        if (isset($this->cookies)) $o['cookies'] = JsonConverters::toArray('Cookie', $this->cookies);
        if (isset($this->eTag)) $o['eTag'] = $this->eTag;
        if (isset($this->age)) $o['age'] = JsonConverters::to('TimeSpan', $this->age);
        if (isset($this->maxAge)) $o['maxAge'] = JsonConverters::to('TimeSpan', $this->maxAge);
        if (isset($this->expires)) $o['expires'] = JsonConverters::to('DateTime', $this->expires);
        if (isset($this->lastModified)) $o['lastModified'] = JsonConverters::to('DateTime', $this->lastModified);
        if (isset($this->cacheControl)) $o['cacheControl'] = JsonConverters::to('CacheControl', $this->cacheControl);
        if (isset($this->resultScope)) $o['resultScope'] = JsonConverters::to(JsonConverters::context('Func',genericArgs:['IDisposable']), $this->resultScope);
        if (isset($this->allowsPartialResponse)) $o['allowsPartialResponse'] = $this->allowsPartialResponse;
        if (isset($this->options)) $o['options'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->options);
        if (isset($this->status)) $o['status'] = $this->status;
        if (isset($this->statusCode)) $o['statusCode'] = JsonConverters::to('HttpStatusCode', $this->statusCode);
        if (isset($this->statusDescription)) $o['statusDescription'] = $this->statusDescription;
        if (isset($this->response)) $o['response'] = JsonConverters::to('Object', $this->response);
        if (isset($this->responseFilter)) $o['responseFilter'] = JsonConverters::to('IContentTypeWriter', $this->responseFilter);
        if (isset($this->requestContext)) $o['requestContext'] = JsonConverters::to('IRequest', $this->requestContext);
        if (isset($this->view)) $o['view'] = $this->view;
        if (isset($this->template)) $o['template'] = $this->template;
        if (isset($this->paddingLength)) $o['paddingLength'] = $this->paddingLength;
        if (isset($this->isPartialRequest)) $o['isPartialRequest'] = $this->isPartialRequest;
        return empty($o) ? new class(){} : $o;
    }
}

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

PHP BaumusterOffersCSVRequest 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/Baumuster/csv HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomHttpResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types" />