| Requires any of the roles: | Admin, TeamAdmin | Requires the permission: | ReadData |
| GET | /Webshop/Product/{Id} |
|---|
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 WebshopProductResult implements IConvertible
{
WebshopProductSummary? product;
int? statusCode;
String? message;
WebshopProductResult({this.product,this.statusCode,this.message});
WebshopProductResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
product = JsonConverters.fromJson(json['product'],'WebshopProductSummary',context!);
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'product': JsonConverters.toJson(product,'WebshopProductSummary',context!),
'statusCode': statusCode,
'message': message
};
getTypeName() => "WebshopProductResult";
TypeContext? context = _ctx;
}
class WebshopProductGetRequest implements IConvertible
{
int? id;
int? ownerId;
WebshopProductGetRequest({this.id,this.ownerId});
WebshopProductGetRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
ownerId = json['ownerId'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'ownerId': ownerId
};
getTypeName() => "WebshopProductGetRequest";
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>[]),
'WebshopProductResult': TypeInfo(TypeOf.Class, create:() => WebshopProductResult()),
'WebshopProductGetRequest': TypeInfo(TypeOf.Class, create:() => WebshopProductGetRequest()),
});
Dart WebshopProductGetRequest 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 /Webshop/Product/{Id} HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
product:
{
id: 0,
ownerId: 0,
name: String,
description: String,
category: String,
subCategory: String,
defaultPriceMinor: 0,
imageUrl: String,
viewOrder: 0,
status: String,
payoutInfoId: 0,
legacyItemId: 0,
variants:
[
{
id: 0,
productId: 0,
size: String,
color: String,
stockOnHand: 0,
quantitySold: 0,
availableQuantity: 0,
status: String
}
]
},
statusCode: 0,
message: String
}