| POST | /api/customerMaster/search/owner | Search customer master based on search parameters |
|---|
import 'package:servicestack/servicestack.dart';
enum ORDER
{
ASC,
DESC,
}
class SearchCustomerMasterQuery implements ISearchCustomerMaster, IConvertible
{
String continuationToken = "";
String? payByEntityIdentification;
int requestedPage = 0;
int numberOfRecordsPerPage = 0;
String orderBy = "";
ORDER order;
SearchCustomerMasterQuery({this.continuationToken,this.payByEntityIdentification,this.requestedPage,this.numberOfRecordsPerPage,this.orderBy,this.order});
SearchCustomerMasterQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
continuationToken = json['continuationToken'];
payByEntityIdentification = json['payByEntityIdentification'];
requestedPage = json['requestedPage'];
numberOfRecordsPerPage = json['numberOfRecordsPerPage'];
orderBy = json['orderBy'];
order = JsonConverters.fromJson(json['order'],'ORDER',context!);
return this;
}
Map<String, dynamic> toJson() => {
'continuationToken': continuationToken,
'payByEntityIdentification': payByEntityIdentification,
'requestedPage': requestedPage,
'numberOfRecordsPerPage': numberOfRecordsPerPage,
'orderBy': orderBy,
'order': JsonConverters.toJson(order,'ORDER',context!)
};
getTypeName() => "SearchCustomerMasterQuery";
TypeContext? context = _ctx;
}
/**
* Customer Master
*/
// @Api(Description="Customer Master")
// @ApiResponse(Description="Paged Customer Master data", IsDefaultResponse=true, ResponseType=typeof(0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)
class SearchCustomerMaster implements IConvertible
{
/**
* Search query
*/
// @ApiMember(Description="Search query", ParameterType="model")
SearchCustomerMasterQuery query;
SearchCustomerMaster({this.query});
SearchCustomerMaster.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
query = JsonConverters.fromJson(json['query'],'SearchCustomerMasterQuery',context!);
return this;
}
Map<String, dynamic> toJson() => {
'query': JsonConverters.toJson(query,'SearchCustomerMasterQuery',context!)
};
getTypeName() => "SearchCustomerMaster";
TypeContext? context = _ctx;
}
class PagedQueryResult<T> implements IConvertible
{
int startIndex = 0;
int endIndex = 0;
int numberOfRecordsReturned = 0;
int totalNumberOfPages = 0;
int totalNumberOfRecords = 0;
List<ResultItem<ClaimMessage>> results = [];
PagedQueryResult({this.startIndex,this.endIndex,this.numberOfRecordsReturned,this.totalNumberOfPages,this.totalNumberOfRecords,this.results});
PagedQueryResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
startIndex = json['startIndex'];
endIndex = json['endIndex'];
numberOfRecordsReturned = json['numberOfRecordsReturned'];
totalNumberOfPages = json['totalNumberOfPages'];
totalNumberOfRecords = json['totalNumberOfRecords'];
results = JsonConverters.fromJson(json['results'],'List<ResultItem<ClaimMessage>>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'startIndex': startIndex,
'endIndex': endIndex,
'numberOfRecordsReturned': numberOfRecordsReturned,
'totalNumberOfPages': totalNumberOfPages,
'totalNumberOfRecords': totalNumberOfRecords,
'results': JsonConverters.toJson(results,'List<ResultItem<ClaimMessage>>',context!)
};
getTypeName() => "PagedQueryResult<$T>";
TypeContext? context = _ctx;
}
class PagedQueryResponseWithToken<T> extends PagedQueryResult<ResultItem<InvoiceMessage>> implements IConvertible
{
String continuationToken = "";
PagedQueryResponseWithToken({this.continuationToken});
PagedQueryResponseWithToken.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
continuationToken = json['continuationToken'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'continuationToken': continuationToken
});
getTypeName() => "PagedQueryResponseWithToken<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stf_api_uat.data_xchange.co.za', types: <String, TypeInfo> {
'ORDER': TypeInfo(TypeOf.Enum, enumValues:ORDER.values),
'SearchCustomerMasterQuery': TypeInfo(TypeOf.Class, create:() => SearchCustomerMasterQuery()),
'SearchCustomerMaster': TypeInfo(TypeOf.Class, create:() => SearchCustomerMaster()),
'PagedQueryResult<T>': TypeInfo(TypeOf.Class, create:() => PagedQueryResult<T>()),
'List<ResultItem<ClaimMessage>>': TypeInfo(TypeOf.Class, create:() => <ResultItem<ClaimMessage>>[]),
'ResultItem<ClaimMessage>': TypeInfo(TypeOf.Class, create:() => ResultItem<ClaimMessage>()),
'ClaimMessage': TypeInfo(TypeOf.Class, create:() => ClaimMessage()),
'PagedQueryResponseWithToken<T>': TypeInfo(TypeOf.Class, create:() => PagedQueryResponseWithToken<T>()),
});
Dart SearchCustomerMaster 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.
POST /api/customerMaster/search/owner HTTP/1.1
Host: stf-api-uat.data-xchange.co.za
Accept: application/json
Content-Type: application/json
Content-Length: length
{"query":{"continuationToken":"String","payByEntityIdentification":"String","requestedPage":0,"numberOfRecordsPerPage":0,"orderBy":"String","order":"ASC"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"continuationToken":"String","startIndex":0,"endIndex":0,"numberOfRecordsReturned":0,"totalNumberOfPages":0,"totalNumberOfRecords":0,"results":[{}]}