Trendsic Platform Service

<back to all web services

ImagingBatchesRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/records/imaging/batches
<?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 ImagingBatchDto implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $BatchId=0,
        /** @var string|null */
        public ?string $BatchKey=null,
        /** @var string|null */
        public ?string $Title=null,
        /** @var string|null */
        public ?string $CreatedByLbl=null,
        /** @var string|null */
        public ?string $CreatedLabel=null,
        /** @var string|null */
        public ?string $Stage=null,
        /** @var string|null */
        public ?string $Dpi=null,
        /** @var string|null */
        public ?string $Color=null,
        /** @var bool|null */
        public ?bool $DestroyAfter=null,
        /** @var string|null */
        public ?string $ContainersJson=null,
        /** @var string|null */
        public ?string $QaJson=null,
        /** @var string|null */
        public ?string $ImportReceipt=null,
        /** @var string|null */
        public ?string $LogJson=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['BatchId'])) $this->BatchId = $o['BatchId'];
        if (isset($o['BatchKey'])) $this->BatchKey = $o['BatchKey'];
        if (isset($o['Title'])) $this->Title = $o['Title'];
        if (isset($o['CreatedByLbl'])) $this->CreatedByLbl = $o['CreatedByLbl'];
        if (isset($o['CreatedLabel'])) $this->CreatedLabel = $o['CreatedLabel'];
        if (isset($o['Stage'])) $this->Stage = $o['Stage'];
        if (isset($o['Dpi'])) $this->Dpi = $o['Dpi'];
        if (isset($o['Color'])) $this->Color = $o['Color'];
        if (isset($o['DestroyAfter'])) $this->DestroyAfter = $o['DestroyAfter'];
        if (isset($o['ContainersJson'])) $this->ContainersJson = $o['ContainersJson'];
        if (isset($o['QaJson'])) $this->QaJson = $o['QaJson'];
        if (isset($o['ImportReceipt'])) $this->ImportReceipt = $o['ImportReceipt'];
        if (isset($o['LogJson'])) $this->LogJson = $o['LogJson'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->BatchId)) $o['BatchId'] = $this->BatchId;
        if (isset($this->BatchKey)) $o['BatchKey'] = $this->BatchKey;
        if (isset($this->Title)) $o['Title'] = $this->Title;
        if (isset($this->CreatedByLbl)) $o['CreatedByLbl'] = $this->CreatedByLbl;
        if (isset($this->CreatedLabel)) $o['CreatedLabel'] = $this->CreatedLabel;
        if (isset($this->Stage)) $o['Stage'] = $this->Stage;
        if (isset($this->Dpi)) $o['Dpi'] = $this->Dpi;
        if (isset($this->Color)) $o['Color'] = $this->Color;
        if (isset($this->DestroyAfter)) $o['DestroyAfter'] = $this->DestroyAfter;
        if (isset($this->ContainersJson)) $o['ContainersJson'] = $this->ContainersJson;
        if (isset($this->QaJson)) $o['QaJson'] = $this->QaJson;
        if (isset($this->ImportReceipt)) $o['ImportReceipt'] = $this->ImportReceipt;
        if (isset($this->LogJson)) $o['LogJson'] = $this->LogJson;
        return empty($o) ? new class(){} : $o;
    }
}

class ImagingBatchesResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<ImagingBatchDto>|null */
        public ?array $Batches=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
        if (isset($o['Batches'])) $this->Batches = JsonConverters::fromArray('ImagingBatchDto', $o['Batches']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        if (isset($this->Batches)) $o['Batches'] = JsonConverters::toArray('ImagingBatchDto', $this->Batches);
        return empty($o) ? new class(){} : $o;
    }
}

class ImagingBatchesRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP ImagingBatchesRequest DTOs

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

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/records/imaging/batches HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Batches: 
	[
		{
			BatchId: 0,
			BatchKey: String,
			Title: String,
			CreatedByLbl: String,
			CreatedLabel: String,
			Stage: String,
			Dpi: String,
			Color: String,
			DestroyAfter: False,
			ContainersJson: String,
			QaJson: String,
			ImportReceipt: String,
			LogJson: String
		}
	]
}