| POST | /uplift/auth |
|---|
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 UpliftAuthRequestResponse extends ApiServiceResponse implements IConvertible
{
String? upliftAuthRequestId;
UpliftAuthRequestResponse({this.upliftAuthRequestId});
UpliftAuthRequestResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
upliftAuthRequestId = json['upliftAuthRequestId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'upliftAuthRequestId': upliftAuthRequestId
});
getTypeName() => "UpliftAuthRequestResponse";
TypeContext? context = _ctx;
}
class UpliftProductData implements IConvertible
{
int? upliftProductId;
int? upliftId;
int? productId;
double? unitPrice;
String? name;
String? category;
String? unitBarcode;
String? unitSize;
double? unitWeight;
String? code;
List<dynamic>? upliftImages;
double? quantity;
double? value;
bool? priceOverMax;
bool? quantityOverMax;
bool? quantityOverRequirement;
String? serialNumber;
String? batchCode;
int? stockStatusId;
String? lotNumber;
String? expiryDate;
String? manufactureDate;
UpliftProductData({this.upliftProductId,this.upliftId,this.productId,this.unitPrice,this.name,this.category,this.unitBarcode,this.unitSize,this.unitWeight,this.code,this.upliftImages,this.quantity,this.value,this.priceOverMax,this.quantityOverMax,this.quantityOverRequirement,this.serialNumber,this.batchCode,this.stockStatusId,this.lotNumber,this.expiryDate,this.manufactureDate});
UpliftProductData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
upliftProductId = json['upliftProductId'];
upliftId = json['upliftId'];
productId = json['productId'];
unitPrice = JsonConverters.toDouble(json['unitPrice']);
name = json['name'];
category = json['category'];
unitBarcode = json['unitBarcode'];
unitSize = json['unitSize'];
unitWeight = JsonConverters.toDouble(json['unitWeight']);
code = json['code'];
upliftImages = JsonConverters.fromJson(json['upliftImages'],'List<dynamic>',context!);
quantity = JsonConverters.toDouble(json['quantity']);
value = JsonConverters.toDouble(json['value']);
priceOverMax = json['priceOverMax'];
quantityOverMax = json['quantityOverMax'];
quantityOverRequirement = json['quantityOverRequirement'];
serialNumber = json['serialNumber'];
batchCode = json['batchCode'];
stockStatusId = json['stockStatusId'];
lotNumber = json['lotNumber'];
expiryDate = json['expiryDate'];
manufactureDate = json['manufactureDate'];
return this;
}
Map<String, dynamic> toJson() => {
'upliftProductId': upliftProductId,
'upliftId': upliftId,
'productId': productId,
'unitPrice': unitPrice,
'name': name,
'category': category,
'unitBarcode': unitBarcode,
'unitSize': unitSize,
'unitWeight': unitWeight,
'code': code,
'upliftImages': JsonConverters.toJson(upliftImages,'List<dynamic>',context!),
'quantity': quantity,
'value': value,
'priceOverMax': priceOverMax,
'quantityOverMax': quantityOverMax,
'quantityOverRequirement': quantityOverRequirement,
'serialNumber': serialNumber,
'batchCode': batchCode,
'stockStatusId': stockStatusId,
'lotNumber': lotNumber,
'expiryDate': expiryDate,
'manufactureDate': manufactureDate
};
getTypeName() => "UpliftProductData";
TypeContext? context = _ctx;
}
class UpliftSealData implements IConvertible
{
bool? unbagged;
String? sealNumber;
String? antelSealNumber;
List<UpliftProductData>? products;
double? totalPrice;
double? totalQuantity;
double? netWeight;
double? grossWeight;
bool? billableSeal;
bool? invalidAntelSealNumber;
UpliftSealData({this.unbagged,this.sealNumber,this.antelSealNumber,this.products,this.totalPrice,this.totalQuantity,this.netWeight,this.grossWeight,this.billableSeal,this.invalidAntelSealNumber});
UpliftSealData.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
unbagged = json['unbagged'];
sealNumber = json['sealNumber'];
antelSealNumber = json['antelSealNumber'];
products = JsonConverters.fromJson(json['products'],'List<UpliftProductData>',context!);
totalPrice = JsonConverters.toDouble(json['totalPrice']);
totalQuantity = JsonConverters.toDouble(json['totalQuantity']);
netWeight = JsonConverters.toDouble(json['netWeight']);
grossWeight = JsonConverters.toDouble(json['grossWeight']);
billableSeal = json['billableSeal'];
invalidAntelSealNumber = json['invalidAntelSealNumber'];
return this;
}
Map<String, dynamic> toJson() => {
'unbagged': unbagged,
'sealNumber': sealNumber,
'antelSealNumber': antelSealNumber,
'products': JsonConverters.toJson(products,'List<UpliftProductData>',context!),
'totalPrice': totalPrice,
'totalQuantity': totalQuantity,
'netWeight': netWeight,
'grossWeight': grossWeight,
'billableSeal': billableSeal,
'invalidAntelSealNumber': invalidAntelSealNumber
};
getTypeName() => "UpliftSealData";
TypeContext? context = _ctx;
}
class UpliftAuthRequest extends ApiServiceRequest implements IConvertible
{
int? upliftSchedulePrincipleId;
double? totalValue;
double? totalUnits;
String? region;
String? channel;
List<UpliftSealData>? seals;
UpliftSealData? unbaggedItems;
UpliftAuthRequest({this.upliftSchedulePrincipleId,this.totalValue,this.totalUnits,this.region,this.channel,this.seals,this.unbaggedItems});
UpliftAuthRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
upliftSchedulePrincipleId = json['upliftSchedulePrincipleId'];
totalValue = JsonConverters.toDouble(json['totalValue']);
totalUnits = JsonConverters.toDouble(json['totalUnits']);
region = json['region'];
channel = json['channel'];
seals = JsonConverters.fromJson(json['seals'],'List<UpliftSealData>',context!);
unbaggedItems = JsonConverters.fromJson(json['unbaggedItems'],'UpliftSealData',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'upliftSchedulePrincipleId': upliftSchedulePrincipleId,
'totalValue': totalValue,
'totalUnits': totalUnits,
'region': region,
'channel': channel,
'seals': JsonConverters.toJson(seals,'List<UpliftSealData>',context!),
'unbaggedItems': JsonConverters.toJson(unbaggedItems,'UpliftSealData',context!)
});
getTypeName() => "UpliftAuthRequest";
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()),
'UpliftAuthRequestResponse': TypeInfo(TypeOf.Class, create:() => UpliftAuthRequestResponse()),
'UpliftProductData': TypeInfo(TypeOf.Class, create:() => UpliftProductData()),
'List<dynamic>': TypeInfo(TypeOf.Class, create:() => <dynamic>[]),
'UpliftSealData': TypeInfo(TypeOf.Class, create:() => UpliftSealData()),
'List<UpliftProductData>': TypeInfo(TypeOf.Class, create:() => <UpliftProductData>[]),
'UpliftAuthRequest': TypeInfo(TypeOf.Class, create:() => UpliftAuthRequest()),
'List<UpliftSealData>': TypeInfo(TypeOf.Class, create:() => <UpliftSealData>[]),
});
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 /uplift/auth HTTP/1.1
Host: antel.api.dev.86degrees.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UpliftAuthRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel">
<ApiKey xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">String</ApiKey>
<Latitude xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">0</Latitude>
<Longitude xmlns="http://schemas.datacontract.org/2004/07/WebService.ServiceModel.Base">0</Longitude>
<Channel>String</Channel>
<Region>String</Region>
<Seals>
<UpliftSealData>
<AntelSealNumber>String</AntelSealNumber>
<BillableSeal>false</BillableSeal>
<GrossWeight>0</GrossWeight>
<InvalidAntelSealNumber>false</InvalidAntelSealNumber>
<NetWeight>0</NetWeight>
<Products>
<UpliftProductData>
<BatchCode>String</BatchCode>
<Category>String</Category>
<Code>String</Code>
<ExpiryDate>String</ExpiryDate>
<LotNumber>String</LotNumber>
<ManufactureDate>String</ManufactureDate>
<Name>String</Name>
<PriceOverMax>false</PriceOverMax>
<ProductId>0</ProductId>
<Quantity>0</Quantity>
<QuantityOverMax>false</QuantityOverMax>
<QuantityOverRequirement>false</QuantityOverRequirement>
<SerialNumber>String</SerialNumber>
<StockStatusId>0</StockStatusId>
<UnitBarcode>String</UnitBarcode>
<UnitPrice>0</UnitPrice>
<UnitSize>String</UnitSize>
<UnitWeight>0</UnitWeight>
<UpliftId>0</UpliftId>
<UpliftImages xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d6p1:anyType />
</UpliftImages>
<UpliftProductId>0</UpliftProductId>
<Value>0</Value>
</UpliftProductData>
</Products>
<SealNumber>String</SealNumber>
<TotalPrice>0</TotalPrice>
<TotalQuantity>0</TotalQuantity>
<Unbagged>false</Unbagged>
</UpliftSealData>
</Seals>
<TotalUnits>0</TotalUnits>
<TotalValue>0</TotalValue>
<UnbaggedItems>
<AntelSealNumber>String</AntelSealNumber>
<BillableSeal>false</BillableSeal>
<GrossWeight>0</GrossWeight>
<InvalidAntelSealNumber>false</InvalidAntelSealNumber>
<NetWeight>0</NetWeight>
<Products>
<UpliftProductData>
<BatchCode>String</BatchCode>
<Category>String</Category>
<Code>String</Code>
<ExpiryDate>String</ExpiryDate>
<LotNumber>String</LotNumber>
<ManufactureDate>String</ManufactureDate>
<Name>String</Name>
<PriceOverMax>false</PriceOverMax>
<ProductId>0</ProductId>
<Quantity>0</Quantity>
<QuantityOverMax>false</QuantityOverMax>
<QuantityOverRequirement>false</QuantityOverRequirement>
<SerialNumber>String</SerialNumber>
<StockStatusId>0</StockStatusId>
<UnitBarcode>String</UnitBarcode>
<UnitPrice>0</UnitPrice>
<UnitSize>String</UnitSize>
<UnitWeight>0</UnitWeight>
<UpliftId>0</UpliftId>
<UpliftImages xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:anyType />
</UpliftImages>
<UpliftProductId>0</UpliftProductId>
<Value>0</Value>
</UpliftProductData>
</Products>
<SealNumber>String</SealNumber>
<TotalPrice>0</TotalPrice>
<TotalQuantity>0</TotalQuantity>
<Unbagged>false</Unbagged>
</UnbaggedItems>
<UpliftSchedulePrincipleId>0</UpliftSchedulePrincipleId>
</UpliftAuthRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<UpliftAuthRequestResponse 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>
<UpliftAuthRequestId>00000000-0000-0000-0000-000000000000</UpliftAuthRequestId>
</UpliftAuthRequestResponse>