| Requires any of the roles: | Admin, TeamAdmin | Requires the permission: | ReadData |
| POST | /Webshop/Product/Search |
|---|
import 'package:servicestack/servicestack.dart';
class WebshopVariantSummary implements IConvertible
{
int? id;
int? productId;
String? size;
String? color;
int? stockOnHand;
int? quantitySold;
int? availableQuantity;
String? status;
WebshopVariantSummary({this.id,this.productId,this.size,this.color,this.stockOnHand,this.quantitySold,this.availableQuantity,this.status});
WebshopVariantSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
productId = json['productId'];
size = json['size'];
color = json['color'];
stockOnHand = json['stockOnHand'];
quantitySold = json['quantitySold'];
availableQuantity = json['availableQuantity'];
status = json['status'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'productId': productId,
'size': size,
'color': color,
'stockOnHand': stockOnHand,
'quantitySold': quantitySold,
'availableQuantity': availableQuantity,
'status': status
};
getTypeName() => "WebshopVariantSummary";
TypeContext? context = _ctx;
}
class WebshopProductSummary implements IConvertible
{
int? id;
int? ownerId;
String? name;
String? description;
String? category;
String? subCategory;
int? defaultPriceMinor;
String? imageUrl;
int? viewOrder;
String? status;
int? payoutInfoId;
int? legacyItemId;
List<WebshopVariantSummary>? variants;
WebshopProductSummary({this.id,this.ownerId,this.name,this.description,this.category,this.subCategory,this.defaultPriceMinor,this.imageUrl,this.viewOrder,this.status,this.payoutInfoId,this.legacyItemId,this.variants});
WebshopProductSummary.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
ownerId = json['ownerId'];
name = json['name'];
description = json['description'];
category = json['category'];
subCategory = json['subCategory'];
defaultPriceMinor = json['defaultPriceMinor'];
imageUrl = json['imageUrl'];
viewOrder = json['viewOrder'];
status = json['status'];
payoutInfoId = json['payoutInfoId'];
legacyItemId = json['legacyItemId'];
variants = JsonConverters.fromJson(json['variants'],'List<WebshopVariantSummary>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'ownerId': ownerId,
'name': name,
'description': description,
'category': category,
'subCategory': subCategory,
'defaultPriceMinor': defaultPriceMinor,
'imageUrl': imageUrl,
'viewOrder': viewOrder,
'status': status,
'payoutInfoId': payoutInfoId,
'legacyItemId': legacyItemId,
'variants': JsonConverters.toJson(variants,'List<WebshopVariantSummary>',context!)
};
getTypeName() => "WebshopProductSummary";
TypeContext? context = _ctx;
}
class WebshopProductSearchResult implements IConvertible
{
List<WebshopProductSummary>? items;
int? totalCount;
int? statusCode;
String? message;
WebshopProductSearchResult({this.items,this.totalCount,this.statusCode,this.message});
WebshopProductSearchResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
items = JsonConverters.fromJson(json['items'],'List<WebshopProductSummary>',context!);
totalCount = json['totalCount'];
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'items': JsonConverters.toJson(items,'List<WebshopProductSummary>',context!),
'totalCount': totalCount,
'statusCode': statusCode,
'message': message
};
getTypeName() => "WebshopProductSearchResult";
TypeContext? context = _ctx;
}
class WebshopProductSearchRequest implements IConvertible
{
int? ownerId;
String? status;
String? category;
String? text;
int? skip;
int? take;
WebshopProductSearchRequest({this.ownerId,this.status,this.category,this.text,this.skip,this.take});
WebshopProductSearchRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ownerId = json['ownerId'];
status = json['status'];
category = json['category'];
text = json['text'];
skip = json['skip'];
take = json['take'];
return this;
}
Map<String, dynamic> toJson() => {
'ownerId': ownerId,
'status': status,
'category': category,
'text': text,
'skip': skip,
'take': take
};
getTypeName() => "WebshopProductSearchRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'WebshopVariantSummary': TypeInfo(TypeOf.Class, create:() => WebshopVariantSummary()),
'WebshopProductSummary': TypeInfo(TypeOf.Class, create:() => WebshopProductSummary()),
'List<WebshopVariantSummary>': TypeInfo(TypeOf.Class, create:() => <WebshopVariantSummary>[]),
'WebshopProductSearchResult': TypeInfo(TypeOf.Class, create:() => WebshopProductSearchResult()),
'List<WebshopProductSummary>': TypeInfo(TypeOf.Class, create:() => <WebshopProductSummary>[]),
'WebshopProductSearchRequest': TypeInfo(TypeOf.Class, create:() => WebshopProductSearchRequest()),
});
Dart WebshopProductSearchRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Webshop/Product/Search HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<WebshopProductSearchRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Category>String</Category>
<OwnerId>0</OwnerId>
<Skip>0</Skip>
<Status>String</Status>
<Take>0</Take>
<Text>String</Text>
</WebshopProductSearchRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<WebshopProductSearchResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Items>
<WebshopProductSummary>
<Category>String</Category>
<DefaultPriceMinor>0</DefaultPriceMinor>
<Description>String</Description>
<ID>0</ID>
<ImageUrl>String</ImageUrl>
<LegacyItemId>0</LegacyItemId>
<Name>String</Name>
<OwnerId>0</OwnerId>
<PayoutInfoId>0</PayoutInfoId>
<Status>String</Status>
<SubCategory>String</SubCategory>
<Variants>
<WebshopVariantSummary>
<AvailableQuantity>0</AvailableQuantity>
<Color>String</Color>
<ID>0</ID>
<ProductId>0</ProductId>
<QuantitySold>0</QuantitySold>
<Size>String</Size>
<Status>String</Status>
<StockOnHand>0</StockOnHand>
</WebshopVariantSummary>
</Variants>
<ViewOrder>0</ViewOrder>
</WebshopProductSummary>
</Items>
<Message>String</Message>
<StatusCode>0</StatusCode>
<TotalCount>0</TotalCount>
</WebshopProductSearchResult>