Mercedes.VehicleManagement.API

<back to all web services

CentralVehiclesCsvRequest

Vehicle
Requires Authentication
The following routes are available for this service:
POST/v1/{VehicleType}/Vehicle/CentralCsvFilter central vehicle data for CSV
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CsvVehicleData:
    commission_number: Optional[str] = None
    retailer: Optional[str] = None
    description: Optional[str] = None
    model: Optional[str] = None
    colour: Optional[str] = None
    fuel_type: Optional[str] = None
    transmission: Optional[str] = None
    otr: Optional[str] = None
    days_since_port_arrival: Optional[int] = None
    offer_amount: Optional[str] = None
    offer_expiry: Optional[str] = None
    active_offers: List[str] = field(default_factory=list)
    modified: Optional[str] = None
    retail_price: Optional[str] = None
    vin: Optional[str] = None
    electric_range: int = 0
    electric_consumption: int = 0
    campaign_messages_total: int = 0
    campaign_personalised_offer_total: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CentralStockResponse:
    vehicles: Optional[List[CsvVehicleData]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CentralVehiclesCsvRequest(IPost):
    min: int = 0
    max: int = 0
    no_port_arrival_date: bool = False
    vehicle_type: Optional[str] = None

Python CentralVehiclesCsvRequest 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.

POST /v1/{VehicleType}/Vehicle/CentralCsv HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CentralVehiclesCsvRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.ServiceModel">
  <Max>0</Max>
  <Min>0</Min>
  <NoPortArrivalDate>false</NoPortArrivalDate>
  <VehicleType>String</VehicleType>
</CentralVehiclesCsvRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CentralStockResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO">
  <Vehicles xmlns:d2p1="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO.V3" i:nil="true" />
</CentralStockResponse>