Trendsic Platform Service

<back to all web services

CheckinTimelineRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/customercheckins/{Id}/timeline
<?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 SvcVisitRow implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $CheckinId='',
        /** @var string|null */
        public ?string $TicketLabel=null,
        /** @var DateTime */
        public DateTime $LocalDate=new DateTime(),
        /** @var string */
        public string $LineId='',
        /** @var string|null */
        public ?string $ServiceName=null,
        /** @var string|null */
        public ?string $StationId=null,
        /** @var string|null */
        public ?string $StationName=null,
        /** @var string|null */
        public ?string $EmployeeId=null,
        /** @var string|null */
        public ?string $EmployeeName=null,
        /** @var string|null */
        public ?string $CustomerName=null,
        /** @var int|null */
        public ?int $ContactId=null,
        /** @var int|null */
        public ?int $ContactAgentId=null,
        /** @var string */
        public string $CustomerId='',
        /** @var bool|null */
        public ?bool $IsAppointment=null,
        /** @var DateTime|null */
        public ?DateTime $LocalHere=null,
        /** @var DateTime|null */
        public ?DateTime $LocalCalled=null,
        /** @var DateTime|null */
        public ?DateTime $LocalStart=null,
        /** @var DateTime|null */
        public ?DateTime $LocalEnd=null,
        /** @var int|null */
        public ?int $WaitSec=null,
        /** @var int|null */
        public ?int $ServeSec=null,
        /** @var string|null */
        public ?string $Outcome=null,
        /** @var float|null */
        public ?float $Fee=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CheckinId'])) $this->CheckinId = $o['CheckinId'];
        if (isset($o['TicketLabel'])) $this->TicketLabel = $o['TicketLabel'];
        if (isset($o['LocalDate'])) $this->LocalDate = JsonConverters::from('DateTime', $o['LocalDate']);
        if (isset($o['LineId'])) $this->LineId = $o['LineId'];
        if (isset($o['ServiceName'])) $this->ServiceName = $o['ServiceName'];
        if (isset($o['StationId'])) $this->StationId = $o['StationId'];
        if (isset($o['StationName'])) $this->StationName = $o['StationName'];
        if (isset($o['EmployeeId'])) $this->EmployeeId = $o['EmployeeId'];
        if (isset($o['EmployeeName'])) $this->EmployeeName = $o['EmployeeName'];
        if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['ContactAgentId'])) $this->ContactAgentId = $o['ContactAgentId'];
        if (isset($o['CustomerId'])) $this->CustomerId = $o['CustomerId'];
        if (isset($o['IsAppointment'])) $this->IsAppointment = $o['IsAppointment'];
        if (isset($o['LocalHere'])) $this->LocalHere = JsonConverters::from('DateTime', $o['LocalHere']);
        if (isset($o['LocalCalled'])) $this->LocalCalled = JsonConverters::from('DateTime', $o['LocalCalled']);
        if (isset($o['LocalStart'])) $this->LocalStart = JsonConverters::from('DateTime', $o['LocalStart']);
        if (isset($o['LocalEnd'])) $this->LocalEnd = JsonConverters::from('DateTime', $o['LocalEnd']);
        if (isset($o['WaitSec'])) $this->WaitSec = $o['WaitSec'];
        if (isset($o['ServeSec'])) $this->ServeSec = $o['ServeSec'];
        if (isset($o['Outcome'])) $this->Outcome = $o['Outcome'];
        if (isset($o['Fee'])) $this->Fee = $o['Fee'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CheckinId)) $o['CheckinId'] = $this->CheckinId;
        if (isset($this->TicketLabel)) $o['TicketLabel'] = $this->TicketLabel;
        if (isset($this->LocalDate)) $o['LocalDate'] = JsonConverters::to('DateTime', $this->LocalDate);
        if (isset($this->LineId)) $o['LineId'] = $this->LineId;
        if (isset($this->ServiceName)) $o['ServiceName'] = $this->ServiceName;
        if (isset($this->StationId)) $o['StationId'] = $this->StationId;
        if (isset($this->StationName)) $o['StationName'] = $this->StationName;
        if (isset($this->EmployeeId)) $o['EmployeeId'] = $this->EmployeeId;
        if (isset($this->EmployeeName)) $o['EmployeeName'] = $this->EmployeeName;
        if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->ContactAgentId)) $o['ContactAgentId'] = $this->ContactAgentId;
        if (isset($this->CustomerId)) $o['CustomerId'] = $this->CustomerId;
        if (isset($this->IsAppointment)) $o['IsAppointment'] = $this->IsAppointment;
        if (isset($this->LocalHere)) $o['LocalHere'] = JsonConverters::to('DateTime', $this->LocalHere);
        if (isset($this->LocalCalled)) $o['LocalCalled'] = JsonConverters::to('DateTime', $this->LocalCalled);
        if (isset($this->LocalStart)) $o['LocalStart'] = JsonConverters::to('DateTime', $this->LocalStart);
        if (isset($this->LocalEnd)) $o['LocalEnd'] = JsonConverters::to('DateTime', $this->LocalEnd);
        if (isset($this->WaitSec)) $o['WaitSec'] = $this->WaitSec;
        if (isset($this->ServeSec)) $o['ServeSec'] = $this->ServeSec;
        if (isset($this->Outcome)) $o['Outcome'] = $this->Outcome;
        if (isset($this->Fee)) $o['Fee'] = $this->Fee;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcTimelineStep implements JsonSerializable
{
    public function __construct(
        /** @var DateTime */
        public DateTime $AtUtc=new DateTime(),
        /** @var DateTime */
        public DateTime $LocalAt=new DateTime(),
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $StationName=null,
        /** @var string|null */
        public ?string $EmployeeName=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['AtUtc'])) $this->AtUtc = JsonConverters::from('DateTime', $o['AtUtc']);
        if (isset($o['LocalAt'])) $this->LocalAt = JsonConverters::from('DateTime', $o['LocalAt']);
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['StationName'])) $this->StationName = $o['StationName'];
        if (isset($o['EmployeeName'])) $this->EmployeeName = $o['EmployeeName'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->AtUtc)) $o['AtUtc'] = JsonConverters::to('DateTime', $this->AtUtc);
        if (isset($this->LocalAt)) $o['LocalAt'] = JsonConverters::to('DateTime', $this->LocalAt);
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->StationName)) $o['StationName'] = $this->StationName;
        if (isset($this->EmployeeName)) $o['EmployeeName'] = $this->EmployeeName;
        return empty($o) ? new class(){} : $o;
    }
}

class SvcTimeline implements JsonSerializable
{
    public function __construct(
        /** @var SvcVisitRow|null */
        public ?SvcVisitRow $Visit=null,
        /** @var array<SvcTimelineStep>|null */
        public ?array $Steps=null,
        /** @var int|null */
        public ?int $WalkUpSec=null
    ) {
    }

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

class CheckinTimelineResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var SvcTimeline|null */
        public ?SvcTimeline $Timeline=null
    ) {
    }

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

class CheckinTimelineRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Id=''
    ) {
    }

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

PHP CheckinTimelineRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /v1/customercheckins/{Id}/timeline HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Timeline":{"Visit":{"CheckinId":"00000000000000000000000000000000","TicketLabel":"String","LocalDate":"0001-01-01T00:00:00.0000000","LineId":"00000000000000000000000000000000","ServiceName":"String","StationId":"00000000000000000000000000000000","StationName":"String","EmployeeId":"00000000000000000000000000000000","EmployeeName":"String","CustomerName":"String","ContactId":0,"ContactAgentId":0,"CustomerId":"00000000000000000000000000000000","IsAppointment":false,"LocalHere":"0001-01-01T00:00:00.0000000","LocalCalled":"0001-01-01T00:00:00.0000000","LocalStart":"0001-01-01T00:00:00.0000000","LocalEnd":"0001-01-01T00:00:00.0000000","WaitSec":0,"ServeSec":0,"Outcome":"String","Fee":0},"Steps":[{"AtUtc":"0001-01-01T00:00:00.0000000","LocalAt":"0001-01-01T00:00:00.0000000","Kind":"String","StationName":"String","EmployeeName":"String"}],"WalkUpSec":0}}