| GET,OPTIONS | /v1/records/warehouse/containers |
|---|
<?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 ContainerItemDto implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Id=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Flag=null,
/** @var bool|null */
public ?bool $Warn=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Id'])) $this->Id = $o['Id'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Flag'])) $this->Flag = $o['Flag'];
if (isset($o['Warn'])) $this->Warn = $o['Warn'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Id)) $o['Id'] = $this->Id;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Flag)) $o['Flag'] = $this->Flag;
if (isset($this->Warn)) $o['Warn'] = $this->Warn;
return empty($o) ? new class(){} : $o;
}
}
class RecordContainerDto implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ContainerId=0,
/** @var string|null */
public ?string $Barcode=null,
/** @var string|null */
public ?string $Kind=null,
/** @var string|null */
public ?string $Icon=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $ZoneKey=null,
/** @var string|null */
public ?string $Slot=null,
/** @var string|null */
public ?string $Status=null,
/** @var string|null */
public ?string $CheckoutJson=null,
/** @var array<ContainerItemDto>|null */
public ?array $Items=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ContainerId'])) $this->ContainerId = $o['ContainerId'];
if (isset($o['Barcode'])) $this->Barcode = $o['Barcode'];
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['Icon'])) $this->Icon = $o['Icon'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['ZoneKey'])) $this->ZoneKey = $o['ZoneKey'];
if (isset($o['Slot'])) $this->Slot = $o['Slot'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['CheckoutJson'])) $this->CheckoutJson = $o['CheckoutJson'];
if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('ContainerItemDto', $o['Items']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ContainerId)) $o['ContainerId'] = $this->ContainerId;
if (isset($this->Barcode)) $o['Barcode'] = $this->Barcode;
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->Icon)) $o['Icon'] = $this->Icon;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->ZoneKey)) $o['ZoneKey'] = $this->ZoneKey;
if (isset($this->Slot)) $o['Slot'] = $this->Slot;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->CheckoutJson)) $o['CheckoutJson'] = $this->CheckoutJson;
if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('ContainerItemDto', $this->Items);
return empty($o) ? new class(){} : $o;
}
}
class ContainersResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<RecordContainerDto>|null */
public ?array $Containers=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Containers'])) $this->Containers = JsonConverters::fromArray('RecordContainerDto', $o['Containers']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Containers)) $o['Containers'] = JsonConverters::toArray('RecordContainerDto', $this->Containers);
return empty($o) ? new class(){} : $o;
}
}
class ContainersRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
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 /v1/records/warehouse/containers HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<ContainersResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Containers>
<RecordContainerDto>
<Barcode>String</Barcode>
<CheckoutJson>String</CheckoutJson>
<ContainerId>0</ContainerId>
<Icon>String</Icon>
<Items>
<ContainerItemDto>
<Flag>String</Flag>
<Id>String</Id>
<Name>String</Name>
<Warn>false</Warn>
</ContainerItemDto>
</Items>
<Kind>String</Kind>
<Name>String</Name>
<Slot>String</Slot>
<Status>String</Status>
<ZoneKey>String</ZoneKey>
</RecordContainerDto>
</Containers>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<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>
</ContainersResponse>