| GET | /api/v1/utils/price-types |
|---|
import 'package:servicestack/servicestack.dart';
class Status implements IConvertible
{
String? message;
int? statusCode;
Status({this.message,this.statusCode});
Status.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
message = json['message'];
statusCode = json['statusCode'];
return this;
}
Map<String, dynamic> toJson() => {
'message': message,
'statusCode': statusCode
};
getTypeName() => "Status";
TypeContext? context = _ctx;
}
class BaseResponse implements IConvertible
{
Status? status;
BaseResponse({this.status});
BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
status = JsonConverters.fromJson(json['status'],'Status',context!);
return this;
}
Map<String, dynamic> toJson() => {
'status': JsonConverters.toJson(status,'Status',context!)
};
getTypeName() => "BaseResponse";
TypeContext? context = _ctx;
}
class PriceType implements IConvertible
{
int? id;
// @required()
// @StringLength(50)
String? name;
PriceType({this.id,this.name});
PriceType.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name
};
getTypeName() => "PriceType";
TypeContext? context = _ctx;
}
class GetPriceTypesResponse extends BaseResponse implements IConvertible
{
List<PriceType>? priceTypes;
GetPriceTypesResponse({this.priceTypes});
GetPriceTypesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
priceTypes = JsonConverters.fromJson(json['priceTypes'],'List<PriceType>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'priceTypes': JsonConverters.toJson(priceTypes,'List<PriceType>',context!)
});
getTypeName() => "GetPriceTypesResponse";
TypeContext? context = _ctx;
}
class GetPriceTypes implements IGet, IConvertible
{
GetPriceTypes();
GetPriceTypes.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "GetPriceTypes";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'pecuario_backend.develsystems.com', types: <String, TypeInfo> {
'Status': TypeInfo(TypeOf.Class, create:() => Status()),
'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
'PriceType': TypeInfo(TypeOf.Class, create:() => PriceType()),
'GetPriceTypesResponse': TypeInfo(TypeOf.Class, create:() => GetPriceTypesResponse()),
'List<PriceType>': TypeInfo(TypeOf.Class, create:() => <PriceType>[]),
'GetPriceTypes': TypeInfo(TypeOf.Class, create:() => GetPriceTypes()),
});
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/v1/utils/price-types HTTP/1.1 Host: pecuario-backend.develsystems.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
priceTypes:
[
{
id: 0,
name: String
}
]
}