Trendsic Platform Service

<back to all web services

VisitChecklistRequest

Requires Authentication
The following routes are available for this service:
GET/v1/visit/{AgreementJobID}/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 VisitChecklistRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $AgreementJobID=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AgreementJobID'])) $this->AgreementJobID = $o['AgreementJobID'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AgreementJobID)) $o['AgreementJobID'] = $this->AgreementJobID;
        return empty($o) ? new class(){} : $o;
    }
}

PHP VisitChecklistRequest 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/visit/{AgreementJobID}/checklist HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
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-01T00:00:00.0000000","SortOrder":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}