Trendsic Platform Service

<back to all web services

ContainersRequest

Requires Authentication
The following routes are available for this service:
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;
    }
}

PHP ContainersRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

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: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Containers":[{"ContainerId":0,"Barcode":"String","Kind":"String","Icon":"String","Name":"String","ZoneKey":"String","Slot":"String","Status":"String","CheckoutJson":"String","Items":[{"Id":"String","Name":"String","Flag":"String","Warn":false}]}]}