GET | /v1/vehicle/MotabilityVehicles | Get motability eligible vehicles |
---|
import 'package:servicestack/servicestack.dart';
class GetMotabilityVehiclesRequest implements IConvertible
{
GetMotabilityVehiclesRequest();
GetMotabilityVehiclesRequest.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetMotabilityVehiclesRequest";
TypeContext? context = _ctx;
}
class Package implements IConvertible
{
int? Id;
String? Description;
Package({this.Id,this.Description});
Package.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Description = json['Description'];
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Description': Description
};
getTypeName() => "Package";
TypeContext? context = _ctx;
}
class MotabilityVehicle implements IPackages, IMotabilityFilterFields, IConvertible
{
String? CommissionNumber;
String? Vin;
String? Vtn;
String? Description;
String? Model;
String? BM7NST;
String? ModelYearCode;
String? HalfModelYearCode;
String? FullModelYearCode;
String? Fuel;
String? PrimaryPaintColourCode;
String? Colour;
String? PrimaryUpholsteryCode;
String? Upholstery;
List<Package>? Packages;
String? Account;
String? Location;
bool? IsDisplayStock;
String? DisplayStockAgent;
bool? IsSellable;
MotabilityVehicle({this.CommissionNumber,this.Vin,this.Vtn,this.Description,this.Model,this.BM7NST,this.ModelYearCode,this.HalfModelYearCode,this.FullModelYearCode,this.Fuel,this.PrimaryPaintColourCode,this.Colour,this.PrimaryUpholsteryCode,this.Upholstery,this.Packages,this.Account,this.Location,this.IsDisplayStock,this.DisplayStockAgent,this.IsSellable});
MotabilityVehicle.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CommissionNumber = json['CommissionNumber'];
Vin = json['Vin'];
Vtn = json['Vtn'];
Description = json['Description'];
Model = json['Model'];
BM7NST = json['BM7NST'];
ModelYearCode = json['ModelYearCode'];
HalfModelYearCode = json['HalfModelYearCode'];
FullModelYearCode = json['FullModelYearCode'];
Fuel = json['Fuel'];
PrimaryPaintColourCode = json['PrimaryPaintColourCode'];
Colour = json['Colour'];
PrimaryUpholsteryCode = json['PrimaryUpholsteryCode'];
Upholstery = json['Upholstery'];
Packages = JsonConverters.fromJson(json['Packages'],'List<Package>',context!);
Account = json['Account'];
Location = json['Location'];
IsDisplayStock = json['IsDisplayStock'];
DisplayStockAgent = json['DisplayStockAgent'];
IsSellable = json['IsSellable'];
return this;
}
Map<String, dynamic> toJson() => {
'CommissionNumber': CommissionNumber,
'Vin': Vin,
'Vtn': Vtn,
'Description': Description,
'Model': Model,
'BM7NST': BM7NST,
'ModelYearCode': ModelYearCode,
'HalfModelYearCode': HalfModelYearCode,
'FullModelYearCode': FullModelYearCode,
'Fuel': Fuel,
'PrimaryPaintColourCode': PrimaryPaintColourCode,
'Colour': Colour,
'PrimaryUpholsteryCode': PrimaryUpholsteryCode,
'Upholstery': Upholstery,
'Packages': JsonConverters.toJson(Packages,'List<Package>',context!),
'Account': Account,
'Location': Location,
'IsDisplayStock': IsDisplayStock,
'DisplayStockAgent': DisplayStockAgent,
'IsSellable': IsSellable
};
getTypeName() => "MotabilityVehicle";
TypeContext? context = _ctx;
}
class MotabilityStockResponse<T> implements IConvertible
{
int? TotalVehicles;
List<MotabilityVehicle>? Vehicles = [];
MotabilityStockResponse({this.TotalVehicles,this.Vehicles});
MotabilityStockResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
TotalVehicles = json['TotalVehicles'];
Vehicles = JsonConverters.fromJson(json['Vehicles'],'List<MotabilityVehicle>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'TotalVehicles': TotalVehicles,
'Vehicles': JsonConverters.toJson(Vehicles,'List<MotabilityVehicle>',context!)
};
getTypeName() => "MotabilityStockResponse<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'prod_api_agency_orch_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
'GetMotabilityVehiclesRequest': TypeInfo(TypeOf.Class, create:() => GetMotabilityVehiclesRequest()),
'Package': TypeInfo(TypeOf.Class, create:() => Package()),
'MotabilityVehicle': TypeInfo(TypeOf.Class, create:() => MotabilityVehicle()),
'List<Package>': TypeInfo(TypeOf.Class, create:() => <Package>[]),
'MotabilityStockResponse<T>': TypeInfo(TypeOf.Class, create:() => MotabilityStockResponse<T>()),
'List<MotabilityVehicle>': TypeInfo(TypeOf.Class, create:() => <MotabilityVehicle>[]),
});
Dart GetMotabilityVehiclesRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/vehicle/MotabilityVehicles HTTP/1.1 Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <MotabilityStockResponseOfMotabilityVehicleQN4VPG_PB xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.Agency.API.Shared.POCO"> <TotalVehicles>0</TotalVehicles> <Vehicles xmlns:d2p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO"> <d2p1:MotabilityVehicle> <d2p1:Account>String</d2p1:Account> <d2p1:BM7NST>String</d2p1:BM7NST> <d2p1:Colour>String</d2p1:Colour> <d2p1:CommissionNumber>String</d2p1:CommissionNumber> <d2p1:Description>String</d2p1:Description> <d2p1:DisplayStockAgent>String</d2p1:DisplayStockAgent> <d2p1:Fuel>String</d2p1:Fuel> <d2p1:HalfModelYearCode>String</d2p1:HalfModelYearCode> <d2p1:IsDisplayStock>false</d2p1:IsDisplayStock> <d2p1:IsSellable>false</d2p1:IsSellable> <d2p1:Location>String</d2p1:Location> <d2p1:Model>String</d2p1:Model> <d2p1:ModelYearCode>String</d2p1:ModelYearCode> <d2p1:Packages xmlns:d4p1="http://schemas.datacontract.org/2004/07/Mercedes.OS.Vehicle.Shared.POCO.Filters.v3" i:nil="true" /> <d2p1:PrimaryPaintColourCode>String</d2p1:PrimaryPaintColourCode> <d2p1:PrimaryUpholsteryCode>String</d2p1:PrimaryUpholsteryCode> <d2p1:Upholstery>String</d2p1:Upholstery> <d2p1:Vin>String</d2p1:Vin> <d2p1:Vtn>String</d2p1:Vtn> </d2p1:MotabilityVehicle> </Vehicles> </MotabilityStockResponseOfMotabilityVehicleQN4VPG_PB>