| POST | /stock/orderDetail |
|---|
<?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 OrderDetailResponse 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 int */
public int $orderId=0,
/** @var string|null */
public ?string $operatorName=null,
/** @var string|null */
public ?string $driverName=null,
/** @var string|null */
public ?string $companyName=null,
/** @var string|null */
public ?string $licensePlate=null,
/** @var string|null */
public ?string $orderNumber=null,
/** @var string|null */
public ?string $destinationDepot=null,
/** @var bool|null */
public ?bool $canClose=null,
/** @var bool|null */
public ?bool $canScan=null,
/** @var int */
public int $estimatedSeals=0,
/** @var int */
public int $scannedSeals=0,
/** @var string|null */
public ?string $status=null
) {
parent::__construct($description,$heading,$wasSuccessful,$responseStatus);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['orderId'])) $this->orderId = $o['orderId'];
if (isset($o['operatorName'])) $this->operatorName = $o['operatorName'];
if (isset($o['driverName'])) $this->driverName = $o['driverName'];
if (isset($o['companyName'])) $this->companyName = $o['companyName'];
if (isset($o['licensePlate'])) $this->licensePlate = $o['licensePlate'];
if (isset($o['orderNumber'])) $this->orderNumber = $o['orderNumber'];
if (isset($o['destinationDepot'])) $this->destinationDepot = $o['destinationDepot'];
if (isset($o['canClose'])) $this->canClose = $o['canClose'];
if (isset($o['canScan'])) $this->canScan = $o['canScan'];
if (isset($o['estimatedSeals'])) $this->estimatedSeals = $o['estimatedSeals'];
if (isset($o['scannedSeals'])) $this->scannedSeals = $o['scannedSeals'];
if (isset($o['status'])) $this->status = $o['status'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->orderId)) $o['orderId'] = $this->orderId;
if (isset($this->operatorName)) $o['operatorName'] = $this->operatorName;
if (isset($this->driverName)) $o['driverName'] = $this->driverName;
if (isset($this->companyName)) $o['companyName'] = $this->companyName;
if (isset($this->licensePlate)) $o['licensePlate'] = $this->licensePlate;
if (isset($this->orderNumber)) $o['orderNumber'] = $this->orderNumber;
if (isset($this->destinationDepot)) $o['destinationDepot'] = $this->destinationDepot;
if (isset($this->canClose)) $o['canClose'] = $this->canClose;
if (isset($this->canScan)) $o['canScan'] = $this->canScan;
if (isset($this->estimatedSeals)) $o['estimatedSeals'] = $this->estimatedSeals;
if (isset($this->scannedSeals)) $o['scannedSeals'] = $this->scannedSeals;
if (isset($this->status)) $o['status'] = $this->status;
return empty($o) ? new class(){} : $o;
}
}
class OrderDetail 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 string|null */
public ?string $orderNumber=null,
/** @var bool|null */
public ?bool $forOperator=null
) {
parent::__construct($apiKey,$latitude,$longitude);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['orderNumber'])) $this->orderNumber = $o['orderNumber'];
if (isset($o['forOperator'])) $this->forOperator = $o['forOperator'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->orderNumber)) $o['orderNumber'] = $this->orderNumber;
if (isset($this->forOperator)) $o['forOperator'] = $this->forOperator;
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/orderDetail HTTP/1.1
Host: antel.api.dev.86degrees.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<OrderDetail 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>
<ForOperator>false</ForOperator>
<OrderNumber>String</OrderNumber>
</OrderDetail>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<OrderDetailResponse 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>
<CanClose>false</CanClose>
<CanScan>false</CanScan>
<CompanyName>String</CompanyName>
<DestinationDepot>String</DestinationDepot>
<DriverName>String</DriverName>
<EstimatedSeals>0</EstimatedSeals>
<LicensePlate>String</LicensePlate>
<OperatorName>String</OperatorName>
<OrderId>0</OrderId>
<OrderNumber>String</OrderNumber>
<ScannedSeals>0</ScannedSeals>
<Status>String</Status>
</OrderDetailResponse>