| GET | /principal/get |
|---|
import 'package:servicestack/servicestack.dart';
class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, IConvertible
{
/**
* The API Key required for authentication
*/
// @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
String? apiKey;
/**
* Latitude of the user making this request
*/
// @ApiMember(DataType="double", Description="Latitude of the user making this request")
double? latitude;
/**
* Longitude of the user making this request
*/
// @ApiMember(DataType="double", Description="Longitude of the user making this request")
double? longitude;
ApiServiceRequest({this.apiKey,this.latitude,this.longitude});
ApiServiceRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
apiKey = json['apiKey'];
latitude = JsonConverters.toDouble(json['latitude']);
longitude = JsonConverters.toDouble(json['longitude']);
return this;
}
Map<String, dynamic> toJson() => {
'apiKey': apiKey,
'latitude': latitude,
'longitude': longitude
};
getTypeName() => "ApiServiceRequest";
TypeContext? context = _ctx;
}
class ApiServiceResponse implements IServiceResponse, IConvertible
{
/**
* Information about the response.
*/
// @ApiMember(Description="Information about the response.", IsRequired=true)
String? description;
/**
* Heading or summary of the response.
*/
// @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
String? heading;
/**
* Did the intended operation for this response complete successfully?
*/
// @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
bool? wasSuccessful;
ResponseStatus? responseStatus;
ApiServiceResponse({this.description,this.heading,this.wasSuccessful,this.responseStatus});
ApiServiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
description = json['description'];
heading = json['heading'];
wasSuccessful = json['wasSuccessful'];
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'description': description,
'heading': heading,
'wasSuccessful': wasSuccessful,
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "ApiServiceResponse";
TypeContext? context = _ctx;
}
class ProductData implements IConvertible
{
int? productId;
int? principalId;
String? name;
String? category;
String? productCode;
String? unitBarcode;
int? cartonQuantity;
int? shrinkQuantity;
int? unitQuantity;
String? cartonMeasurement;
String? shrinkMeasurement;
String? unitMeasurement;
double? cartonWeight;
double? shrinkWeight;
double? unitWeight;
double? cartonPrice;
double? shrinkPrice;
double? unitPrice;
int? maxQuantity;
int? maxPrice;
ProductData({this.productId,this.principalId,this.name,this.category,this.productCode,this.unitBarcode,this.cartonQuantity,this.shrinkQuantity,this.unitQuantity,this.cartonMeasurement,this.shrinkMeasurement,this.unitMeasurement,this.cartonWeight,this.shrinkWeight,this.unitWeight,this.cartonPrice,this.shrinkPrice,this.unitPrice,this.maxQuantity,this.maxPrice});
ProductData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
productId = json['productId'];
principalId = json['principalId'];
name = json['name'];
category = json['category'];
productCode = json['productCode'];
unitBarcode = json['unitBarcode'];
cartonQuantity = json['cartonQuantity'];
shrinkQuantity = json['shrinkQuantity'];
unitQuantity = json['unitQuantity'];
cartonMeasurement = json['cartonMeasurement'];
shrinkMeasurement = json['shrinkMeasurement'];
unitMeasurement = json['unitMeasurement'];
cartonWeight = JsonConverters.toDouble(json['cartonWeight']);
shrinkWeight = JsonConverters.toDouble(json['shrinkWeight']);
unitWeight = JsonConverters.toDouble(json['unitWeight']);
cartonPrice = JsonConverters.toDouble(json['cartonPrice']);
shrinkPrice = JsonConverters.toDouble(json['shrinkPrice']);
unitPrice = JsonConverters.toDouble(json['unitPrice']);
maxQuantity = json['maxQuantity'];
maxPrice = json['maxPrice'];
return this;
}
Map<String, dynamic> toJson() => {
'productId': productId,
'principalId': principalId,
'name': name,
'category': category,
'productCode': productCode,
'unitBarcode': unitBarcode,
'cartonQuantity': cartonQuantity,
'shrinkQuantity': shrinkQuantity,
'unitQuantity': unitQuantity,
'cartonMeasurement': cartonMeasurement,
'shrinkMeasurement': shrinkMeasurement,
'unitMeasurement': unitMeasurement,
'cartonWeight': cartonWeight,
'shrinkWeight': shrinkWeight,
'unitWeight': unitWeight,
'cartonPrice': cartonPrice,
'shrinkPrice': shrinkPrice,
'unitPrice': unitPrice,
'maxQuantity': maxQuantity,
'maxPrice': maxPrice
};
getTypeName() => "ProductData";
TypeContext? context = _ctx;
}
class ProductDataCategory implements IConvertible
{
String? unitBarcode;
List<ProductData>? products;
ProductDataCategory({this.unitBarcode,this.products});
ProductDataCategory.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
unitBarcode = json['unitBarcode'];
products = JsonConverters.fromJson(json['products'],'List<ProductData>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'unitBarcode': unitBarcode,
'products': JsonConverters.toJson(products,'List<ProductData>',context!)
};
getTypeName() => "ProductDataCategory";
TypeContext? context = _ctx;
}
class ProductExceptionData implements IConvertible
{
String? region;
String? channel;
int? productId;
List<int>? stockStatusIds;
ProductExceptionData({this.region,this.channel,this.productId,this.stockStatusIds});
ProductExceptionData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
region = json['region'];
channel = json['channel'];
productId = json['productId'];
stockStatusIds = JsonConverters.fromJson(json['stockStatusIds'],'List<int>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'region': region,
'channel': channel,
'productId': productId,
'stockStatusIds': JsonConverters.toJson(stockStatusIds,'List<int>',context!)
};
getTypeName() => "ProductExceptionData";
TypeContext? context = _ctx;
}
class PrincipalData implements IConvertible
{
int? principalId;
String? name;
List<String>? authLetterFileUrl;
String? logoImageUrl;
List<ProductDataCategory>? products;
String? upliftPrefix;
String? contactName;
String? contactNumber;
String? contactEmail;
bool? allowProductLookup;
bool? hasLogo;
bool? hasAuthLetter;
bool? sealNetWeightMandatory;
bool? allowBillableSeals;
bool? captureSerialNumber;
bool? batchCodesMandatory;
bool? captureManufactureAndExpiryDate;
List<ProductExceptionData>? productExceptions;
bool? usesOwnSealNumbers;
PrincipalData({this.principalId,this.name,this.authLetterFileUrl,this.logoImageUrl,this.products,this.upliftPrefix,this.contactName,this.contactNumber,this.contactEmail,this.allowProductLookup,this.hasLogo,this.hasAuthLetter,this.sealNetWeightMandatory,this.allowBillableSeals,this.captureSerialNumber,this.batchCodesMandatory,this.captureManufactureAndExpiryDate,this.productExceptions,this.usesOwnSealNumbers});
PrincipalData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
principalId = json['principalId'];
name = json['name'];
authLetterFileUrl = JsonConverters.fromJson(json['authLetterFileUrl'],'List<String>',context!);
logoImageUrl = json['logoImageUrl'];
products = JsonConverters.fromJson(json['products'],'List<ProductDataCategory>',context!);
upliftPrefix = json['upliftPrefix'];
contactName = json['contactName'];
contactNumber = json['contactNumber'];
contactEmail = json['contactEmail'];
allowProductLookup = json['allowProductLookup'];
hasLogo = json['hasLogo'];
hasAuthLetter = json['hasAuthLetter'];
sealNetWeightMandatory = json['sealNetWeightMandatory'];
allowBillableSeals = json['allowBillableSeals'];
captureSerialNumber = json['captureSerialNumber'];
batchCodesMandatory = json['batchCodesMandatory'];
captureManufactureAndExpiryDate = json['captureManufactureAndExpiryDate'];
productExceptions = JsonConverters.fromJson(json['productExceptions'],'List<ProductExceptionData>',context!);
usesOwnSealNumbers = json['usesOwnSealNumbers'];
return this;
}
Map<String, dynamic> toJson() => {
'principalId': principalId,
'name': name,
'authLetterFileUrl': JsonConverters.toJson(authLetterFileUrl,'List<String>',context!),
'logoImageUrl': logoImageUrl,
'products': JsonConverters.toJson(products,'List<ProductDataCategory>',context!),
'upliftPrefix': upliftPrefix,
'contactName': contactName,
'contactNumber': contactNumber,
'contactEmail': contactEmail,
'allowProductLookup': allowProductLookup,
'hasLogo': hasLogo,
'hasAuthLetter': hasAuthLetter,
'sealNetWeightMandatory': sealNetWeightMandatory,
'allowBillableSeals': allowBillableSeals,
'captureSerialNumber': captureSerialNumber,
'batchCodesMandatory': batchCodesMandatory,
'captureManufactureAndExpiryDate': captureManufactureAndExpiryDate,
'productExceptions': JsonConverters.toJson(productExceptions,'List<ProductExceptionData>',context!),
'usesOwnSealNumbers': usesOwnSealNumbers
};
getTypeName() => "PrincipalData";
TypeContext? context = _ctx;
}
class GetPrincipalResponse extends ApiServiceResponse implements IConvertible
{
PrincipalData? data;
GetPrincipalResponse({this.data});
GetPrincipalResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
data = JsonConverters.fromJson(json['data'],'PrincipalData',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'data': JsonConverters.toJson(data,'PrincipalData',context!)
});
getTypeName() => "GetPrincipalResponse";
TypeContext? context = _ctx;
}
class GetPrincipal extends ApiServiceRequest implements IConvertible
{
int? principalId;
GetPrincipal({this.principalId});
GetPrincipal.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
principalId = json['principalId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'principalId': principalId
});
getTypeName() => "GetPrincipal";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'antel.api.dev.86degrees.com', types: <String, TypeInfo> {
'ApiServiceRequest': TypeInfo(TypeOf.Class, create:() => ApiServiceRequest()),
'ApiServiceResponse': TypeInfo(TypeOf.Class, create:() => ApiServiceResponse()),
'ProductData': TypeInfo(TypeOf.Class, create:() => ProductData()),
'ProductDataCategory': TypeInfo(TypeOf.Class, create:() => ProductDataCategory()),
'List<ProductData>': TypeInfo(TypeOf.Class, create:() => <ProductData>[]),
'ProductExceptionData': TypeInfo(TypeOf.Class, create:() => ProductExceptionData()),
'PrincipalData': TypeInfo(TypeOf.Class, create:() => PrincipalData()),
'List<ProductDataCategory>': TypeInfo(TypeOf.Class, create:() => <ProductDataCategory>[]),
'List<ProductExceptionData>': TypeInfo(TypeOf.Class, create:() => <ProductExceptionData>[]),
'GetPrincipalResponse': TypeInfo(TypeOf.Class, create:() => GetPrincipalResponse()),
'GetPrincipal': TypeInfo(TypeOf.Class, create:() => GetPrincipal()),
});
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 /principal/get HTTP/1.1 Host: antel.api.dev.86degrees.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
data:
{
principalId: 0,
name: String,
authLetterFileUrl:
[
String
],
logoImageUrl: String,
products:
[
{
unitBarcode: String,
products:
[
{
productId: 0,
principalId: 0,
name: String,
category: String,
productCode: String,
unitBarcode: String,
cartonQuantity: 0,
shrinkQuantity: 0,
unitQuantity: 0,
cartonMeasurement: String,
shrinkMeasurement: String,
unitMeasurement: String,
cartonWeight: 0,
shrinkWeight: 0,
unitWeight: 0,
cartonPrice: 0,
shrinkPrice: 0,
unitPrice: 0,
maxQuantity: 0,
maxPrice: 0
}
]
}
],
upliftPrefix: String,
contactName: String,
contactNumber: String,
contactEmail: String,
allowProductLookup: False,
hasLogo: False,
hasAuthLetter: False,
sealNetWeightMandatory: False,
allowBillableSeals: False,
captureSerialNumber: False,
batchCodesMandatory: False,
captureManufactureAndExpiryDate: False,
productExceptions:
[
{
region: String,
channel: String,
productId: 0,
stockStatusIds:
[
0
]
}
],
usesOwnSealNumbers: False
},
description: String,
heading: String,
wasSuccessful: False,
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}