| GET,OPTIONS | /v1/visits/exceptions |
|---|
<?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 ExceptionItem implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Kind=null,
/** @var string|null */
public ?string $VisitKey=null,
/** @var int */
public int $JobID=0,
/** @var int */
public int $ProjectID=0,
/** @var int|null */
public ?int $AgreementID=null,
/** @var int|null */
public ?int $AgreementJobID=null,
/** @var string|null */
public ?string $OccurrenceDate=null,
/** @var string|null */
public ?string $CustomerName=null,
/** @var string|null */
public ?string $LocationName=null,
/** @var string|null */
public ?string $City=null,
/** @var float|null */
public ?float $Lat=null,
/** @var float|null */
public ?float $Lng=null,
/** @var int */
public int $AgeDays=0,
/** @var string|null */
public ?string $Reason=null,
/** @var int */
public int $DurationMinutes=0,
/** @var bool|null */
public ?bool $IsCommercial=null,
/** @var int|null */
public ?int $PreferredCrewID=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Kind'])) $this->Kind = $o['Kind'];
if (isset($o['VisitKey'])) $this->VisitKey = $o['VisitKey'];
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['ProjectID'])) $this->ProjectID = $o['ProjectID'];
if (isset($o['AgreementID'])) $this->AgreementID = $o['AgreementID'];
if (isset($o['AgreementJobID'])) $this->AgreementJobID = $o['AgreementJobID'];
if (isset($o['OccurrenceDate'])) $this->OccurrenceDate = $o['OccurrenceDate'];
if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
if (isset($o['LocationName'])) $this->LocationName = $o['LocationName'];
if (isset($o['City'])) $this->City = $o['City'];
if (isset($o['Lat'])) $this->Lat = $o['Lat'];
if (isset($o['Lng'])) $this->Lng = $o['Lng'];
if (isset($o['AgeDays'])) $this->AgeDays = $o['AgeDays'];
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
if (isset($o['DurationMinutes'])) $this->DurationMinutes = $o['DurationMinutes'];
if (isset($o['IsCommercial'])) $this->IsCommercial = $o['IsCommercial'];
if (isset($o['PreferredCrewID'])) $this->PreferredCrewID = $o['PreferredCrewID'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Kind)) $o['Kind'] = $this->Kind;
if (isset($this->VisitKey)) $o['VisitKey'] = $this->VisitKey;
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->ProjectID)) $o['ProjectID'] = $this->ProjectID;
if (isset($this->AgreementID)) $o['AgreementID'] = $this->AgreementID;
if (isset($this->AgreementJobID)) $o['AgreementJobID'] = $this->AgreementJobID;
if (isset($this->OccurrenceDate)) $o['OccurrenceDate'] = $this->OccurrenceDate;
if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
if (isset($this->LocationName)) $o['LocationName'] = $this->LocationName;
if (isset($this->City)) $o['City'] = $this->City;
if (isset($this->Lat)) $o['Lat'] = $this->Lat;
if (isset($this->Lng)) $o['Lng'] = $this->Lng;
if (isset($this->AgeDays)) $o['AgeDays'] = $this->AgeDays;
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
if (isset($this->DurationMinutes)) $o['DurationMinutes'] = $this->DurationMinutes;
if (isset($this->IsCommercial)) $o['IsCommercial'] = $this->IsCommercial;
if (isset($this->PreferredCrewID)) $o['PreferredCrewID'] = $this->PreferredCrewID;
return empty($o) ? new class(){} : $o;
}
}
class VisitExceptionsResponse implements JsonSerializable
{
public function __construct(
/** @var array<ExceptionItem>|null */
public ?array $Items=null,
/** @var int */
public int $MissedCount=0,
/** @var int */
public int $SlaCount=0,
/** @var int */
public int $SkippedCount=0,
/** @var int */
public int $AtRiskCount=0,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Items'])) $this->Items = JsonConverters::fromArray('ExceptionItem', $o['Items']);
if (isset($o['MissedCount'])) $this->MissedCount = $o['MissedCount'];
if (isset($o['SlaCount'])) $this->SlaCount = $o['SlaCount'];
if (isset($o['SkippedCount'])) $this->SkippedCount = $o['SkippedCount'];
if (isset($o['AtRiskCount'])) $this->AtRiskCount = $o['AtRiskCount'];
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('ExceptionItem', $this->Items);
if (isset($this->MissedCount)) $o['MissedCount'] = $this->MissedCount;
if (isset($this->SlaCount)) $o['SlaCount'] = $this->SlaCount;
if (isset($this->SkippedCount)) $o['SkippedCount'] = $this->SkippedCount;
if (isset($this->AtRiskCount)) $o['AtRiskCount'] = $this->AtRiskCount;
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class VisitExceptionsRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
PHP VisitExceptionsRequest 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/visits/exceptions HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Items":[{"Kind":"String","VisitKey":"String","JobID":0,"ProjectID":0,"AgreementID":0,"AgreementJobID":0,"OccurrenceDate":"String","CustomerName":"String","LocationName":"String","City":"String","Lat":0,"Lng":0,"AgeDays":0,"Reason":"String","DurationMinutes":0,"IsCommercial":false,"PreferredCrewID":0}],"MissedCount":0,"SlaCount":0,"SkippedCount":0,"AtRiskCount":0,"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}