| GET,OPTIONS | /v1/worker/visit/{WorkerScheduleItemID}/checklist |
|---|
<?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 VisitChecklistItem implements JsonSerializable
{
public function __construct(
/** @var int */
public int $VisitChecklistItemID=0,
/** @var int */
public int $AgreementJobID=0,
/** @var int|null */
public ?int $ServiceTaskID=null,
/** @var string|null */
public ?string $Name=null,
/** @var int */
public int $Status=0,
/** @var string|null */
public ?string $Note=null,
/** @var string|null */
public ?string $QaResult=null,
/** @var int|null */
public ?int $AttachmentId=null,
/** @var string|null */
public ?string $CompletedBy=null,
/** @var DateTime|null */
public ?DateTime $CompletedAt=null,
/** @var int */
public int $SortOrder=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['VisitChecklistItemID'])) $this->VisitChecklistItemID = $o['VisitChecklistItemID'];
if (isset($o['AgreementJobID'])) $this->AgreementJobID = $o['AgreementJobID'];
if (isset($o['ServiceTaskID'])) $this->ServiceTaskID = $o['ServiceTaskID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['Note'])) $this->Note = $o['Note'];
if (isset($o['QaResult'])) $this->QaResult = $o['QaResult'];
if (isset($o['AttachmentId'])) $this->AttachmentId = $o['AttachmentId'];
if (isset($o['CompletedBy'])) $this->CompletedBy = $o['CompletedBy'];
if (isset($o['CompletedAt'])) $this->CompletedAt = JsonConverters::from('DateTime', $o['CompletedAt']);
if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->VisitChecklistItemID)) $o['VisitChecklistItemID'] = $this->VisitChecklistItemID;
if (isset($this->AgreementJobID)) $o['AgreementJobID'] = $this->AgreementJobID;
if (isset($this->ServiceTaskID)) $o['ServiceTaskID'] = $this->ServiceTaskID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->Note)) $o['Note'] = $this->Note;
if (isset($this->QaResult)) $o['QaResult'] = $this->QaResult;
if (isset($this->AttachmentId)) $o['AttachmentId'] = $this->AttachmentId;
if (isset($this->CompletedBy)) $o['CompletedBy'] = $this->CompletedBy;
if (isset($this->CompletedAt)) $o['CompletedAt'] = JsonConverters::to('DateTime', $this->CompletedAt);
if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
return empty($o) ? new class(){} : $o;
}
}
class VisitChecklistResponse implements JsonSerializable
{
public function __construct(
/** @var array<VisitChecklistItem>|null */
public ?array $Items=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('VisitChecklistItem', $o['Items']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Items)) $o['Items'] = JsonConverters::toArray('VisitChecklistItem', $this->Items);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class WorkerVisitChecklistRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $WorkerScheduleItemID=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['WorkerScheduleItemID'])) $this->WorkerScheduleItemID = $o['WorkerScheduleItemID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->WorkerScheduleItemID)) $o['WorkerScheduleItemID'] = $this->WorkerScheduleItemID;
return empty($o) ? new class(){} : $o;
}
}
PHP WorkerVisitChecklistRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/worker/visit/{WorkerScheduleItemID}/checklist HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
Items:
[
{
VisitChecklistItemID: 0,
AgreementJobID: 0,
ServiceTaskID: 0,
Name: String,
Status: 0,
Note: String,
QaResult: String,
AttachmentId: 0,
CompletedBy: String,
CompletedAt: 0001-01-01,
SortOrder: 0
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}