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 .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
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/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"TotalVehicles":0,"Vehicles":[{"CommissionNumber":"String","Vin":"String","Vtn":"String","Description":"String","Model":"String","BM7NST":"String","ModelYearCode":"String","HalfModelYearCode":"String","FullModelYearCode":"String.String","Fuel":"String","PrimaryPaintColourCode":"String","Colour":"String","PrimaryUpholsteryCode":"String","Upholstery":"String","Account":"String","Location":"String","IsDisplayStock":false,"DisplayStockAgent":"String","IsSellable":false}]}