GET | /api/DeliveryTickets |
---|
<?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};
// @DataContract
class BaseRequest implements JsonSerializable
{
public function __construct(
/** @description This is your AIM API Key provided by Tri-Tech */
// @DataMember
// @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
/** @var string */
public string $ApiKey='',
// @DataMember
// @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
/** @var string|null */
public ?string $OAuthToken=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
if (isset($o['OAuthToken'])) $this->OAuthToken = $o['OAuthToken'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
if (isset($this->OAuthToken)) $o['OAuthToken'] = $this->OAuthToken;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BaseSecureRequest extends BaseRequest implements JsonSerializable
{
/**
* @param string $ApiKey
* @param string|null $OAuthToken
*/
public function __construct(
string $ApiKey='',
?string $OAuthToken=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header")
/** @var string|null */
public ?string $Token=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header")
/** @var string|null */
public ?string $DeviceId=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header")
/** @var string */
public string $AppId=''
) {
parent::__construct($ApiKey,$OAuthToken);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Token'])) $this->Token = $o['Token'];
if (isset($o['DeviceId'])) $this->DeviceId = $o['DeviceId'];
if (isset($o['AppId'])) $this->AppId = $o['AppId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Token)) $o['Token'] = $this->Token;
if (isset($this->DeviceId)) $o['DeviceId'] = $this->DeviceId;
if (isset($this->AppId)) $o['AppId'] = $this->AppId;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BaseResponseResult implements JsonSerializable
{
public function __construct(
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
/** @var string|null */
public ?string $StatusCode=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
/** @var string|null */
public ?string $Login=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
/** @var string|null */
public ?string $ErrorCode=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
/** @var string|null */
public ?string $ErrorDisplayText=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
/** @var string|null */
public ?string $ErrorMessage=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
/** @var string|null */
public ?string $DomainName=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
/** @var string|null */
public ?string $IpAddress=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['StatusCode'])) $this->StatusCode = $o['StatusCode'];
if (isset($o['Login'])) $this->Login = $o['Login'];
if (isset($o['ErrorCode'])) $this->ErrorCode = $o['ErrorCode'];
if (isset($o['ErrorDisplayText'])) $this->ErrorDisplayText = $o['ErrorDisplayText'];
if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
if (isset($o['DomainName'])) $this->DomainName = $o['DomainName'];
if (isset($o['IpAddress'])) $this->IpAddress = $o['IpAddress'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->StatusCode)) $o['StatusCode'] = $this->StatusCode;
if (isset($this->Login)) $o['Login'] = $this->Login;
if (isset($this->ErrorCode)) $o['ErrorCode'] = $this->ErrorCode;
if (isset($this->ErrorDisplayText)) $o['ErrorDisplayText'] = $this->ErrorDisplayText;
if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
if (isset($this->DomainName)) $o['DomainName'] = $this->DomainName;
if (isset($this->IpAddress)) $o['IpAddress'] = $this->IpAddress;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BaseResponse implements JsonSerializable
{
public function __construct(
/** @description */
// @DataMember
// @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
/** @var BaseResponseResult|null */
public ?BaseResponseResult $Status=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Status'])) $this->Status = JsonConverters::from('BaseResponseResult', $o['Status']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Status)) $o['Status'] = JsonConverters::to('BaseResponseResult', $this->Status);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class DependentAttribute implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $Attribute=null,
// @DataMember
/** @var string|null */
public ?string $AttributeValue=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Attribute'])) $this->Attribute = $o['Attribute'];
if (isset($o['AttributeValue'])) $this->AttributeValue = $o['AttributeValue'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Attribute)) $o['Attribute'] = $this->Attribute;
if (isset($this->AttributeValue)) $o['AttributeValue'] = $this->AttributeValue;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class Base64Image implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $Data=null,
// @DataMember
/** @var string|null */
public ?string $FileName=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Data'])) $this->Data = $o['Data'];
if (isset($o['FileName'])) $this->FileName = $o['FileName'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Data)) $o['Data'] = $this->Data;
if (isset($this->FileName)) $o['FileName'] = $this->FileName;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class DeliveryItem implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var float */
public float $Quantity=0.0,
// @DataMember
/** @var string|null */
public ?string $Item=null,
// @DataMember
/** @var string|null */
public ?string $Description=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
if (isset($o['Item'])) $this->Item = $o['Item'];
if (isset($o['Description'])) $this->Description = $o['Description'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
if (isset($this->Item)) $o['Item'] = $this->Item;
if (isset($this->Description)) $o['Description'] = $this->Description;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class DeliveryTicket implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $RefNumber=null,
// @DataMember
/** @var DateTime */
public DateTime $Date=new DateTime(),
// @DataMember
/** @var int */
public int $AccountNumber=0,
// @DataMember
/** @var string|null */
public ?string $Name=null,
// @DataMember
/** @var string|null */
public ?string $Address=null,
// @DataMember
/** @var string|null */
public ?string $Address2=null,
// @DataMember
/** @var string|null */
public ?string $City=null,
// @DataMember
/** @var string|null */
public ?string $State=null,
// @DataMember
/** @var string|null */
public ?string $ZipCode=null,
// @DataMember
/** @var string|null */
public ?string $Student=null,
// @DataMember
/** @var string|null */
public ?string $Contact=null,
// @DataMember
/** @var bool|null */
public ?bool $Delivered=null,
// @DataMember
/** @var string|null */
public ?string $District=null,
// @DataMember
/** @var string|null */
public ?string $School=null,
// @DataMember
/** @var string|null */
public ?string $DeliveryEmployee=null,
// @DataMember
/** @var string|null */
public ?string $TimeFrame=null,
// @DataMember
/** @var DateTime */
public DateTime $CreatedDate=new DateTime(),
// @DataMember
/** @var array<DependentAttribute>|null */
public ?array $DependentAttributes=null,
// @DataMember
/** @var string|null */
public ?string $TicketType=null,
// @DataMember
/** @var bool|null */
public ?bool $HasImages=null,
// @DataMember
/** @var bool|null */
public ?bool $HasSignature=null,
// @DataMember
/** @var string|null */
public ?string $Base64Signature=null,
// @DataMember
/** @var string|null */
public ?string $Notes=null,
// @DataMember
/** @var array<Base64Image>|null */
public ?array $Images=null,
// @DataMember
/** @var array<DeliveryItem>|null */
public ?array $DeliveryItems=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['RefNumber'])) $this->RefNumber = $o['RefNumber'];
if (isset($o['Date'])) $this->Date = JsonConverters::from('DateTime', $o['Date']);
if (isset($o['AccountNumber'])) $this->AccountNumber = $o['AccountNumber'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Address'])) $this->Address = $o['Address'];
if (isset($o['Address2'])) $this->Address2 = $o['Address2'];
if (isset($o['City'])) $this->City = $o['City'];
if (isset($o['State'])) $this->State = $o['State'];
if (isset($o['ZipCode'])) $this->ZipCode = $o['ZipCode'];
if (isset($o['Student'])) $this->Student = $o['Student'];
if (isset($o['Contact'])) $this->Contact = $o['Contact'];
if (isset($o['Delivered'])) $this->Delivered = $o['Delivered'];
if (isset($o['District'])) $this->District = $o['District'];
if (isset($o['School'])) $this->School = $o['School'];
if (isset($o['DeliveryEmployee'])) $this->DeliveryEmployee = $o['DeliveryEmployee'];
if (isset($o['TimeFrame'])) $this->TimeFrame = $o['TimeFrame'];
if (isset($o['CreatedDate'])) $this->CreatedDate = JsonConverters::from('DateTime', $o['CreatedDate']);
if (isset($o['DependentAttributes'])) $this->DependentAttributes = JsonConverters::fromArray('DependentAttribute', $o['DependentAttributes']);
if (isset($o['TicketType'])) $this->TicketType = $o['TicketType'];
if (isset($o['HasImages'])) $this->HasImages = $o['HasImages'];
if (isset($o['HasSignature'])) $this->HasSignature = $o['HasSignature'];
if (isset($o['Base64Signature'])) $this->Base64Signature = $o['Base64Signature'];
if (isset($o['Notes'])) $this->Notes = $o['Notes'];
if (isset($o['Images'])) $this->Images = JsonConverters::fromArray('Base64Image', $o['Images']);
if (isset($o['DeliveryItems'])) $this->DeliveryItems = JsonConverters::fromArray('DeliveryItem', $o['DeliveryItems']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->RefNumber)) $o['RefNumber'] = $this->RefNumber;
if (isset($this->Date)) $o['Date'] = JsonConverters::to('DateTime', $this->Date);
if (isset($this->AccountNumber)) $o['AccountNumber'] = $this->AccountNumber;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Address)) $o['Address'] = $this->Address;
if (isset($this->Address2)) $o['Address2'] = $this->Address2;
if (isset($this->City)) $o['City'] = $this->City;
if (isset($this->State)) $o['State'] = $this->State;
if (isset($this->ZipCode)) $o['ZipCode'] = $this->ZipCode;
if (isset($this->Student)) $o['Student'] = $this->Student;
if (isset($this->Contact)) $o['Contact'] = $this->Contact;
if (isset($this->Delivered)) $o['Delivered'] = $this->Delivered;
if (isset($this->District)) $o['District'] = $this->District;
if (isset($this->School)) $o['School'] = $this->School;
if (isset($this->DeliveryEmployee)) $o['DeliveryEmployee'] = $this->DeliveryEmployee;
if (isset($this->TimeFrame)) $o['TimeFrame'] = $this->TimeFrame;
if (isset($this->CreatedDate)) $o['CreatedDate'] = JsonConverters::to('DateTime', $this->CreatedDate);
if (isset($this->DependentAttributes)) $o['DependentAttributes'] = JsonConverters::toArray('DependentAttribute', $this->DependentAttributes);
if (isset($this->TicketType)) $o['TicketType'] = $this->TicketType;
if (isset($this->HasImages)) $o['HasImages'] = $this->HasImages;
if (isset($this->HasSignature)) $o['HasSignature'] = $this->HasSignature;
if (isset($this->Base64Signature)) $o['Base64Signature'] = $this->Base64Signature;
if (isset($this->Notes)) $o['Notes'] = $this->Notes;
if (isset($this->Images)) $o['Images'] = JsonConverters::toArray('Base64Image', $this->Images);
if (isset($this->DeliveryItems)) $o['DeliveryItems'] = JsonConverters::toArray('DeliveryItem', $this->DeliveryItems);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class DeliveryTicketsResponse extends BaseResponse implements JsonSerializable
{
/**
* @param BaseResponseResult|null $Status
*/
public function __construct(
?BaseResponseResult $Status=null,
// @DataMember
/** @var array<DeliveryTicket>|null */
public ?array $Tickets=null
) {
parent::__construct($Status);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Tickets'])) $this->Tickets = JsonConverters::fromArray('DeliveryTicket', $o['Tickets']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Tickets)) $o['Tickets'] = JsonConverters::toArray('DeliveryTicket', $this->Tickets);
return empty($o) ? new class(){} : $o;
}
}
/** @description DeliveryTicketsRequires active-e 3rd Party E-Commerce or active-e Vortx E-Commerce. */
// @DataContract
class DeliveryTicketsRequest extends BaseSecureRequest implements JsonSerializable
{
/**
* @param string $ApiKey
* @param string|null $OAuthToken
* @param string|null $Token
* @param string|null $DeviceId
* @param string $AppId
*/
public function __construct(
string $ApiKey='',
?string $OAuthToken=null,
?string $Token=null,
?string $DeviceId=null,
string $AppId='',
// @DataMember
/** @var DateTime|null */
public ?DateTime $DateFrom=null,
// @DataMember
/** @var DateTime|null */
public ?DateTime $DateTo=null,
// @DataMember
/** @var string|null */
public ?string $District=null,
// @DataMember
/** @var string|null */
public ?string $School=null,
// @DataMember
/** @var int|null */
public ?int $LocationId=null,
/** @description Type of Ticket. Valid types are Service Ticket, Sales Invoice, Layaway, Loaner, Short Term Rental, Contract, Delayed Delivery, and Approval */
// @DataMember
// @ApiMember(DataType="string", Description="Type of Ticket. Valid types are Service Ticket, Sales Invoice, Layaway, Loaner, Short Term Rental, Contract, Delayed Delivery, and Approval", IsRequired=true, Name="TicketType", ParameterType="query")
/** @var string */
public string $TicketType='',
// @DataMember
/** @var string|null */
public ?string $EmployeeLanId=null,
// @DataMember
/** @var string|null */
public ?string $DeliveryEmployeeLanId=null,
// @DataMember
/** @var string|null */
public ?string $RefNumber=null,
// @DataMember
/** @var bool|null */
public ?bool $IncludeItems=null
) {
parent::__construct($ApiKey,$OAuthToken,$Token,$DeviceId,$AppId);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['DateFrom'])) $this->DateFrom = JsonConverters::from('DateTime', $o['DateFrom']);
if (isset($o['DateTo'])) $this->DateTo = JsonConverters::from('DateTime', $o['DateTo']);
if (isset($o['District'])) $this->District = $o['District'];
if (isset($o['School'])) $this->School = $o['School'];
if (isset($o['LocationId'])) $this->LocationId = $o['LocationId'];
if (isset($o['TicketType'])) $this->TicketType = $o['TicketType'];
if (isset($o['EmployeeLanId'])) $this->EmployeeLanId = $o['EmployeeLanId'];
if (isset($o['DeliveryEmployeeLanId'])) $this->DeliveryEmployeeLanId = $o['DeliveryEmployeeLanId'];
if (isset($o['RefNumber'])) $this->RefNumber = $o['RefNumber'];
if (isset($o['IncludeItems'])) $this->IncludeItems = $o['IncludeItems'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->DateFrom)) $o['DateFrom'] = JsonConverters::to('DateTime', $this->DateFrom);
if (isset($this->DateTo)) $o['DateTo'] = JsonConverters::to('DateTime', $this->DateTo);
if (isset($this->District)) $o['District'] = $this->District;
if (isset($this->School)) $o['School'] = $this->School;
if (isset($this->LocationId)) $o['LocationId'] = $this->LocationId;
if (isset($this->TicketType)) $o['TicketType'] = $this->TicketType;
if (isset($this->EmployeeLanId)) $o['EmployeeLanId'] = $this->EmployeeLanId;
if (isset($this->DeliveryEmployeeLanId)) $o['DeliveryEmployeeLanId'] = $this->DeliveryEmployeeLanId;
if (isset($this->RefNumber)) $o['RefNumber'] = $this->RefNumber;
if (isset($this->IncludeItems)) $o['IncludeItems'] = $this->IncludeItems;
return empty($o) ? new class(){} : $o;
}
}
PHP DeliveryTicketsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/DeliveryTickets HTTP/1.1 Host: active-ewebservice.biz Accept: application/json
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Tickets":[{"RefNumber":"String","AccountNumber":0,"Name":"String","Address":"String","Address2":"String","City":"String","State":"String","ZipCode":"String","Student":"String","Contact":"String","Delivered":false,"District":"String","School":"String","DeliveryEmployee":"String","TimeFrame":"String","DependentAttributes":[{"Attribute":"String","AttributeValue":"String"}],"TicketType":"String","HasImages":false,"HasSignature":false,"Base64Signature":"String","Notes":"String","Images":[{"Data":"String","FileName":"String"}],"DeliveryItems":[{"Quantity":0,"Item":"String","Description":"String"}]}],"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}