| GET | /api/v1/marketplace/products |
|---|
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 DashboardProduct implements IConvertible
{
String? id;
String? description;
String? image;
String? type;
String? price;
String? cityRegionName;
String? priceType;
DashboardProduct({this.id,this.description,this.image,this.type,this.price,this.cityRegionName,this.priceType});
DashboardProduct.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
description = json['description'];
image = json['image'];
type = json['type'];
price = json['price'];
cityRegionName = json['cityRegionName'];
priceType = json['priceType'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'description': description,
'image': image,
'type': type,
'price': price,
'cityRegionName': cityRegionName,
'priceType': priceType
};
getTypeName() => "DashboardProduct";
TypeContext? context = _ctx;
}
class GetMarketplaceProductsResponse extends BaseResponse implements IConvertible
{
List<DashboardProduct>? products;
String? offset;
GetMarketplaceProductsResponse({this.products,this.offset});
GetMarketplaceProductsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
products = JsonConverters.fromJson(json['products'],'List<DashboardProduct>',context!);
offset = json['offset'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'products': JsonConverters.toJson(products,'List<DashboardProduct>',context!),
'offset': offset
});
getTypeName() => "GetMarketplaceProductsResponse";
TypeContext? context = _ctx;
}
class GetMarketplaceProducts implements IGet, IConvertible
{
String? categoryName;
int? pageSize;
String? offset;
GetMarketplaceProducts({this.categoryName,this.pageSize,this.offset});
GetMarketplaceProducts.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
categoryName = json['categoryName'];
pageSize = json['pageSize'];
offset = json['offset'];
return this;
}
Map<String, dynamic> toJson() => {
'categoryName': categoryName,
'pageSize': pageSize,
'offset': offset
};
getTypeName() => "GetMarketplaceProducts";
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()),
'DashboardProduct': TypeInfo(TypeOf.Class, create:() => DashboardProduct()),
'GetMarketplaceProductsResponse': TypeInfo(TypeOf.Class, create:() => GetMarketplaceProductsResponse()),
'List<DashboardProduct>': TypeInfo(TypeOf.Class, create:() => <DashboardProduct>[]),
'GetMarketplaceProducts': TypeInfo(TypeOf.Class, create:() => GetMarketplaceProducts()),
});
Dart GetMarketplaceProducts 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/v1/marketplace/products HTTP/1.1 Host: pecuario-backend.develsystems.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
products:
[
{
id: String,
description: String,
image: String,
type: String,
price: String,
cityRegionName: String,
priceType: String
}
],
offset: String
}