Mercedes.VehicleManagement.API

<back to all web services

OnlineShowroomStockCsvRequest

Vehicle
Requires Authentication
The following routes are available for this service:
POST/v1/OnlineShowroomCsv/StockSearch for Online Showroom StockCalls Vehicle Data API online showroom stock endpoint and searches for vehicles given a list of retailers. The results are used to populate the Online Showroom Stock full detail CSV export in OneAdmin
<?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 CsvVehicle implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Vehicle Type")
        /** @var string */
        public string $Vehicle_Type='',

        /** @var string */
        public string $vid='',
        /** @var string */
        public string $vin='',
        /** @var string */
        public string $fin='',
        // @DataMember(Name="Comm")
        /** @var string */
        public string $Comm='',

        // @DataMember(Name="Chassis Number")
        /** @var string */
        public string $Chassis_Number='',

        // @DataMember(Name="Model Year")
        /** @var string */
        public string $Model_Year='',

        // @DataMember(Name="Model Year Code")
        /** @var string */
        public string $Model_Year_Code='',

        // @DataMember(Name="Half Model Year Code")
        /** @var string */
        public string $Half_Model_Year_Code='',

        // @DataMember(Name="Full Model Year Code")
        /** @var string */
        public string $Full_Model_Year_Code='',

        // @DataMember(Name="Description")
        /** @var string */
        public string $Description='',

        // @DataMember(Name="Vehicle Class")
        /** @var string */
        public string $Vehicle_Class='',

        // @DataMember(Name="Body Style")
        /** @var string */
        public string $Body_Style='',

        /** @var string */
        public string $model='',
        /** @var string */
        public string $colour='',
        // @DataMember(Name="Colour Group")
        /** @var string */
        public string $Colour_Group='',

        // @DataMember(Name="Fuel Type")
        /** @var string */
        public string $Fuel_Type='',

        /** @var string */
        public string $transmission='',
        /** @var string */
        public string $packages='',
        /** @var string */
        public string $lines='',
        // @DataMember(Name="Product Range")
        /** @var string */
        public string $Product_Range='',

        /** @var string */
        public string $engine='',
        /** @var bool|null */
        public ?bool $isAMG=null,
        /** @var string */
        public string $upholstery='',
        /** @var string */
        public string $nst='',
        /** @var string */
        public string $baumuster='',
        /** @var string */
        public string $bm7NST='',
        /** @var float|null */
        public ?float $acceleration=null,
        // @DataMember(Name="Boot Capacity")
        /** @var int|null */
        public ?int $Boot_Capacity=null,

        // @DataMember(Name="Top Speed")
        /** @var float|null */
        public ?float $Top_Speed=null,

        // @DataMember(Name="Drive Concept")
        /** @var string */
        public string $Drive_Concept='',

        // @DataMember(Name="Combustion Power HP")
        /** @var float|null */
        public ?float $Combustion_Power_HP=null,

        // @DataMember(Name="Electric Power KW")
        /** @var float|null */
        public ?float $Electric_Power_KW=null,

        // @DataMember(Name="Electric Power HP")
        /** @var float|null */
        public ?float $Electric_Power_HP=null,

        // @DataMember(Name="Combined Power KW")
        /** @var float|null */
        public ?float $Combined_Power_KW=null,

        // @DataMember(Name="Combined Power HP")
        /** @var float|null */
        public ?float $Combined_Power_HP=null,

        // @DataMember(Name="Electric Range")
        /** @var float|null */
        public ?float $Electric_Range=null,

        // @DataMember(Name="Electric Consumption")
        /** @var float|null */
        public ?float $Electric_Consumption=null,

        // @DataMember(Name="Emission Combined")
        /** @var string */
        public string $Emission_Combined='',

        // @DataMember(Name="Emission Directive")
        /** @var string */
        public string $Emission_Directive='',

        // @DataMember(Name="Emission Extra Urban")
        /** @var string */
        public string $Emission_Extra_Urban='',

        // @DataMember(Name="Emission Urban")
        /** @var string */
        public string $Emission_Urban='',

        /** @var float|null */
        public ?float $emission=null,
        // @DataMember(Name="Test Standard")
        /** @var string */
        public string $Test_Standard='',

        // @DataMember(Name="Energy Efficiency Class")
        /** @var string */
        public string $Energy_Efficiency_Class='',

        // @DataMember(Name="WLTP Combined")
        /** @var string */
        public string $WLTP_Combined='',

        // @DataMember(Name="WLTP Low")
        /** @var string */
        public string $WLTP_Low='',

        // @DataMember(Name="WLTP Medium")
        /** @var string */
        public string $WLTP_Medium='',

        // @DataMember(Name="WLTP High")
        /** @var string */
        public string $WLTP_High='',

        // @DataMember(Name="WLTP Extra High")
        /** @var string */
        public string $WLTP_Extra_High='',

        // @DataMember(Name="WLTP CO2 Emissions")
        /** @var string */
        public string $WLTP_CO2_Emissions='',

        // @DataMember(Name="Production Date")
        /** @var DateTime|null */
        public ?DateTime $Production_Date=null,

        // @DataMember(Name="Port Arrival Date")
        /** @var DateTime|null */
        public ?DateTime $Port_Arrival_Date=null,

        // @DataMember(Name="Creation Date")
        /** @var DateTime */
        public DateTime $Creation_Date=new DateTime(),

        // @DataMember(Name="Maintenance Date")
        /** @var DateTime|null */
        public ?DateTime $Maintenance_Date=null,

        // @DataMember(Name="Net Price")
        /** @var float */
        public float $Net_Price=0.0,

        // @DataMember(Name="Retail Price")
        /** @var float */
        public float $Retail_Price=0.0,

        // @DataMember(Name="OTR Price")
        /** @var float */
        public float $OTR_Price=0.0,

        // @DataMember(Name="Actual Price")
        /** @var float */
        public float $Actual_Price=0.0,

        // @DataMember(Name="Usage Code")
        /** @var string */
        public string $Usage_Code='',

        /** @var string */
        public string $secured='',
        /** @var string */
        public string $account='',
        /** @var string */
        public string $isDisplayStock='',
        // @DataMember(Name="Display Agent")
        /** @var string */
        public string $Display_Agent='',

        /** @var string */
        public string $isSpecialistCar='',
        /** @var string */
        public string $cesarIdShipToParty='',
        /** @var string */
        public string $isSellable='',
        // @DataMember(Name="Under Offer")
        /** @var string */
        public string $Under_Offer='',

        // @DataMember(Name="Secured Date")
        /** @var string|null */
        public ?string $Secured_Date=null,

        // @DataMember(Name="Secured Reason")
        /** @var string|null */
        public ?string $Secured_Reason=null,

        // @DataMember(Name="Secured By Gas Id")
        /** @var string|null */
        public ?string $Secured_By_Gas_Id=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Vehicle_Type'])) $this->Vehicle_Type = $o['Vehicle_Type'];
        if (isset($o['vid'])) $this->vid = $o['vid'];
        if (isset($o['vin'])) $this->vin = $o['vin'];
        if (isset($o['fin'])) $this->fin = $o['fin'];
        if (isset($o['Comm'])) $this->Comm = $o['Comm'];
        if (isset($o['Chassis_Number'])) $this->Chassis_Number = $o['Chassis_Number'];
        if (isset($o['Model_Year'])) $this->Model_Year = $o['Model_Year'];
        if (isset($o['Model_Year_Code'])) $this->Model_Year_Code = $o['Model_Year_Code'];
        if (isset($o['Half_Model_Year_Code'])) $this->Half_Model_Year_Code = $o['Half_Model_Year_Code'];
        if (isset($o['Full_Model_Year_Code'])) $this->Full_Model_Year_Code = $o['Full_Model_Year_Code'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Vehicle_Class'])) $this->Vehicle_Class = $o['Vehicle_Class'];
        if (isset($o['Body_Style'])) $this->Body_Style = $o['Body_Style'];
        if (isset($o['model'])) $this->model = $o['model'];
        if (isset($o['colour'])) $this->colour = $o['colour'];
        if (isset($o['Colour_Group'])) $this->Colour_Group = $o['Colour_Group'];
        if (isset($o['Fuel_Type'])) $this->Fuel_Type = $o['Fuel_Type'];
        if (isset($o['transmission'])) $this->transmission = $o['transmission'];
        if (isset($o['packages'])) $this->packages = $o['packages'];
        if (isset($o['lines'])) $this->lines = $o['lines'];
        if (isset($o['Product_Range'])) $this->Product_Range = $o['Product_Range'];
        if (isset($o['engine'])) $this->engine = $o['engine'];
        if (isset($o['isAMG'])) $this->isAMG = $o['isAMG'];
        if (isset($o['upholstery'])) $this->upholstery = $o['upholstery'];
        if (isset($o['nst'])) $this->nst = $o['nst'];
        if (isset($o['baumuster'])) $this->baumuster = $o['baumuster'];
        if (isset($o['bm7NST'])) $this->bm7NST = $o['bm7NST'];
        if (isset($o['acceleration'])) $this->acceleration = $o['acceleration'];
        if (isset($o['Boot_Capacity'])) $this->Boot_Capacity = $o['Boot_Capacity'];
        if (isset($o['Top_Speed'])) $this->Top_Speed = $o['Top_Speed'];
        if (isset($o['Drive_Concept'])) $this->Drive_Concept = $o['Drive_Concept'];
        if (isset($o['Combustion_Power_HP'])) $this->Combustion_Power_HP = $o['Combustion_Power_HP'];
        if (isset($o['Electric_Power_KW'])) $this->Electric_Power_KW = $o['Electric_Power_KW'];
        if (isset($o['Electric_Power_HP'])) $this->Electric_Power_HP = $o['Electric_Power_HP'];
        if (isset($o['Combined_Power_KW'])) $this->Combined_Power_KW = $o['Combined_Power_KW'];
        if (isset($o['Combined_Power_HP'])) $this->Combined_Power_HP = $o['Combined_Power_HP'];
        if (isset($o['Electric_Range'])) $this->Electric_Range = $o['Electric_Range'];
        if (isset($o['Electric_Consumption'])) $this->Electric_Consumption = $o['Electric_Consumption'];
        if (isset($o['Emission_Combined'])) $this->Emission_Combined = $o['Emission_Combined'];
        if (isset($o['Emission_Directive'])) $this->Emission_Directive = $o['Emission_Directive'];
        if (isset($o['Emission_Extra_Urban'])) $this->Emission_Extra_Urban = $o['Emission_Extra_Urban'];
        if (isset($o['Emission_Urban'])) $this->Emission_Urban = $o['Emission_Urban'];
        if (isset($o['emission'])) $this->emission = $o['emission'];
        if (isset($o['Test_Standard'])) $this->Test_Standard = $o['Test_Standard'];
        if (isset($o['Energy_Efficiency_Class'])) $this->Energy_Efficiency_Class = $o['Energy_Efficiency_Class'];
        if (isset($o['WLTP_Combined'])) $this->WLTP_Combined = $o['WLTP_Combined'];
        if (isset($o['WLTP_Low'])) $this->WLTP_Low = $o['WLTP_Low'];
        if (isset($o['WLTP_Medium'])) $this->WLTP_Medium = $o['WLTP_Medium'];
        if (isset($o['WLTP_High'])) $this->WLTP_High = $o['WLTP_High'];
        if (isset($o['WLTP_Extra_High'])) $this->WLTP_Extra_High = $o['WLTP_Extra_High'];
        if (isset($o['WLTP_CO2_Emissions'])) $this->WLTP_CO2_Emissions = $o['WLTP_CO2_Emissions'];
        if (isset($o['Production_Date'])) $this->Production_Date = JsonConverters::from('DateTime', $o['Production_Date']);
        if (isset($o['Port_Arrival_Date'])) $this->Port_Arrival_Date = JsonConverters::from('DateTime', $o['Port_Arrival_Date']);
        if (isset($o['Creation_Date'])) $this->Creation_Date = JsonConverters::from('DateTime', $o['Creation_Date']);
        if (isset($o['Maintenance_Date'])) $this->Maintenance_Date = JsonConverters::from('DateTime', $o['Maintenance_Date']);
        if (isset($o['Net_Price'])) $this->Net_Price = $o['Net_Price'];
        if (isset($o['Retail_Price'])) $this->Retail_Price = $o['Retail_Price'];
        if (isset($o['OTR_Price'])) $this->OTR_Price = $o['OTR_Price'];
        if (isset($o['Actual_Price'])) $this->Actual_Price = $o['Actual_Price'];
        if (isset($o['Usage_Code'])) $this->Usage_Code = $o['Usage_Code'];
        if (isset($o['secured'])) $this->secured = $o['secured'];
        if (isset($o['account'])) $this->account = $o['account'];
        if (isset($o['isDisplayStock'])) $this->isDisplayStock = $o['isDisplayStock'];
        if (isset($o['Display_Agent'])) $this->Display_Agent = $o['Display_Agent'];
        if (isset($o['isSpecialistCar'])) $this->isSpecialistCar = $o['isSpecialistCar'];
        if (isset($o['cesarIdShipToParty'])) $this->cesarIdShipToParty = $o['cesarIdShipToParty'];
        if (isset($o['isSellable'])) $this->isSellable = $o['isSellable'];
        if (isset($o['Under_Offer'])) $this->Under_Offer = $o['Under_Offer'];
        if (isset($o['Secured_Date'])) $this->Secured_Date = $o['Secured_Date'];
        if (isset($o['Secured_Reason'])) $this->Secured_Reason = $o['Secured_Reason'];
        if (isset($o['Secured_By_Gas_Id'])) $this->Secured_By_Gas_Id = $o['Secured_By_Gas_Id'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Vehicle_Type)) $o['Vehicle_Type'] = $this->Vehicle_Type;
        if (isset($this->vid)) $o['vid'] = $this->vid;
        if (isset($this->vin)) $o['vin'] = $this->vin;
        if (isset($this->fin)) $o['fin'] = $this->fin;
        if (isset($this->Comm)) $o['Comm'] = $this->Comm;
        if (isset($this->Chassis_Number)) $o['Chassis_Number'] = $this->Chassis_Number;
        if (isset($this->Model_Year)) $o['Model_Year'] = $this->Model_Year;
        if (isset($this->Model_Year_Code)) $o['Model_Year_Code'] = $this->Model_Year_Code;
        if (isset($this->Half_Model_Year_Code)) $o['Half_Model_Year_Code'] = $this->Half_Model_Year_Code;
        if (isset($this->Full_Model_Year_Code)) $o['Full_Model_Year_Code'] = $this->Full_Model_Year_Code;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Vehicle_Class)) $o['Vehicle_Class'] = $this->Vehicle_Class;
        if (isset($this->Body_Style)) $o['Body_Style'] = $this->Body_Style;
        if (isset($this->model)) $o['model'] = $this->model;
        if (isset($this->colour)) $o['colour'] = $this->colour;
        if (isset($this->Colour_Group)) $o['Colour_Group'] = $this->Colour_Group;
        if (isset($this->Fuel_Type)) $o['Fuel_Type'] = $this->Fuel_Type;
        if (isset($this->transmission)) $o['transmission'] = $this->transmission;
        if (isset($this->packages)) $o['packages'] = $this->packages;
        if (isset($this->lines)) $o['lines'] = $this->lines;
        if (isset($this->Product_Range)) $o['Product_Range'] = $this->Product_Range;
        if (isset($this->engine)) $o['engine'] = $this->engine;
        if (isset($this->isAMG)) $o['isAMG'] = $this->isAMG;
        if (isset($this->upholstery)) $o['upholstery'] = $this->upholstery;
        if (isset($this->nst)) $o['nst'] = $this->nst;
        if (isset($this->baumuster)) $o['baumuster'] = $this->baumuster;
        if (isset($this->bm7NST)) $o['bm7NST'] = $this->bm7NST;
        if (isset($this->acceleration)) $o['acceleration'] = $this->acceleration;
        if (isset($this->Boot_Capacity)) $o['Boot_Capacity'] = $this->Boot_Capacity;
        if (isset($this->Top_Speed)) $o['Top_Speed'] = $this->Top_Speed;
        if (isset($this->Drive_Concept)) $o['Drive_Concept'] = $this->Drive_Concept;
        if (isset($this->Combustion_Power_HP)) $o['Combustion_Power_HP'] = $this->Combustion_Power_HP;
        if (isset($this->Electric_Power_KW)) $o['Electric_Power_KW'] = $this->Electric_Power_KW;
        if (isset($this->Electric_Power_HP)) $o['Electric_Power_HP'] = $this->Electric_Power_HP;
        if (isset($this->Combined_Power_KW)) $o['Combined_Power_KW'] = $this->Combined_Power_KW;
        if (isset($this->Combined_Power_HP)) $o['Combined_Power_HP'] = $this->Combined_Power_HP;
        if (isset($this->Electric_Range)) $o['Electric_Range'] = $this->Electric_Range;
        if (isset($this->Electric_Consumption)) $o['Electric_Consumption'] = $this->Electric_Consumption;
        if (isset($this->Emission_Combined)) $o['Emission_Combined'] = $this->Emission_Combined;
        if (isset($this->Emission_Directive)) $o['Emission_Directive'] = $this->Emission_Directive;
        if (isset($this->Emission_Extra_Urban)) $o['Emission_Extra_Urban'] = $this->Emission_Extra_Urban;
        if (isset($this->Emission_Urban)) $o['Emission_Urban'] = $this->Emission_Urban;
        if (isset($this->emission)) $o['emission'] = $this->emission;
        if (isset($this->Test_Standard)) $o['Test_Standard'] = $this->Test_Standard;
        if (isset($this->Energy_Efficiency_Class)) $o['Energy_Efficiency_Class'] = $this->Energy_Efficiency_Class;
        if (isset($this->WLTP_Combined)) $o['WLTP_Combined'] = $this->WLTP_Combined;
        if (isset($this->WLTP_Low)) $o['WLTP_Low'] = $this->WLTP_Low;
        if (isset($this->WLTP_Medium)) $o['WLTP_Medium'] = $this->WLTP_Medium;
        if (isset($this->WLTP_High)) $o['WLTP_High'] = $this->WLTP_High;
        if (isset($this->WLTP_Extra_High)) $o['WLTP_Extra_High'] = $this->WLTP_Extra_High;
        if (isset($this->WLTP_CO2_Emissions)) $o['WLTP_CO2_Emissions'] = $this->WLTP_CO2_Emissions;
        if (isset($this->Production_Date)) $o['Production_Date'] = JsonConverters::to('DateTime', $this->Production_Date);
        if (isset($this->Port_Arrival_Date)) $o['Port_Arrival_Date'] = JsonConverters::to('DateTime', $this->Port_Arrival_Date);
        if (isset($this->Creation_Date)) $o['Creation_Date'] = JsonConverters::to('DateTime', $this->Creation_Date);
        if (isset($this->Maintenance_Date)) $o['Maintenance_Date'] = JsonConverters::to('DateTime', $this->Maintenance_Date);
        if (isset($this->Net_Price)) $o['Net_Price'] = $this->Net_Price;
        if (isset($this->Retail_Price)) $o['Retail_Price'] = $this->Retail_Price;
        if (isset($this->OTR_Price)) $o['OTR_Price'] = $this->OTR_Price;
        if (isset($this->Actual_Price)) $o['Actual_Price'] = $this->Actual_Price;
        if (isset($this->Usage_Code)) $o['Usage_Code'] = $this->Usage_Code;
        if (isset($this->secured)) $o['secured'] = $this->secured;
        if (isset($this->account)) $o['account'] = $this->account;
        if (isset($this->isDisplayStock)) $o['isDisplayStock'] = $this->isDisplayStock;
        if (isset($this->Display_Agent)) $o['Display_Agent'] = $this->Display_Agent;
        if (isset($this->isSpecialistCar)) $o['isSpecialistCar'] = $this->isSpecialistCar;
        if (isset($this->cesarIdShipToParty)) $o['cesarIdShipToParty'] = $this->cesarIdShipToParty;
        if (isset($this->isSellable)) $o['isSellable'] = $this->isSellable;
        if (isset($this->Under_Offer)) $o['Under_Offer'] = $this->Under_Offer;
        if (isset($this->Secured_Date)) $o['Secured_Date'] = $this->Secured_Date;
        if (isset($this->Secured_Reason)) $o['Secured_Reason'] = $this->Secured_Reason;
        if (isset($this->Secured_By_Gas_Id)) $o['Secured_By_Gas_Id'] = $this->Secured_By_Gas_Id;
        return empty($o) ? new class(){} : $o;
    }
}

class InternalAvailableStockResponse implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $totalVehicles=0,
        /** @var array<CsvVehicle>|null */
        public ?array $vehicles=null
    ) {
    }

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

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

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

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

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

{"gssns":["String"]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"totalVehicles":0}