| GET | /principal/get |
|---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, JsonSerializable
{
public function __construct(
/** @description The API Key required for authentication */
// @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
/** @var string */
public string $apiKey='',
/** @description Latitude of the user making this request */
// @ApiMember(DataType="double", Description="Latitude of the user making this request")
/** @var float */
public float $latitude=0.0,
/** @description Longitude of the user making this request */
// @ApiMember(DataType="double", Description="Longitude of the user making this request")
/** @var float */
public float $longitude=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['apiKey'])) $this->apiKey = $o['apiKey'];
if (isset($o['latitude'])) $this->latitude = $o['latitude'];
if (isset($o['longitude'])) $this->longitude = $o['longitude'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->apiKey)) $o['apiKey'] = $this->apiKey;
if (isset($this->latitude)) $o['latitude'] = $this->latitude;
if (isset($this->longitude)) $o['longitude'] = $this->longitude;
return empty($o) ? new class(){} : $o;
}
}
class ApiServiceResponse implements IServiceResponse, JsonSerializable
{
public function __construct(
/** @description Information about the response. */
// @ApiMember(Description="Information about the response.", IsRequired=true)
/** @var string */
public string $description='',
/** @description Heading or summary of the response. */
// @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
/** @var string */
public string $heading='',
/** @description Did the intended operation for this response complete successfully? */
// @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
/** @var bool|null */
public ?bool $wasSuccessful=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $responseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['description'])) $this->description = $o['description'];
if (isset($o['heading'])) $this->heading = $o['heading'];
if (isset($o['wasSuccessful'])) $this->wasSuccessful = $o['wasSuccessful'];
if (isset($o['responseStatus'])) $this->responseStatus = JsonConverters::from('ResponseStatus', $o['responseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->description)) $o['description'] = $this->description;
if (isset($this->heading)) $o['heading'] = $this->heading;
if (isset($this->wasSuccessful)) $o['wasSuccessful'] = $this->wasSuccessful;
if (isset($this->responseStatus)) $o['responseStatus'] = JsonConverters::to('ResponseStatus', $this->responseStatus);
return empty($o) ? new class(){} : $o;
}
}
class ProductData implements JsonSerializable
{
public function __construct(
/** @var int */
public int $productId=0,
/** @var int */
public int $principalId=0,
/** @var string|null */
public ?string $name=null,
/** @var string|null */
public ?string $category=null,
/** @var string|null */
public ?string $productCode=null,
/** @var string|null */
public ?string $unitBarcode=null,
/** @var int */
public int $cartonQuantity=0,
/** @var int */
public int $shrinkQuantity=0,
/** @var int */
public int $unitQuantity=0,
/** @var string|null */
public ?string $cartonMeasurement=null,
/** @var string|null */
public ?string $shrinkMeasurement=null,
/** @var string|null */
public ?string $unitMeasurement=null,
/** @var float */
public float $cartonWeight=0.0,
/** @var float */
public float $shrinkWeight=0.0,
/** @var float */
public float $unitWeight=0.0,
/** @var float */
public float $cartonPrice=0.0,
/** @var float */
public float $shrinkPrice=0.0,
/** @var float */
public float $unitPrice=0.0,
/** @var int */
public int $maxQuantity=0,
/** @var int */
public int $maxPrice=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['productId'])) $this->productId = $o['productId'];
if (isset($o['principalId'])) $this->principalId = $o['principalId'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['category'])) $this->category = $o['category'];
if (isset($o['productCode'])) $this->productCode = $o['productCode'];
if (isset($o['unitBarcode'])) $this->unitBarcode = $o['unitBarcode'];
if (isset($o['cartonQuantity'])) $this->cartonQuantity = $o['cartonQuantity'];
if (isset($o['shrinkQuantity'])) $this->shrinkQuantity = $o['shrinkQuantity'];
if (isset($o['unitQuantity'])) $this->unitQuantity = $o['unitQuantity'];
if (isset($o['cartonMeasurement'])) $this->cartonMeasurement = $o['cartonMeasurement'];
if (isset($o['shrinkMeasurement'])) $this->shrinkMeasurement = $o['shrinkMeasurement'];
if (isset($o['unitMeasurement'])) $this->unitMeasurement = $o['unitMeasurement'];
if (isset($o['cartonWeight'])) $this->cartonWeight = $o['cartonWeight'];
if (isset($o['shrinkWeight'])) $this->shrinkWeight = $o['shrinkWeight'];
if (isset($o['unitWeight'])) $this->unitWeight = $o['unitWeight'];
if (isset($o['cartonPrice'])) $this->cartonPrice = $o['cartonPrice'];
if (isset($o['shrinkPrice'])) $this->shrinkPrice = $o['shrinkPrice'];
if (isset($o['unitPrice'])) $this->unitPrice = $o['unitPrice'];
if (isset($o['maxQuantity'])) $this->maxQuantity = $o['maxQuantity'];
if (isset($o['maxPrice'])) $this->maxPrice = $o['maxPrice'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->productId)) $o['productId'] = $this->productId;
if (isset($this->principalId)) $o['principalId'] = $this->principalId;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->category)) $o['category'] = $this->category;
if (isset($this->productCode)) $o['productCode'] = $this->productCode;
if (isset($this->unitBarcode)) $o['unitBarcode'] = $this->unitBarcode;
if (isset($this->cartonQuantity)) $o['cartonQuantity'] = $this->cartonQuantity;
if (isset($this->shrinkQuantity)) $o['shrinkQuantity'] = $this->shrinkQuantity;
if (isset($this->unitQuantity)) $o['unitQuantity'] = $this->unitQuantity;
if (isset($this->cartonMeasurement)) $o['cartonMeasurement'] = $this->cartonMeasurement;
if (isset($this->shrinkMeasurement)) $o['shrinkMeasurement'] = $this->shrinkMeasurement;
if (isset($this->unitMeasurement)) $o['unitMeasurement'] = $this->unitMeasurement;
if (isset($this->cartonWeight)) $o['cartonWeight'] = $this->cartonWeight;
if (isset($this->shrinkWeight)) $o['shrinkWeight'] = $this->shrinkWeight;
if (isset($this->unitWeight)) $o['unitWeight'] = $this->unitWeight;
if (isset($this->cartonPrice)) $o['cartonPrice'] = $this->cartonPrice;
if (isset($this->shrinkPrice)) $o['shrinkPrice'] = $this->shrinkPrice;
if (isset($this->unitPrice)) $o['unitPrice'] = $this->unitPrice;
if (isset($this->maxQuantity)) $o['maxQuantity'] = $this->maxQuantity;
if (isset($this->maxPrice)) $o['maxPrice'] = $this->maxPrice;
return empty($o) ? new class(){} : $o;
}
}
class ProductDataCategory implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $unitBarcode=null,
/** @var array<ProductData>|null */
public ?array $products=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['unitBarcode'])) $this->unitBarcode = $o['unitBarcode'];
if (isset($o['products'])) $this->products = JsonConverters::fromArray('ProductData', $o['products']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->unitBarcode)) $o['unitBarcode'] = $this->unitBarcode;
if (isset($this->products)) $o['products'] = JsonConverters::toArray('ProductData', $this->products);
return empty($o) ? new class(){} : $o;
}
}
class ProductExceptionData implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $region=null,
/** @var string|null */
public ?string $channel=null,
/** @var int */
public int $productId=0,
/** @var array<int>|null */
public ?array $stockStatusIds=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['region'])) $this->region = $o['region'];
if (isset($o['channel'])) $this->channel = $o['channel'];
if (isset($o['productId'])) $this->productId = $o['productId'];
if (isset($o['stockStatusIds'])) $this->stockStatusIds = JsonConverters::fromArray('int', $o['stockStatusIds']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->region)) $o['region'] = $this->region;
if (isset($this->channel)) $o['channel'] = $this->channel;
if (isset($this->productId)) $o['productId'] = $this->productId;
if (isset($this->stockStatusIds)) $o['stockStatusIds'] = JsonConverters::toArray('int', $this->stockStatusIds);
return empty($o) ? new class(){} : $o;
}
}
class PrincipalData implements JsonSerializable
{
public function __construct(
/** @var int */
public int $principalId=0,
/** @var string|null */
public ?string $name=null,
/** @var array<string>|null */
public ?array $authLetterFileUrl=null,
/** @var string|null */
public ?string $logoImageUrl=null,
/** @var array<ProductDataCategory>|null */
public ?array $products=null,
/** @var string|null */
public ?string $upliftPrefix=null,
/** @var string|null */
public ?string $contactName=null,
/** @var string|null */
public ?string $contactNumber=null,
/** @var string|null */
public ?string $contactEmail=null,
/** @var bool|null */
public ?bool $allowProductLookup=null,
/** @var bool|null */
public ?bool $hasLogo=null,
/** @var bool|null */
public ?bool $hasAuthLetter=null,
/** @var bool|null */
public ?bool $sealNetWeightMandatory=null,
/** @var bool|null */
public ?bool $allowBillableSeals=null,
/** @var bool|null */
public ?bool $captureSerialNumber=null,
/** @var bool|null */
public ?bool $batchCodesMandatory=null,
/** @var bool|null */
public ?bool $captureManufactureAndExpiryDate=null,
/** @var array<ProductExceptionData>|null */
public ?array $productExceptions=null,
/** @var bool|null */
public ?bool $usesOwnSealNumbers=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['principalId'])) $this->principalId = $o['principalId'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['authLetterFileUrl'])) $this->authLetterFileUrl = JsonConverters::fromArray('string', $o['authLetterFileUrl']);
if (isset($o['logoImageUrl'])) $this->logoImageUrl = $o['logoImageUrl'];
if (isset($o['products'])) $this->products = JsonConverters::fromArray('ProductDataCategory', $o['products']);
if (isset($o['upliftPrefix'])) $this->upliftPrefix = $o['upliftPrefix'];
if (isset($o['contactName'])) $this->contactName = $o['contactName'];
if (isset($o['contactNumber'])) $this->contactNumber = $o['contactNumber'];
if (isset($o['contactEmail'])) $this->contactEmail = $o['contactEmail'];
if (isset($o['allowProductLookup'])) $this->allowProductLookup = $o['allowProductLookup'];
if (isset($o['hasLogo'])) $this->hasLogo = $o['hasLogo'];
if (isset($o['hasAuthLetter'])) $this->hasAuthLetter = $o['hasAuthLetter'];
if (isset($o['sealNetWeightMandatory'])) $this->sealNetWeightMandatory = $o['sealNetWeightMandatory'];
if (isset($o['allowBillableSeals'])) $this->allowBillableSeals = $o['allowBillableSeals'];
if (isset($o['captureSerialNumber'])) $this->captureSerialNumber = $o['captureSerialNumber'];
if (isset($o['batchCodesMandatory'])) $this->batchCodesMandatory = $o['batchCodesMandatory'];
if (isset($o['captureManufactureAndExpiryDate'])) $this->captureManufactureAndExpiryDate = $o['captureManufactureAndExpiryDate'];
if (isset($o['productExceptions'])) $this->productExceptions = JsonConverters::fromArray('ProductExceptionData', $o['productExceptions']);
if (isset($o['usesOwnSealNumbers'])) $this->usesOwnSealNumbers = $o['usesOwnSealNumbers'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->principalId)) $o['principalId'] = $this->principalId;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->authLetterFileUrl)) $o['authLetterFileUrl'] = JsonConverters::toArray('string', $this->authLetterFileUrl);
if (isset($this->logoImageUrl)) $o['logoImageUrl'] = $this->logoImageUrl;
if (isset($this->products)) $o['products'] = JsonConverters::toArray('ProductDataCategory', $this->products);
if (isset($this->upliftPrefix)) $o['upliftPrefix'] = $this->upliftPrefix;
if (isset($this->contactName)) $o['contactName'] = $this->contactName;
if (isset($this->contactNumber)) $o['contactNumber'] = $this->contactNumber;
if (isset($this->contactEmail)) $o['contactEmail'] = $this->contactEmail;
if (isset($this->allowProductLookup)) $o['allowProductLookup'] = $this->allowProductLookup;
if (isset($this->hasLogo)) $o['hasLogo'] = $this->hasLogo;
if (isset($this->hasAuthLetter)) $o['hasAuthLetter'] = $this->hasAuthLetter;
if (isset($this->sealNetWeightMandatory)) $o['sealNetWeightMandatory'] = $this->sealNetWeightMandatory;
if (isset($this->allowBillableSeals)) $o['allowBillableSeals'] = $this->allowBillableSeals;
if (isset($this->captureSerialNumber)) $o['captureSerialNumber'] = $this->captureSerialNumber;
if (isset($this->batchCodesMandatory)) $o['batchCodesMandatory'] = $this->batchCodesMandatory;
if (isset($this->captureManufactureAndExpiryDate)) $o['captureManufactureAndExpiryDate'] = $this->captureManufactureAndExpiryDate;
if (isset($this->productExceptions)) $o['productExceptions'] = JsonConverters::toArray('ProductExceptionData', $this->productExceptions);
if (isset($this->usesOwnSealNumbers)) $o['usesOwnSealNumbers'] = $this->usesOwnSealNumbers;
return empty($o) ? new class(){} : $o;
}
}
class GetPrincipalResponse extends ApiServiceResponse implements JsonSerializable
{
/**
* @param string $description
* @param string $heading
* @param bool|null $wasSuccessful
* @param ResponseStatus|null $responseStatus
*/
public function __construct(
string $description='',
string $heading='',
?bool $wasSuccessful=null,
?ResponseStatus $responseStatus=null,
/** @var PrincipalData|null */
public ?PrincipalData $data=null
) {
parent::__construct($description,$heading,$wasSuccessful,$responseStatus);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['data'])) $this->data = JsonConverters::from('PrincipalData', $o['data']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->data)) $o['data'] = JsonConverters::to('PrincipalData', $this->data);
return empty($o) ? new class(){} : $o;
}
}
class GetPrincipal extends ApiServiceRequest implements JsonSerializable
{
/**
* @param string $apiKey
* @param float $latitude
* @param float $longitude
*/
public function __construct(
string $apiKey='',
float $latitude=0.0,
float $longitude=0.0,
/** @var int */
public int $principalId=0
) {
parent::__construct($apiKey,$latitude,$longitude);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['principalId'])) $this->principalId = $o['principalId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->principalId)) $o['principalId'] = $this->principalId;
return empty($o) ? new class(){} : $o;
}
}
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>