POST | /insuranceproducts/ |
---|
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 InsuranceProduct implements IConvertible
{
String? CertificateNumber;
String? ProductType;
DateTime? StartDate;
DateTime? EndDate;
String? Cancelled;
InsuranceProduct({this.CertificateNumber,this.ProductType,this.StartDate,this.EndDate,this.Cancelled});
InsuranceProduct.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CertificateNumber = json['CertificateNumber'];
ProductType = json['ProductType'];
StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
EndDate = JsonConverters.fromJson(json['EndDate'],'DateTime',context!);
Cancelled = json['Cancelled'];
return this;
}
Map<String, dynamic> toJson() => {
'CertificateNumber': CertificateNumber,
'ProductType': ProductType,
'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
'EndDate': JsonConverters.toJson(EndDate,'DateTime',context!),
'Cancelled': Cancelled
};
getTypeName() => "InsuranceProduct";
TypeContext? context = _ctx;
}
class InsuranceProductsResponse implements IConvertible
{
ReturnStatus? Status;
int? NumberOfPages;
List<InsuranceProduct>? InsuranceProducts;
InsuranceProductsResponse({this.Status,this.NumberOfPages,this.InsuranceProducts});
InsuranceProductsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Status = JsonConverters.fromJson(json['Status'],'ReturnStatus',context!);
NumberOfPages = json['NumberOfPages'];
InsuranceProducts = JsonConverters.fromJson(json['InsuranceProducts'],'List<InsuranceProduct>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Status': JsonConverters.toJson(Status,'ReturnStatus',context!),
'NumberOfPages': NumberOfPages,
'InsuranceProducts': JsonConverters.toJson(InsuranceProducts,'List<InsuranceProduct>',context!)
};
getTypeName() => "InsuranceProductsResponse";
TypeContext? context = _ctx;
}
class InsuranceProducts implements IConvertible
{
String? CIAMId;
String? ChassisNumber;
int? ItemsPerPage;
int? PageNumber;
InsuranceProducts({this.CIAMId,this.ChassisNumber,this.ItemsPerPage,this.PageNumber});
InsuranceProducts.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() => "InsuranceProducts";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'webservices.mbukdatabase.co.uk', types: <String, TypeInfo> {
'ReturnStatus': TypeInfo(TypeOf.Class, create:() => ReturnStatus()),
'InsuranceProduct': TypeInfo(TypeOf.Class, create:() => InsuranceProduct()),
'InsuranceProductsResponse': TypeInfo(TypeOf.Class, create:() => InsuranceProductsResponse()),
'List<InsuranceProduct>': TypeInfo(TypeOf.Class, create:() => <InsuranceProduct>[]),
'InsuranceProducts': TypeInfo(TypeOf.Class, create:() => InsuranceProducts()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /insuranceproducts/ HTTP/1.1
Host: webservices.mbukdatabase.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CIAMId: String,
ChassisNumber: String,
ItemsPerPage: 0,
PageNumber: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Status: { ReturnCode: String, Message: String }, NumberOfPages: 0, InsuranceProducts: [ { CertificateNumber: String, ProductType: String, StartDate: 0001-01-01, EndDate: 0001-01-01, Cancelled: String } ] }