GET | /voss/products | gets voss products |
---|
import 'package:servicestack/servicestack.dart';
enum TypeEnum
{
Main,
Addon,
License,
Usage,
}
enum StatusEnum
{
Published,
Disabled,
}
// @DataContract(Name="ProductResultProductFamilyDto")
class ProductResultProductFamilyDto implements IConvertible
{
// @DataMember(Name="id", IsRequired=true)
String? id;
// @DataMember(Name="externalId")
String? externalId;
ProductResultProductFamilyDto({this.id,this.externalId});
ProductResultProductFamilyDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['Id'];
externalId = json['ExternalId'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'externalId': externalId
};
getTypeName() => "ProductResultProductFamilyDto";
TypeContext? context = _ctx;
}
// @DataContract(Name="ProductResult")
class ProductResult implements IConvertible
{
// @DataMember(Name="type", IsRequired=true)
TypeEnum? type;
// @DataMember(Name="status", IsRequired=true)
StatusEnum? status;
// @DataMember(Name="id", IsRequired=true)
String? id;
// @DataMember(Name="name", IsRequired=true)
String? name;
// @DataMember(Name="externalId")
String? externalId;
// @DataMember(Name="articleNumber", IsRequired=true)
String? articleNumber;
// @DataMember(Name="productFamily", IsRequired=true)
ProductResultProductFamilyDto? productFamily;
ProductResult({this.type,this.status,this.id,this.name,this.externalId,this.articleNumber,this.productFamily});
ProductResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
type = JsonConverters.fromJson(json['Type'],'TypeEnum',context!);
status = JsonConverters.fromJson(json['Status'],'StatusEnum',context!);
id = json['Id'];
name = json['Name'];
externalId = json['ExternalId'];
articleNumber = json['ArticleNumber'];
productFamily = JsonConverters.fromJson(json['ProductFamily'],'ProductResultProductFamilyDto',context!);
return this;
}
Map<String, dynamic> toJson() => {
'type': JsonConverters.toJson(type,'TypeEnum',context!),
'status': JsonConverters.toJson(status,'StatusEnum',context!),
'id': id,
'name': name,
'externalId': externalId,
'articleNumber': articleNumber,
'productFamily': JsonConverters.toJson(productFamily,'ProductResultProductFamilyDto',context!)
};
getTypeName() => "ProductResult";
TypeContext? context = _ctx;
}
// @DataContract(Name="SearchProductsResult")
class SearchProductsResult implements IConvertible
{
// @DataMember(Name="items", EmitDefaultValue=false)
List<ProductResult>? items;
// @DataMember(Name="totalCount", EmitDefaultValue=false)
int? totalCount;
// @DataMember(Name="pageIndex", EmitDefaultValue=false)
int? pageIndex;
// @DataMember(Name="pageSize", EmitDefaultValue=false)
int? pageSize;
// @DataMember(Name="totalPages", EmitDefaultValue=false)
int? totalPages;
SearchProductsResult({this.items,this.totalCount,this.pageIndex,this.pageSize,this.totalPages});
SearchProductsResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
items = JsonConverters.fromJson(json['Items'],'List<ProductResult>',context!);
totalCount = json['TotalCount'];
pageIndex = json['PageIndex'];
pageSize = json['PageSize'];
totalPages = json['TotalPages'];
return this;
}
Map<String, dynamic> toJson() => {
'items': JsonConverters.toJson(items,'List<ProductResult>',context!),
'totalCount': totalCount,
'pageIndex': pageIndex,
'pageSize': pageSize,
'totalPages': totalPages
};
getTypeName() => "SearchProductsResult";
TypeContext? context = _ctx;
}
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class GetVossProducts implements ICompany, IConvertible
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
// @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
String? CompanyId;
GetVossProducts({this.CompanyId});
GetVossProducts.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId
};
getTypeName() => "GetVossProducts";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
'TypeEnum': TypeInfo(TypeOf.Enum, enumValues:TypeEnum.values),
'StatusEnum': TypeInfo(TypeOf.Enum, enumValues:StatusEnum.values),
'ProductResultProductFamilyDto': TypeInfo(TypeOf.Class, create:() => ProductResultProductFamilyDto()),
'ProductResult': TypeInfo(TypeOf.Class, create:() => ProductResult()),
'SearchProductsResult': TypeInfo(TypeOf.Class, create:() => SearchProductsResult()),
'List<ProductResult>': TypeInfo(TypeOf.Class, create:() => <ProductResult>[]),
'GetVossProducts': TypeInfo(TypeOf.Class, create:() => GetVossProducts()),
});
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.
GET /voss/products HTTP/1.1 Host: testapi.bokamera.se Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SearchProductsResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/VossIntegration.ApiTools.Model"> <items> <ProductResult i:nil="true" /> </items> </SearchProductsResult>