POST | /vehicleownership/ |
---|
import 'package:servicestack/servicestack.dart';
class ReturnStatus implements IConvertible
{
String? ReturnCode;
String? Message;
ReturnStatus({this.ReturnCode,this.Message});
ReturnStatus.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ReturnCode = json['ReturnCode'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => {
'ReturnCode': ReturnCode,
'Message': Message
};
getTypeName() => "ReturnStatus";
TypeContext? context = _ctx;
}
class Vehicle implements IConvertible
{
String? ChassisNumber;
String? RegistrationNumber;
String? CommissionNumber;
String? Make;
String? Model;
DateTime? NextMOTDate;
DateTime? NextServiceDate;
Vehicle({this.ChassisNumber,this.RegistrationNumber,this.CommissionNumber,this.Make,this.Model,this.NextMOTDate,this.NextServiceDate});
Vehicle.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ChassisNumber = json['ChassisNumber'];
RegistrationNumber = json['RegistrationNumber'];
CommissionNumber = json['CommissionNumber'];
Make = json['Make'];
Model = json['Model'];
NextMOTDate = JsonConverters.fromJson(json['NextMOTDate'],'DateTime',context!);
NextServiceDate = JsonConverters.fromJson(json['NextServiceDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ChassisNumber': ChassisNumber,
'RegistrationNumber': RegistrationNumber,
'CommissionNumber': CommissionNumber,
'Make': Make,
'Model': Model,
'NextMOTDate': JsonConverters.toJson(NextMOTDate,'DateTime',context!),
'NextServiceDate': JsonConverters.toJson(NextServiceDate,'DateTime',context!)
};
getTypeName() => "Vehicle";
TypeContext? context = _ctx;
}
class VehicleOwnershipResponse implements IConvertible
{
ReturnStatus? Status;
int? NumberOfPages;
int? TotalNumberOfVehicles;
List<Vehicle>? Vehicles;
VehicleOwnershipResponse({this.Status,this.NumberOfPages,this.TotalNumberOfVehicles,this.Vehicles});
VehicleOwnershipResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Status = JsonConverters.fromJson(json['Status'],'ReturnStatus',context!);
NumberOfPages = json['NumberOfPages'];
TotalNumberOfVehicles = json['TotalNumberOfVehicles'];
Vehicles = JsonConverters.fromJson(json['Vehicles'],'List<Vehicle>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Status': JsonConverters.toJson(Status,'ReturnStatus',context!),
'NumberOfPages': NumberOfPages,
'TotalNumberOfVehicles': TotalNumberOfVehicles,
'Vehicles': JsonConverters.toJson(Vehicles,'List<Vehicle>',context!)
};
getTypeName() => "VehicleOwnershipResponse";
TypeContext? context = _ctx;
}
class VehicleOwnership implements IConvertible
{
String? CiamId;
int? ItemsPerPage;
int? PageNumber;
String? SearchString;
String? SortColumn;
String? SortDirection;
VehicleOwnership({this.CiamId,this.ItemsPerPage,this.PageNumber,this.SearchString,this.SortColumn,this.SortDirection});
VehicleOwnership.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CiamId = json['CiamId'];
ItemsPerPage = json['ItemsPerPage'];
PageNumber = json['PageNumber'];
SearchString = json['SearchString'];
SortColumn = json['SortColumn'];
SortDirection = json['SortDirection'];
return this;
}
Map<String, dynamic> toJson() => {
'CiamId': CiamId,
'ItemsPerPage': ItemsPerPage,
'PageNumber': PageNumber,
'SearchString': SearchString,
'SortColumn': SortColumn,
'SortDirection': SortDirection
};
getTypeName() => "VehicleOwnership";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'webservices.mbukdatabase.co.uk', types: <String, TypeInfo> {
'ReturnStatus': TypeInfo(TypeOf.Class, create:() => ReturnStatus()),
'Vehicle': TypeInfo(TypeOf.Class, create:() => Vehicle()),
'VehicleOwnershipResponse': TypeInfo(TypeOf.Class, create:() => VehicleOwnershipResponse()),
'List<Vehicle>': TypeInfo(TypeOf.Class, create:() => <Vehicle>[]),
'VehicleOwnership': TypeInfo(TypeOf.Class, create:() => VehicleOwnership()),
});
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.
POST /vehicleownership/ HTTP/1.1
Host: webservices.mbukdatabase.co.uk
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<VehicleOwnership xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RAPP.Mercedes.VanCustomerAccount.Api.ServiceModel.SitecoreServiceModels">
<CiamId>String</CiamId>
<ItemsPerPage>0</ItemsPerPage>
<PageNumber>0</PageNumber>
<SearchString>String</SearchString>
<SortColumn>String</SortColumn>
<SortDirection>String</SortDirection>
</VehicleOwnership>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <VehicleOwnershipResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/RAPP.Mercedes.VanCustomerAccount.Api.ServiceModel.SitecoreServiceModels"> <NumberOfPages>0</NumberOfPages> <Status> <Message>String</Message> <ReturnCode>String</ReturnCode> </Status> <TotalNumberOfVehicles>0</TotalNumberOfVehicles> <Vehicles> <Vehicle> <ChassisNumber>String</ChassisNumber> <CommissionNumber>String</CommissionNumber> <Make>String</Make> <Model>String</Model> <NextMOTDate>0001-01-01T00:00:00</NextMOTDate> <NextServiceDate>0001-01-01T00:00:00</NextServiceDate> <RegistrationNumber>String</RegistrationNumber> </Vehicle> </Vehicles> </VehicleOwnershipResponse>