| GET,OPTIONS | /v1/dashboard/kpiv2/live/{BranchId} |
|---|
<?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 SvcLiveWindow implements JsonSerializable
{
public function __construct(
/** @var string */
public string $StationId='',
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Status=null,
/** @var string|null */
public ?string $EmployeeId=null,
/** @var string|null */
public ?string $EmployeeName=null,
/** @var DateTime|null */
public ?DateTime $SignedInUtc=null,
/** @var DateTime|null */
public ?DateTime $LastSeenUtc=null,
/** @var DateTime|null */
public ?DateTime $SinceUtc=null,
/** @var string|null */
public ?string $PauseReason=null,
/** @var string|null */
public ?string $CheckinId=null,
/** @var string|null */
public ?string $TicketLabel=null,
/** @var string|null */
public ?string $CustomerName=null,
/** @var string|null */
public ?string $ServiceName=null,
/** @var DateTime|null */
public ?DateTime $StartUtc=null,
/** @var DateTime|null */
public ?DateTime $CalledUtc=null,
/** @var int */
public int $ServedToday=0,
/** @var DateTime|null */
public ?DateTime $LastCalledUtc=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['StationId'])) $this->StationId = $o['StationId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['EmployeeId'])) $this->EmployeeId = $o['EmployeeId'];
if (isset($o['EmployeeName'])) $this->EmployeeName = $o['EmployeeName'];
if (isset($o['SignedInUtc'])) $this->SignedInUtc = JsonConverters::from('DateTime', $o['SignedInUtc']);
if (isset($o['LastSeenUtc'])) $this->LastSeenUtc = JsonConverters::from('DateTime', $o['LastSeenUtc']);
if (isset($o['SinceUtc'])) $this->SinceUtc = JsonConverters::from('DateTime', $o['SinceUtc']);
if (isset($o['PauseReason'])) $this->PauseReason = $o['PauseReason'];
if (isset($o['CheckinId'])) $this->CheckinId = $o['CheckinId'];
if (isset($o['TicketLabel'])) $this->TicketLabel = $o['TicketLabel'];
if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
if (isset($o['ServiceName'])) $this->ServiceName = $o['ServiceName'];
if (isset($o['StartUtc'])) $this->StartUtc = JsonConverters::from('DateTime', $o['StartUtc']);
if (isset($o['CalledUtc'])) $this->CalledUtc = JsonConverters::from('DateTime', $o['CalledUtc']);
if (isset($o['ServedToday'])) $this->ServedToday = $o['ServedToday'];
if (isset($o['LastCalledUtc'])) $this->LastCalledUtc = JsonConverters::from('DateTime', $o['LastCalledUtc']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->StationId)) $o['StationId'] = $this->StationId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->EmployeeId)) $o['EmployeeId'] = $this->EmployeeId;
if (isset($this->EmployeeName)) $o['EmployeeName'] = $this->EmployeeName;
if (isset($this->SignedInUtc)) $o['SignedInUtc'] = JsonConverters::to('DateTime', $this->SignedInUtc);
if (isset($this->LastSeenUtc)) $o['LastSeenUtc'] = JsonConverters::to('DateTime', $this->LastSeenUtc);
if (isset($this->SinceUtc)) $o['SinceUtc'] = JsonConverters::to('DateTime', $this->SinceUtc);
if (isset($this->PauseReason)) $o['PauseReason'] = $this->PauseReason;
if (isset($this->CheckinId)) $o['CheckinId'] = $this->CheckinId;
if (isset($this->TicketLabel)) $o['TicketLabel'] = $this->TicketLabel;
if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
if (isset($this->ServiceName)) $o['ServiceName'] = $this->ServiceName;
if (isset($this->StartUtc)) $o['StartUtc'] = JsonConverters::to('DateTime', $this->StartUtc);
if (isset($this->CalledUtc)) $o['CalledUtc'] = JsonConverters::to('DateTime', $this->CalledUtc);
if (isset($this->ServedToday)) $o['ServedToday'] = $this->ServedToday;
if (isset($this->LastCalledUtc)) $o['LastCalledUtc'] = JsonConverters::to('DateTime', $this->LastCalledUtc);
return empty($o) ? new class(){} : $o;
}
}
class SvcLiveLine implements JsonSerializable
{
public function __construct(
/** @var string */
public string $LineId='',
/** @var string|null */
public ?string $Name=null,
/** @var int */
public int $Waiting=0,
/** @var DateTime|null */
public ?DateTime $OldestHereUtc=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['LineId'])) $this->LineId = $o['LineId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Waiting'])) $this->Waiting = $o['Waiting'];
if (isset($o['OldestHereUtc'])) $this->OldestHereUtc = JsonConverters::from('DateTime', $o['OldestHereUtc']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->LineId)) $o['LineId'] = $this->LineId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Waiting)) $o['Waiting'] = $this->Waiting;
if (isset($this->OldestHereUtc)) $o['OldestHereUtc'] = JsonConverters::to('DateTime', $this->OldestHereUtc);
return empty($o) ? new class(){} : $o;
}
}
class SvcAlert implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Level=null,
/** @var string|null */
public ?string $View=null,
/** @var string|null */
public ?string $Code=null,
/** @var string|null */
public ?string $StationId=null,
/** @var string|null */
public ?string $EmployeeId=null,
/** @var string|null */
public ?string $BranchId=null,
/** @var string|null */
public ?string $LineId=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $OtherLineId=null,
/** @var string|null */
public ?string $OtherName=null,
/** @var array<string>|null */
public ?array $StationIds=null,
/** @var array<string,float>|null */
public ?array $Values=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Level'])) $this->Level = $o['Level'];
if (isset($o['View'])) $this->View = $o['View'];
if (isset($o['Code'])) $this->Code = $o['Code'];
if (isset($o['StationId'])) $this->StationId = $o['StationId'];
if (isset($o['EmployeeId'])) $this->EmployeeId = $o['EmployeeId'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['LineId'])) $this->LineId = $o['LineId'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['OtherLineId'])) $this->OtherLineId = $o['OtherLineId'];
if (isset($o['OtherName'])) $this->OtherName = $o['OtherName'];
if (isset($o['StationIds'])) $this->StationIds = JsonConverters::fromArray('Guid', $o['StationIds']);
if (isset($o['Values'])) $this->Values = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','float']), $o['Values']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Level)) $o['Level'] = $this->Level;
if (isset($this->View)) $o['View'] = $this->View;
if (isset($this->Code)) $o['Code'] = $this->Code;
if (isset($this->StationId)) $o['StationId'] = $this->StationId;
if (isset($this->EmployeeId)) $o['EmployeeId'] = $this->EmployeeId;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->LineId)) $o['LineId'] = $this->LineId;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->OtherLineId)) $o['OtherLineId'] = $this->OtherLineId;
if (isset($this->OtherName)) $o['OtherName'] = $this->OtherName;
if (isset($this->StationIds)) $o['StationIds'] = JsonConverters::toArray('Guid', $this->StationIds);
if (isset($this->Values)) $o['Values'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','float']), $this->Values);
return empty($o) ? new class(){} : $o;
}
}
class SvcLive implements JsonSerializable
{
public function __construct(
/** @var string */
public string $BranchId='',
/** @var DateTime */
public DateTime $NowUtc=new DateTime(),
/** @var int */
public int $LocalOffMin=0,
/** @var string|null */
public ?string $ZoneCode=null,
/** @var array<SvcLiveWindow>|null */
public ?array $Windows=null,
/** @var array<SvcLiveLine>|null */
public ?array $Line=null,
/** @var int */
public int $InLine=0,
/** @var int */
public int $LongestWaitSec=0,
/** @var int */
public int $Staffed=0,
/** @var array<SvcAlert>|null */
public ?array $Alerts=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['NowUtc'])) $this->NowUtc = JsonConverters::from('DateTime', $o['NowUtc']);
if (isset($o['LocalOffMin'])) $this->LocalOffMin = $o['LocalOffMin'];
if (isset($o['ZoneCode'])) $this->ZoneCode = $o['ZoneCode'];
if (isset($o['Windows'])) $this->Windows = JsonConverters::fromArray('SvcLiveWindow', $o['Windows']);
if (isset($o['Line'])) $this->Line = JsonConverters::fromArray('SvcLiveLine', $o['Line']);
if (isset($o['InLine'])) $this->InLine = $o['InLine'];
if (isset($o['LongestWaitSec'])) $this->LongestWaitSec = $o['LongestWaitSec'];
if (isset($o['Staffed'])) $this->Staffed = $o['Staffed'];
if (isset($o['Alerts'])) $this->Alerts = JsonConverters::fromArray('SvcAlert', $o['Alerts']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->NowUtc)) $o['NowUtc'] = JsonConverters::to('DateTime', $this->NowUtc);
if (isset($this->LocalOffMin)) $o['LocalOffMin'] = $this->LocalOffMin;
if (isset($this->ZoneCode)) $o['ZoneCode'] = $this->ZoneCode;
if (isset($this->Windows)) $o['Windows'] = JsonConverters::toArray('SvcLiveWindow', $this->Windows);
if (isset($this->Line)) $o['Line'] = JsonConverters::toArray('SvcLiveLine', $this->Line);
if (isset($this->InLine)) $o['InLine'] = $this->InLine;
if (isset($this->LongestWaitSec)) $o['LongestWaitSec'] = $this->LongestWaitSec;
if (isset($this->Staffed)) $o['Staffed'] = $this->Staffed;
if (isset($this->Alerts)) $o['Alerts'] = JsonConverters::toArray('SvcAlert', $this->Alerts);
return empty($o) ? new class(){} : $o;
}
}
class KpiV2LiveResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var SvcLive|null */
public ?SvcLive $Live=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Live'])) $this->Live = JsonConverters::from('SvcLive', $o['Live']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Live)) $o['Live'] = JsonConverters::to('SvcLive', $this->Live);
return empty($o) ? new class(){} : $o;
}
}
class KpiV2LiveRequest implements JsonSerializable
{
public function __construct(
/** @var string */
public string $BranchId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/dashboard/kpiv2/live/{BranchId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<KpiV2LiveResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Live>
<Alerts>
<SvcAlert>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<Code>String</Code>
<EmployeeId>00000000-0000-0000-0000-000000000000</EmployeeId>
<Level>String</Level>
<LineId>00000000-0000-0000-0000-000000000000</LineId>
<Name>String</Name>
<OtherLineId>00000000-0000-0000-0000-000000000000</OtherLineId>
<OtherName>String</OtherName>
<StationId>00000000-0000-0000-0000-000000000000</StationId>
<StationIds xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:guid>00000000-0000-0000-0000-000000000000</d5p1:guid>
</StationIds>
<Values xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringdouble>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>0</d5p1:Value>
</d5p1:KeyValueOfstringdouble>
</Values>
<View>String</View>
</SvcAlert>
</Alerts>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<InLine>0</InLine>
<Line>
<SvcLiveLine>
<LineId>00000000-0000-0000-0000-000000000000</LineId>
<Name>String</Name>
<OldestHereUtc>0001-01-01T00:00:00</OldestHereUtc>
<Waiting>0</Waiting>
</SvcLiveLine>
</Line>
<LocalOffMin>0</LocalOffMin>
<LongestWaitSec>0</LongestWaitSec>
<NowUtc>0001-01-01T00:00:00</NowUtc>
<Staffed>0</Staffed>
<Windows>
<SvcLiveWindow>
<CalledUtc>0001-01-01T00:00:00</CalledUtc>
<CheckinId>00000000-0000-0000-0000-000000000000</CheckinId>
<CustomerName>String</CustomerName>
<EmployeeId>00000000-0000-0000-0000-000000000000</EmployeeId>
<EmployeeName>String</EmployeeName>
<LastCalledUtc>0001-01-01T00:00:00</LastCalledUtc>
<LastSeenUtc>0001-01-01T00:00:00</LastSeenUtc>
<Name>String</Name>
<PauseReason>String</PauseReason>
<ServedToday>0</ServedToday>
<ServiceName>String</ServiceName>
<SignedInUtc>0001-01-01T00:00:00</SignedInUtc>
<SinceUtc>0001-01-01T00:00:00</SinceUtc>
<StartUtc>0001-01-01T00:00:00</StartUtc>
<StationId>00000000-0000-0000-0000-000000000000</StationId>
<Status>String</Status>
<TicketLabel>String</TicketLabel>
</SvcLiveWindow>
</Windows>
<ZoneCode>String</ZoneCode>
</Live>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</KpiV2LiveResponse>