| POST | /stock/seal/details |
|---|
<?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 FileDataItem implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $fileName=null,
/** @var string|null */
public ?string $fileUrl=null,
/** @var string|null */
public ?string $thumbnailUrl=null,
/** @var string */
public string $fileId='',
/** @var string */
public string $thumbnailId='',
/** @var int */
public int $linkId=0,
/** @var DateTime */
public DateTime $createdDate=new DateTime()
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['fileName'])) $this->fileName = $o['fileName'];
if (isset($o['fileUrl'])) $this->fileUrl = $o['fileUrl'];
if (isset($o['thumbnailUrl'])) $this->thumbnailUrl = $o['thumbnailUrl'];
if (isset($o['fileId'])) $this->fileId = $o['fileId'];
if (isset($o['thumbnailId'])) $this->thumbnailId = $o['thumbnailId'];
if (isset($o['linkId'])) $this->linkId = $o['linkId'];
if (isset($o['createdDate'])) $this->createdDate = JsonConverters::from('DateTime', $o['createdDate']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->fileName)) $o['fileName'] = $this->fileName;
if (isset($this->fileUrl)) $o['fileUrl'] = $this->fileUrl;
if (isset($this->thumbnailUrl)) $o['thumbnailUrl'] = $this->thumbnailUrl;
if (isset($this->fileId)) $o['fileId'] = $this->fileId;
if (isset($this->thumbnailId)) $o['thumbnailId'] = $this->thumbnailId;
if (isset($this->linkId)) $o['linkId'] = $this->linkId;
if (isset($this->createdDate)) $o['createdDate'] = JsonConverters::to('DateTime', $this->createdDate);
return empty($o) ? new class(){} : $o;
}
}
class SealOrderHistoryItem implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $createdDate=null,
/** @var int */
public int $orderId=0,
/** @var string|null */
public ?string $orderNumber=null,
/** @var string|null */
public ?string $orderRequestingOperator=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['createdDate'])) $this->createdDate = $o['createdDate'];
if (isset($o['orderId'])) $this->orderId = $o['orderId'];
if (isset($o['orderNumber'])) $this->orderNumber = $o['orderNumber'];
if (isset($o['orderRequestingOperator'])) $this->orderRequestingOperator = $o['orderRequestingOperator'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->createdDate)) $o['createdDate'] = $this->createdDate;
if (isset($this->orderId)) $o['orderId'] = $this->orderId;
if (isset($this->orderNumber)) $o['orderNumber'] = $this->orderNumber;
if (isset($this->orderRequestingOperator)) $o['orderRequestingOperator'] = $this->orderRequestingOperator;
return empty($o) ? new class(){} : $o;
}
}
class SealMovementHistoryItem implements JsonSerializable
{
public function __construct(
/** @var int */
public int $id=0,
/** @var string|null */
public ?string $eventDateTime=null,
/** @var string|null */
public ?string $actionUserName=null,
/** @var string|null */
public ?string $scannedDepotName=null,
/** @var string|null */
public ?string $assignedBucketName=null,
/** @var string|null */
public ?string $assignedOrderNumber=null,
/** @var string|null */
public ?string $assignedOperatorName=null,
/** @var string|null */
public ?string $orderDriverName=null,
/** @var string|null */
public ?string $orderDriverCompanyName=null,
/** @var string|null */
public ?string $orderDriverLicensePlate=null,
/** @var float */
public float $targetWeight=0.0,
/** @var float */
public float $currentWeight=0.0,
/** @var bool|null */
public ?bool $hadWeightIssue=null,
/** @var bool|null */
public ?bool $hadUnknownUplift=null,
/** @var bool|null */
public ?bool $wasPaused=null,
/** @var bool|null */
public ?bool $pausedWasAwaitingAuth=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['eventDateTime'])) $this->eventDateTime = $o['eventDateTime'];
if (isset($o['actionUserName'])) $this->actionUserName = $o['actionUserName'];
if (isset($o['scannedDepotName'])) $this->scannedDepotName = $o['scannedDepotName'];
if (isset($o['assignedBucketName'])) $this->assignedBucketName = $o['assignedBucketName'];
if (isset($o['assignedOrderNumber'])) $this->assignedOrderNumber = $o['assignedOrderNumber'];
if (isset($o['assignedOperatorName'])) $this->assignedOperatorName = $o['assignedOperatorName'];
if (isset($o['orderDriverName'])) $this->orderDriverName = $o['orderDriverName'];
if (isset($o['orderDriverCompanyName'])) $this->orderDriverCompanyName = $o['orderDriverCompanyName'];
if (isset($o['orderDriverLicensePlate'])) $this->orderDriverLicensePlate = $o['orderDriverLicensePlate'];
if (isset($o['targetWeight'])) $this->targetWeight = $o['targetWeight'];
if (isset($o['currentWeight'])) $this->currentWeight = $o['currentWeight'];
if (isset($o['hadWeightIssue'])) $this->hadWeightIssue = $o['hadWeightIssue'];
if (isset($o['hadUnknownUplift'])) $this->hadUnknownUplift = $o['hadUnknownUplift'];
if (isset($o['wasPaused'])) $this->wasPaused = $o['wasPaused'];
if (isset($o['pausedWasAwaitingAuth'])) $this->pausedWasAwaitingAuth = $o['pausedWasAwaitingAuth'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->eventDateTime)) $o['eventDateTime'] = $this->eventDateTime;
if (isset($this->actionUserName)) $o['actionUserName'] = $this->actionUserName;
if (isset($this->scannedDepotName)) $o['scannedDepotName'] = $this->scannedDepotName;
if (isset($this->assignedBucketName)) $o['assignedBucketName'] = $this->assignedBucketName;
if (isset($this->assignedOrderNumber)) $o['assignedOrderNumber'] = $this->assignedOrderNumber;
if (isset($this->assignedOperatorName)) $o['assignedOperatorName'] = $this->assignedOperatorName;
if (isset($this->orderDriverName)) $o['orderDriverName'] = $this->orderDriverName;
if (isset($this->orderDriverCompanyName)) $o['orderDriverCompanyName'] = $this->orderDriverCompanyName;
if (isset($this->orderDriverLicensePlate)) $o['orderDriverLicensePlate'] = $this->orderDriverLicensePlate;
if (isset($this->targetWeight)) $o['targetWeight'] = $this->targetWeight;
if (isset($this->currentWeight)) $o['currentWeight'] = $this->currentWeight;
if (isset($this->hadWeightIssue)) $o['hadWeightIssue'] = $this->hadWeightIssue;
if (isset($this->hadUnknownUplift)) $o['hadUnknownUplift'] = $this->hadUnknownUplift;
if (isset($this->wasPaused)) $o['wasPaused'] = $this->wasPaused;
if (isset($this->pausedWasAwaitingAuth)) $o['pausedWasAwaitingAuth'] = $this->pausedWasAwaitingAuth;
return empty($o) ? new class(){} : $o;
}
}
class SealDetailsResponse 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 string|null */
public ?string $principalName=null,
/** @var string|null */
public ?string $upliftNumber=null,
/** @var string|null */
public ?string $operatorName=null,
/** @var string|null */
public ?string $outletName=null,
/** @var string|null */
public ?string $upliftDate=null,
/** @var string|null */
public ?string $sealNumber=null,
/** @var string|null */
public ?string $currentWeight=null,
/** @var string|null */
public ?string $targetWeight=null,
/** @var bool|null */
public ?bool $hasWeightIssue=null,
/** @var string|null */
public ?string $bucketName=null,
/** @var array<string>|null */
public ?array $claimNumbers=null,
/** @var string|null */
public ?string $joinedClaimNumbers=null,
/** @var array<FileDataItem>|null */
public ?array $sealImages=null,
/** @var array<SealOrderHistoryItem>|null */
public ?array $orderHistory=null,
/** @var array<SealMovementHistoryItem>|null */
public ?array $movementHistory=null
) {
parent::__construct($description,$heading,$wasSuccessful,$responseStatus);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['principalName'])) $this->principalName = $o['principalName'];
if (isset($o['upliftNumber'])) $this->upliftNumber = $o['upliftNumber'];
if (isset($o['operatorName'])) $this->operatorName = $o['operatorName'];
if (isset($o['outletName'])) $this->outletName = $o['outletName'];
if (isset($o['upliftDate'])) $this->upliftDate = $o['upliftDate'];
if (isset($o['sealNumber'])) $this->sealNumber = $o['sealNumber'];
if (isset($o['currentWeight'])) $this->currentWeight = $o['currentWeight'];
if (isset($o['targetWeight'])) $this->targetWeight = $o['targetWeight'];
if (isset($o['hasWeightIssue'])) $this->hasWeightIssue = $o['hasWeightIssue'];
if (isset($o['bucketName'])) $this->bucketName = $o['bucketName'];
if (isset($o['claimNumbers'])) $this->claimNumbers = JsonConverters::fromArray('string', $o['claimNumbers']);
if (isset($o['joinedClaimNumbers'])) $this->joinedClaimNumbers = $o['joinedClaimNumbers'];
if (isset($o['sealImages'])) $this->sealImages = JsonConverters::fromArray('FileDataItem', $o['sealImages']);
if (isset($o['orderHistory'])) $this->orderHistory = JsonConverters::fromArray('SealOrderHistoryItem', $o['orderHistory']);
if (isset($o['movementHistory'])) $this->movementHistory = JsonConverters::fromArray('SealMovementHistoryItem', $o['movementHistory']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->principalName)) $o['principalName'] = $this->principalName;
if (isset($this->upliftNumber)) $o['upliftNumber'] = $this->upliftNumber;
if (isset($this->operatorName)) $o['operatorName'] = $this->operatorName;
if (isset($this->outletName)) $o['outletName'] = $this->outletName;
if (isset($this->upliftDate)) $o['upliftDate'] = $this->upliftDate;
if (isset($this->sealNumber)) $o['sealNumber'] = $this->sealNumber;
if (isset($this->currentWeight)) $o['currentWeight'] = $this->currentWeight;
if (isset($this->targetWeight)) $o['targetWeight'] = $this->targetWeight;
if (isset($this->hasWeightIssue)) $o['hasWeightIssue'] = $this->hasWeightIssue;
if (isset($this->bucketName)) $o['bucketName'] = $this->bucketName;
if (isset($this->claimNumbers)) $o['claimNumbers'] = JsonConverters::toArray('string', $this->claimNumbers);
if (isset($this->joinedClaimNumbers)) $o['joinedClaimNumbers'] = $this->joinedClaimNumbers;
if (isset($this->sealImages)) $o['sealImages'] = JsonConverters::toArray('FileDataItem', $this->sealImages);
if (isset($this->orderHistory)) $o['orderHistory'] = JsonConverters::toArray('SealOrderHistoryItem', $this->orderHistory);
if (isset($this->movementHistory)) $o['movementHistory'] = JsonConverters::toArray('SealMovementHistoryItem', $this->movementHistory);
return empty($o) ? new class(){} : $o;
}
}
class SealDetailsRequest 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 $sealId=0
) {
parent::__construct($apiKey,$latitude,$longitude);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['sealId'])) $this->sealId = $o['sealId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->sealId)) $o['sealId'] = $this->sealId;
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.
POST /stock/seal/details HTTP/1.1
Host: antel.api.dev.86degrees.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SealDetailsRequest 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>
<SealId>0</SealId>
</SealDetailsRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<SealDetailsResponse 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>
<BucketName>String</BucketName>
<ClaimNumbers xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</ClaimNumbers>
<CurrentWeight>String</CurrentWeight>
<HasWeightIssue>false</HasWeightIssue>
<MovementHistory>
<SealMovementHistoryItem>
<ActionUserName>String</ActionUserName>
<AssignedBucketName>String</AssignedBucketName>
<AssignedOperatorName>String</AssignedOperatorName>
<AssignedOrderNumber>String</AssignedOrderNumber>
<CurrentWeight>0</CurrentWeight>
<EventDateTime>String</EventDateTime>
<HadUnknownUplift>false</HadUnknownUplift>
<HadWeightIssue>false</HadWeightIssue>
<Id>0</Id>
<OrderDriverCompanyName>String</OrderDriverCompanyName>
<OrderDriverLicensePlate>String</OrderDriverLicensePlate>
<OrderDriverName>String</OrderDriverName>
<PausedWasAwaitingAuth>false</PausedWasAwaitingAuth>
<ScannedDepotName>String</ScannedDepotName>
<TargetWeight>0</TargetWeight>
<WasPaused>false</WasPaused>
</SealMovementHistoryItem>
</MovementHistory>
<OperatorName>String</OperatorName>
<OrderHistory>
<SealOrderHistoryItem>
<CreatedDate>String</CreatedDate>
<OrderId>0</OrderId>
<OrderNumber>String</OrderNumber>
<OrderRequestingOperator>String</OrderRequestingOperator>
</SealOrderHistoryItem>
</OrderHistory>
<OutletName>String</OutletName>
<PrincipalName>String</PrincipalName>
<SealImages xmlns:d2p1="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">
<d2p1:FileDataItem>
<d2p1:CreatedDate>0001-01-01T00:00:00</d2p1:CreatedDate>
<d2p1:FileId>00000000-0000-0000-0000-000000000000</d2p1:FileId>
<d2p1:FileName>String</d2p1:FileName>
<d2p1:FileUrl>String</d2p1:FileUrl>
<d2p1:LinkId>0</d2p1:LinkId>
<d2p1:ThumbnailId>00000000-0000-0000-0000-000000000000</d2p1:ThumbnailId>
<d2p1:ThumbnailUrl>String</d2p1:ThumbnailUrl>
</d2p1:FileDataItem>
</SealImages>
<SealNumber>String</SealNumber>
<TargetWeight>String</TargetWeight>
<UpliftDate>String</UpliftDate>
<UpliftNumber>String</UpliftNumber>
</SealDetailsResponse>