| 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 .xml suffix or ?format=xml
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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetPrincipalResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel">
<Description xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">String</Description>
<Heading xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">String</Heading>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types" xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
<WasSuccessful xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">false</WasSuccessful>
<Data>
<AllowBillableSeals>false</AllowBillableSeals>
<AllowProductLookup>false</AllowProductLookup>
<AuthLetterFileUrl xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:string>String</d3p1:string>
</AuthLetterFileUrl>
<BatchCodesMandatory>false</BatchCodesMandatory>
<CaptureManufactureAndExpiryDate>false</CaptureManufactureAndExpiryDate>
<CaptureSerialNumber>false</CaptureSerialNumber>
<ContactEmail>String</ContactEmail>
<ContactName>String</ContactName>
<ContactNumber>String</ContactNumber>
<HasAuthLetter>false</HasAuthLetter>
<HasLogo>false</HasLogo>
<LogoImageUrl>String</LogoImageUrl>
<Name>String</Name>
<PrincipalId>0</PrincipalId>
<ProductExceptions>
<ProductExceptionData>
<Channel>String</Channel>
<ProductId>0</ProductId>
<Region>String</Region>
<StockStatusIds xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:int>0</d5p1:int>
</StockStatusIds>
</ProductExceptionData>
</ProductExceptions>
<Products>
<ProductDataCategory>
<Products>
<ProductData>
<CartonMeasurement>String</CartonMeasurement>
<CartonPrice>0</CartonPrice>
<CartonQuantity>0</CartonQuantity>
<CartonWeight>0</CartonWeight>
<Category>String</Category>
<MaxPrice>0</MaxPrice>
<MaxQuantity>0</MaxQuantity>
<Name>String</Name>
<PrincipalId>0</PrincipalId>
<ProductCode>String</ProductCode>
<ProductId>0</ProductId>
<ShrinkMeasurement>String</ShrinkMeasurement>
<ShrinkPrice>0</ShrinkPrice>
<ShrinkQuantity>0</ShrinkQuantity>
<ShrinkWeight>0</ShrinkWeight>
<UnitBarcode>String</UnitBarcode>
<UnitMeasurement>String</UnitMeasurement>
<UnitPrice>0</UnitPrice>
<UnitQuantity>0</UnitQuantity>
<UnitWeight>0</UnitWeight>
</ProductData>
</Products>
<UnitBarcode>String</UnitBarcode>
</ProductDataCategory>
</Products>
<SealNetWeightMandatory>false</SealNetWeightMandatory>
<UpliftPrefix>String</UpliftPrefix>
<UsesOwnSealNumbers>false</UsesOwnSealNumbers>
</Data>
</GetPrincipalResponse>