| GET | /api/purchaseCondition/type/{Type} | Get paged Purchase Condition response by type |
|---|
import 'package:servicestack/servicestack.dart';
/**
* Purchase Conditions
*/
// @Api(Description="Purchase Conditions")
// @ApiResponse(Description="Paged Purchase Condition response by type", IsDefaultResponse=true, StatusCode=200)
class GetPurchaseConditionByType implements IConvertible
{
/**
* Not used
*/
// @ApiMember(Description="Not used")
String searchTerm = "";
/**
* Requested page number, starting at 1
*/
// @ApiMember(Description="Requested page number, starting at 1")
int requestedPage = 0;
/**
* Number of records to return on a page
*/
// @ApiMember(Description="Number of records to return on a page")
int numberOfRecordsPerPage = 0;
/**
* PurchaseCondition type to be returned
*/
// @ApiMember(Description="PurchaseCondition type to be returned", ExcludeInSchema=true, ParameterType="path")
String type = "";
GetPurchaseConditionByType({this.searchTerm,this.requestedPage,this.numberOfRecordsPerPage,this.type});
GetPurchaseConditionByType.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
searchTerm = json['searchTerm'];
requestedPage = json['requestedPage'];
numberOfRecordsPerPage = json['numberOfRecordsPerPage'];
type = json['type'];
return this;
}
Map<String, dynamic> toJson() => {
'searchTerm': searchTerm,
'requestedPage': requestedPage,
'numberOfRecordsPerPage': numberOfRecordsPerPage,
'type': type
};
getTypeName() => "GetPurchaseConditionByType";
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;
}
TypeContext _ctx = TypeContext(library: 'stf_api_uat.data_xchange.co.za', types: <String, TypeInfo> {
'GetPurchaseConditionByType': TypeInfo(TypeOf.Class, create:() => GetPurchaseConditionByType()),
'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()),
});
Dart GetPurchaseConditionByType DTOs
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.
GET /api/purchaseCondition/type/{Type} HTTP/1.1
Host: stf-api-uat.data-xchange.co.za
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
startIndex: 0,
endIndex: 0,
numberOfRecordsReturned: 0,
totalNumberOfPages: 0,
totalNumberOfRecords: 0,
results:
[
{
}
]
}