Mercedes.VehicleManagement.API

<back to all web services

AllAvailableVehiclesByCriteriaRequest

Vehicle
Requires Authentication
The following routes are available for this service:
POST/v1/AllAvailableVehicles/{vehicleType}/{includeBackOrderAccounts}Get all available vehicles
# frozen_string_literal: true
# encoding: utf-8


require 'json'
require 'servicestack'


class BaseAllAvailableVehiclesRequest
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :vehicle_type
    # @return [TrueClass]
    attr_accessor :include_back_order_accounts

    def self.properties
        {
            vehicle_type: { name: 'vehicleType' },
            include_back_order_accounts: { name: 'includeBackOrderAccounts' },
        }
    end

end

class BasicBackOrderVehicle
    include ServiceStack::DTO

    # @return [String]
    attr_accessor :commission_number
    # @return [String]
    attr_accessor :description
    # @return [String]
    attr_accessor :model
    # @return [String]
    attr_accessor :colour
    # @return [String]
    attr_accessor :fuel_type
    # @return [String]
    attr_accessor :transmission
    # @return [String]
    attr_accessor :packages
    # @return [String]
    attr_accessor :lines
    # @return [String]
    attr_accessor :upholstery
    # @return [String]
    attr_accessor :emission_combined
    # @return [BigDecimal]
    attr_accessor :actual_price
    # @return [String]
    attr_accessor :usage_code
    # @return [TrueClass]
    attr_accessor :secured
    # @return [String]
    attr_accessor :account
    # @return [String]
    attr_accessor :secured_time
    # @return [String]
    attr_accessor :secured_reason
    # @return [String]
    attr_accessor :secured_by_gas_id
    # @return [DateTime]
    attr_accessor :secured_date
    # @return [DateTime]
    attr_accessor :confirmed_production_date
    # @return [DateTime]
    attr_accessor :forecasted_arrival_date

    def self.properties
        {
            commission_number: { name: 'commissionNumber' },
            description: { name: 'description' },
            model: { name: 'model' },
            colour: { name: 'colour' },
            fuel_type: { name: 'fuelType' },
            transmission: { name: 'transmission' },
            packages: { name: 'packages' },
            lines: { name: 'lines' },
            upholstery: { name: 'upholstery' },
            emission_combined: { name: 'emissionCombined' },
            actual_price: { name: 'actualPrice' },
            usage_code: { name: 'usageCode' },
            secured: { name: 'secured' },
            account: { name: 'account' },
            secured_time: { name: 'securedTime' },
            secured_reason: { name: 'securedReason' },
            secured_by_gas_id: { name: 'securedByGasId' },
            secured_date: { name: 'securedDate', type: DateTime },
            confirmed_production_date: { name: 'confirmedProductionDate', type: DateTime },
            forecasted_arrival_date: { name: 'forecastedArrivalDate', type: DateTime },
        }
    end

end

class BackOrderVehicle < BasicBackOrderVehicle
    # @return [Integer]
    attr_accessor :id
    # @return [String]
    attr_accessor :vin
    # @return [String]
    attr_accessor :vehicle_type
    # @return [String]
    attr_accessor :vid
    # @return [String]
    attr_accessor :fin
    # @return [String]
    attr_accessor :chassis_number
    # @return [String]
    attr_accessor :model_year
    # @return [String]
    attr_accessor :model_year_code
    # @return [String]
    attr_accessor :half_model_year_code
    # @return [String]
    attr_accessor :full_model_year_code
    # @return [String]
    attr_accessor :sales_description_long
    # @return [String]
    attr_accessor :vehicle_class
    # @return [BigDecimal]
    attr_accessor :retail_price__ex_v_a_t
    # @return [BigDecimal]
    attr_accessor :retail_price__inc_v_a_t
    # @return [BigDecimal]
    attr_accessor :otr
    # @return [String]
    attr_accessor :body_style
    # @return [String]
    attr_accessor :product_range
    # @return [String]
    attr_accessor :engine
    # @return [TrueClass]
    attr_accessor :is_a_m_g
    # @return [String]
    attr_accessor :colour_group
    # @return [String]
    attr_accessor :upholstery_code
    # @return [String]
    attr_accessor :nst
    # @return [String]
    attr_accessor :bm7_n_s_t
    # @return [BigDecimal]
    attr_accessor :acceleration
    # @return [Integer]
    attr_accessor :boot_capacity
    # @return [BigDecimal]
    attr_accessor :top_speed
    # @return [String]
    attr_accessor :drive_concept
    # @return [BigDecimal]
    attr_accessor :combustion_power_hp
    # @return [BigDecimal]
    attr_accessor :electric_power_kw
    # @return [BigDecimal]
    attr_accessor :electric_power_hp
    # @return [BigDecimal]
    attr_accessor :combined_power_kw
    # @return [BigDecimal]
    attr_accessor :combined_power_h_p
    # @return [BigDecimal]
    attr_accessor :electric_range
    # @return [BigDecimal]
    attr_accessor :electric_consumption
    # @return [BigDecimal]
    attr_accessor :emission
    # @return [String]
    attr_accessor :emission_directive
    # @return [String]
    attr_accessor :emission_extra_urban
    # @return [String]
    attr_accessor :emission_urban
    # @return [String]
    attr_accessor :energy_efficiency_class
    # @return [String]
    attr_accessor :wltp_emission_combined
    # @return [String]
    attr_accessor :wltp_combined
    # @return [String]
    attr_accessor :wltp_low
    # @return [String]
    attr_accessor :wltp_medium
    # @return [String]
    attr_accessor :wltp_high
    # @return [String]
    attr_accessor :wltp_extra_high
    # @return [DateTime]
    attr_accessor :port_arrival_date
    # @return [DateTime]
    attr_accessor :creation_date
    # @return [DateTime]
    attr_accessor :last_updated
    # @return [TrueClass]
    attr_accessor :is_display_stock
    # @return [String]
    attr_accessor :display_stock_agent
    # @return [TrueClass]
    attr_accessor :is_specialist_car
    # @return [String]
    attr_accessor :location
    # @return [String]
    attr_accessor :cesar_id_ship_to_party
    # @return [TrueClass]
    attr_accessor :is_sellable
    # @return [TrueClass]
    attr_accessor :under_offer
    # @return [String]
    attr_accessor :baumuster

    def self.properties
        {
            id: { name: 'id' },
            vin: { name: 'vin' },
            vehicle_type: { name: 'vehicleType' },
            vid: { name: 'vid' },
            fin: { name: 'fin' },
            chassis_number: { name: 'chassisNumber' },
            model_year: { name: 'modelYear' },
            model_year_code: { name: 'modelYearCode' },
            half_model_year_code: { name: 'halfModelYearCode' },
            full_model_year_code: { name: 'fullModelYearCode' },
            sales_description_long: { name: 'salesDescriptionLong' },
            vehicle_class: { name: 'vehicleClass' },
            retail_price__ex_v_a_t: { name: 'retailPrice_ExVAT' },
            retail_price__inc_v_a_t: { name: 'retailPrice_IncVAT' },
            otr: { name: 'otr' },
            body_style: { name: 'bodyStyle' },
            product_range: { name: 'productRange' },
            engine: { name: 'engine' },
            is_a_m_g: { name: 'isAMG' },
            colour_group: { name: 'colourGroup' },
            upholstery_code: { name: 'upholsteryCode' },
            nst: { name: 'nst' },
            bm7_n_s_t: { name: 'bm7NST' },
            acceleration: { name: 'acceleration' },
            boot_capacity: { name: 'bootCapacity' },
            top_speed: { name: 'topSpeed' },
            drive_concept: { name: 'driveConcept' },
            combustion_power_hp: { name: 'combustionPowerHp' },
            electric_power_kw: { name: 'electricPowerKw' },
            electric_power_hp: { name: 'electricPowerHp' },
            combined_power_kw: { name: 'combinedPowerKw' },
            combined_power_h_p: { name: 'combinedPowerHP' },
            electric_range: { name: 'electricRange' },
            electric_consumption: { name: 'electricConsumption' },
            emission: { name: 'emission' },
            emission_directive: { name: 'emissionDirective' },
            emission_extra_urban: { name: 'emissionExtraUrban' },
            emission_urban: { name: 'emissionUrban' },
            energy_efficiency_class: { name: 'energyEfficiencyClass' },
            wltp_emission_combined: { name: 'wltpEmissionCombined' },
            wltp_combined: { name: 'wltpCombined' },
            wltp_low: { name: 'wltpLow' },
            wltp_medium: { name: 'wltpMedium' },
            wltp_high: { name: 'wltpHigh' },
            wltp_extra_high: { name: 'wltpExtraHigh' },
            port_arrival_date: { name: 'portArrivalDate', type: DateTime },
            creation_date: { name: 'creationDate', type: DateTime },
            last_updated: { name: 'lastUpdated', type: DateTime },
            is_display_stock: { name: 'isDisplayStock' },
            display_stock_agent: { name: 'displayStockAgent' },
            is_specialist_car: { name: 'isSpecialistCar' },
            location: { name: 'location' },
            cesar_id_ship_to_party: { name: 'cesarIdShipToParty' },
            is_sellable: { name: 'isSellable' },
            under_offer: { name: 'underOffer' },
            baumuster: { name: 'baumuster' },
        }
    end

end

class StockManagementResponse
    include ServiceStack::DTO

    # @return [Integer]
    attr_accessor :total_vehicles
    # @return [IEnumerable]
    attr_accessor :vehicles

    def self.properties
        {
            total_vehicles: { name: 'totalVehicles' },
            vehicles: { name: 'vehicles', type: [BackOrderVehicle] },
        }
    end

end

class CampaignExclusion
    include ServiceStack::DTO

    # @return [Array]
    attr_accessor :vin
    # @return [Array]
    attr_accessor :commission_number
    # @return [String]
    attr_accessor :model_year_code
    # @return [String]
    attr_accessor :equipment_code
    # @return [Array]
    attr_accessor :gssn

    def self.properties
        {
            vin: { name: 'vin' },
            commission_number: { name: 'commissionNumber' },
            model_year_code: { name: 'modelYearCode' },
            equipment_code: { name: 'equipmentCode' },
            gssn: { name: 'gssn' },
        }
    end

end

class RegistrationDate
    include ServiceStack::DTO

    # @return [DateTime]
    attr_accessor :from
    # @return [DateTime]
    attr_accessor :to

    def self.properties
        {
            from: { name: 'from', type: DateTime },
            to: { name: 'to', type: DateTime },
        }
    end

end

class Age
    include ServiceStack::DTO

    # @return [DateTime]
    attr_accessor :date
    # @return [Integer]
    attr_accessor :min
    # @return [Integer]
    attr_accessor :max
    # @return [TrueClass]
    attr_accessor :include_pipeline_stock

    def self.properties
        {
            date: { name: 'date', type: DateTime },
            min: { name: 'min' },
            max: { name: 'max' },
            include_pipeline_stock: { name: 'includePipelineStock' },
        }
    end

end

class PortArrivalDate
    include ServiceStack::DTO

    # @return [TrueClass]
    attr_accessor :pipeline_stock
    # @return [DateTime]
    attr_accessor :from
    # @return [DateTime]
    attr_accessor :to

    def self.properties
        {
            pipeline_stock: { name: 'pipelineStock' },
            from: { name: 'from', type: DateTime },
            to: { name: 'to', type: DateTime },
        }
    end

end

class VehicleSearchV3Criteria
    include ServiceStack::DTO

    # @return [Array]
    attr_accessor :vin
    # @return [Array]
    attr_accessor :model
    # @return [Array]
    attr_accessor :fuel
    # @return [Array]
    attr_accessor :transmission
    # @return [Array]
    attr_accessor :engine
    # @return [Array]
    attr_accessor :line
    # @return [Array]
    attr_accessor :mapped_line
    # @return [Array]
    attr_accessor :commission_number
    # @return [String]
    attr_accessor :vehicle_type
    # @return [CampaignExclusion]
    attr_accessor :exclusion
    # @return [String]
    attr_accessor :reg_no
    # @return [TrueClass]
    attr_accessor :include_offline
    # @return [RegistrationDate]
    attr_accessor :registration_date
    # @return [Age]
    attr_accessor :age
    # @return [PortArrivalDate]
    attr_accessor :port_arrival_date
    # @return [TrueClass]
    attr_accessor :is_available_online
    # @return [TrueClass]
    attr_accessor :is_back_ordered
    # @return [TrueClass]
    attr_accessor :is_sellable
    # @return [TrueClass]
    attr_accessor :is_under_offer
    # @return [TrueClass]
    attr_accessor :mbuk_secured
    # @return [Array]
    attr_accessor :account
    # @return [Array]
    attr_accessor :baumuster
    # @return [Array]
    attr_accessor :colours
    # @return [Array]
    attr_accessor :upholstery
    # @return [Array]
    attr_accessor :package
    # @return [Array]
    attr_accessor :nst
    # @return [Array]
    attr_accessor :usage_code

    def self.properties
        {
            vin: { name: 'vin' },
            model: { name: 'model' },
            fuel: { name: 'fuel' },
            transmission: { name: 'transmission' },
            engine: { name: 'engine' },
            line: { name: 'line' },
            mapped_line: { name: 'mappedLine' },
            commission_number: { name: 'commissionNumber' },
            vehicle_type: { name: 'vehicleType' },
            exclusion: { name: 'exclusion', type: CampaignExclusion },
            reg_no: { name: 'regNo' },
            include_offline: { name: 'includeOffline' },
            registration_date: { name: 'registrationDate', type: RegistrationDate },
            age: { name: 'age', type: Age },
            port_arrival_date: { name: 'portArrivalDate', type: PortArrivalDate },
            is_available_online: { name: 'isAvailableOnline' },
            is_back_ordered: { name: 'isBackOrdered' },
            is_sellable: { name: 'isSellable' },
            is_under_offer: { name: 'isUnderOffer' },
            mbuk_secured: { name: 'mbukSecured' },
            account: { name: 'account' },
            baumuster: { name: 'baumuster' },
            colours: { name: 'colours' },
            upholstery: { name: 'upholstery' },
            package: { name: 'package' },
            nst: { name: 'nst' },
            usage_code: { name: 'usageCode' },
        }
    end

end

class AllAvailableVehiclesByCriteriaRequest < BaseAllAvailableVehiclesRequest
    # @return [VehicleSearchV3Criteria]
    attr_accessor :criteria

    def self.properties
        {
            criteria: { name: 'criteria', type: VehicleSearchV3Criteria },
        }
    end

    def response_type() = StockManagementResponse
    def get_type_name() = 'AllAvailableVehiclesByCriteriaRequest'
end

Ruby AllAvailableVehiclesByCriteriaRequest 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/AllAvailableVehicles/{vehicleType}/{includeBackOrderAccounts} HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<AllAvailableVehiclesByCriteriaRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO.V3">
  <IncludeBackOrderAccounts>false</IncludeBackOrderAccounts>
  <VehicleType>String</VehicleType>
  <Criteria>
    <Account xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Account>
    <Age>
      <Date>0001-01-01T00:00:00</Date>
      <IncludePipelineStock>false</IncludePipelineStock>
      <Max>0</Max>
      <Min>0</Min>
    </Age>
    <Baumuster xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Baumuster>
    <Colours xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </Colours>
    <CommissionNumber xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </CommissionNumber>
    <Engine xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </Engine>
    <Exclusion>
      <CommissionNumber xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </CommissionNumber>
      <EquipmentCode>String</EquipmentCode>
      <Gssn xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Gssn>
      <ModelYearCode>String</ModelYearCode>
      <Vin xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Vin>
    </Exclusion>
    <Fuel xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </Fuel>
    <IncludeOffline>false</IncludeOffline>
    <IsAvailableOnline>false</IsAvailableOnline>
    <IsBackOrdered>false</IsBackOrdered>
    <IsSellable>false</IsSellable>
    <IsUnderOffer>false</IsUnderOffer>
    <Line xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Line>
    <MBUKSecured>false</MBUKSecured>
    <MappedLine xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </MappedLine>
    <Model xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </Model>
    <NST xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </NST>
    <Package xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </Package>
    <PortArrivalDate>
      <From>0001-01-01T00:00:00</From>
      <PipelineStock>false</PipelineStock>
      <To>0001-01-01T00:00:00</To>
    </PortArrivalDate>
    <RegNo>String</RegNo>
    <RegistrationDate>
      <From>0001-01-01T00:00:00</From>
      <To>0001-01-01T00:00:00</To>
    </RegistrationDate>
    <Transmission xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </Transmission>
    <Upholstery xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:int>0</d3p1:int>
    </Upholstery>
    <UsageCode xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </UsageCode>
    <VehicleType>String</VehicleType>
    <Vin xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Vin>
  </Criteria>
</AllAvailableVehiclesByCriteriaRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

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