POST | /vehiclevisits/ |
---|
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 Visit implements IConvertible
{
String? VisitType;
DateTime? VisitDate;
double? Mileage;
String? RegistrationNumber;
String? DealerName;
String? ContractNumber;
Visit({this.VisitType,this.VisitDate,this.Mileage,this.RegistrationNumber,this.DealerName,this.ContractNumber});
Visit.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
VisitType = json['VisitType'];
VisitDate = JsonConverters.fromJson(json['VisitDate'],'DateTime',context!);
Mileage = JsonConverters.toDouble(json['Mileage']);
RegistrationNumber = json['RegistrationNumber'];
DealerName = json['DealerName'];
ContractNumber = json['ContractNumber'];
return this;
}
Map<String, dynamic> toJson() => {
'VisitType': VisitType,
'VisitDate': JsonConverters.toJson(VisitDate,'DateTime',context!),
'Mileage': Mileage,
'RegistrationNumber': RegistrationNumber,
'DealerName': DealerName,
'ContractNumber': ContractNumber
};
getTypeName() => "Visit";
TypeContext? context = _ctx;
}
class VehicleVisitsResponse implements IConvertible
{
ReturnStatus? Status;
int? NumberOfPages;
List<Visit>? Visits;
VehicleVisitsResponse({this.Status,this.NumberOfPages,this.Visits});
VehicleVisitsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Status = JsonConverters.fromJson(json['Status'],'ReturnStatus',context!);
NumberOfPages = json['NumberOfPages'];
Visits = JsonConverters.fromJson(json['Visits'],'List<Visit>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Status': JsonConverters.toJson(Status,'ReturnStatus',context!),
'NumberOfPages': NumberOfPages,
'Visits': JsonConverters.toJson(Visits,'List<Visit>',context!)
};
getTypeName() => "VehicleVisitsResponse";
TypeContext? context = _ctx;
}
class VehicleVisits implements IConvertible
{
String? CIAMId;
String? ChassisNumber;
int? ItemsPerPage;
int? PageNumber;
VehicleVisits({this.CIAMId,this.ChassisNumber,this.ItemsPerPage,this.PageNumber});
VehicleVisits.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CIAMId = json['CIAMId'];
ChassisNumber = json['ChassisNumber'];
ItemsPerPage = json['ItemsPerPage'];
PageNumber = json['PageNumber'];
return this;
}
Map<String, dynamic> toJson() => {
'CIAMId': CIAMId,
'ChassisNumber': ChassisNumber,
'ItemsPerPage': ItemsPerPage,
'PageNumber': PageNumber
};
getTypeName() => "VehicleVisits";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'webservices.mbukdatabase.co.uk', types: <String, TypeInfo> {
'ReturnStatus': TypeInfo(TypeOf.Class, create:() => ReturnStatus()),
'Visit': TypeInfo(TypeOf.Class, create:() => Visit()),
'VehicleVisitsResponse': TypeInfo(TypeOf.Class, create:() => VehicleVisitsResponse()),
'List<Visit>': TypeInfo(TypeOf.Class, create:() => <Visit>[]),
'VehicleVisits': TypeInfo(TypeOf.Class, create:() => VehicleVisits()),
});
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 /vehiclevisits/ HTTP/1.1
Host: webservices.mbukdatabase.co.uk
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<VehicleVisits 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>
<ChassisNumber>String</ChassisNumber>
<ItemsPerPage>0</ItemsPerPage>
<PageNumber>0</PageNumber>
</VehicleVisits>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <VehicleVisitsResponse 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> <Visits> <Visit> <ContractNumber>String</ContractNumber> <DealerName>String</DealerName> <Mileage>0</Mileage> <RegistrationNumber>String</RegistrationNumber> <VisitDate>0001-01-01T00:00:00</VisitDate> <VisitType>String</VisitType> </Visit> </Visits> </VehicleVisitsResponse>