| GET,OPTIONS | /v1/worker/myday |
|---|
<?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 WorkerVisit implements JsonSerializable
{
public function __construct(
/** @var int */
public int $WorkerScheduleItemID=0,
/** @var int */
public int $JobID=0,
/** @var int */
public int $SortOrder=0,
/** @var string|null */
public ?string $Status=null,
/** @var string|null */
public ?string $PropertyName=null,
/** @var string|null */
public ?string $Address=null,
/** @var string|null */
public ?string $TimeWindow=null,
/** @var string|null */
public ?string $DistanceLabel=null,
/** @var string|null */
public ?string $ServiceSummary=null,
/** @var int|null */
public ?int $AreaCount=null,
/** @var string|null */
public ?string $AccessNotes=null,
/** @var bool|null */
public ?bool $HasRestrictedDetails=null,
/** @var bool|null */
public ?bool $CanViewRestricted=null,
/** @var string|null */
public ?string $PriorVisitNotes=null,
/** @var bool|null */
public ?bool $RainRisk=null,
/** @var string|null */
public ?string $CompletedAtLabel=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['WorkerScheduleItemID'])) $this->WorkerScheduleItemID = $o['WorkerScheduleItemID'];
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['SortOrder'])) $this->SortOrder = $o['SortOrder'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['PropertyName'])) $this->PropertyName = $o['PropertyName'];
if (isset($o['Address'])) $this->Address = $o['Address'];
if (isset($o['TimeWindow'])) $this->TimeWindow = $o['TimeWindow'];
if (isset($o['DistanceLabel'])) $this->DistanceLabel = $o['DistanceLabel'];
if (isset($o['ServiceSummary'])) $this->ServiceSummary = $o['ServiceSummary'];
if (isset($o['AreaCount'])) $this->AreaCount = $o['AreaCount'];
if (isset($o['AccessNotes'])) $this->AccessNotes = $o['AccessNotes'];
if (isset($o['HasRestrictedDetails'])) $this->HasRestrictedDetails = $o['HasRestrictedDetails'];
if (isset($o['CanViewRestricted'])) $this->CanViewRestricted = $o['CanViewRestricted'];
if (isset($o['PriorVisitNotes'])) $this->PriorVisitNotes = $o['PriorVisitNotes'];
if (isset($o['RainRisk'])) $this->RainRisk = $o['RainRisk'];
if (isset($o['CompletedAtLabel'])) $this->CompletedAtLabel = $o['CompletedAtLabel'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->WorkerScheduleItemID)) $o['WorkerScheduleItemID'] = $this->WorkerScheduleItemID;
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->SortOrder)) $o['SortOrder'] = $this->SortOrder;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->PropertyName)) $o['PropertyName'] = $this->PropertyName;
if (isset($this->Address)) $o['Address'] = $this->Address;
if (isset($this->TimeWindow)) $o['TimeWindow'] = $this->TimeWindow;
if (isset($this->DistanceLabel)) $o['DistanceLabel'] = $this->DistanceLabel;
if (isset($this->ServiceSummary)) $o['ServiceSummary'] = $this->ServiceSummary;
if (isset($this->AreaCount)) $o['AreaCount'] = $this->AreaCount;
if (isset($this->AccessNotes)) $o['AccessNotes'] = $this->AccessNotes;
if (isset($this->HasRestrictedDetails)) $o['HasRestrictedDetails'] = $this->HasRestrictedDetails;
if (isset($this->CanViewRestricted)) $o['CanViewRestricted'] = $this->CanViewRestricted;
if (isset($this->PriorVisitNotes)) $o['PriorVisitNotes'] = $this->PriorVisitNotes;
if (isset($this->RainRisk)) $o['RainRisk'] = $this->RainRisk;
if (isset($this->CompletedAtLabel)) $o['CompletedAtLabel'] = $this->CompletedAtLabel;
return empty($o) ? new class(){} : $o;
}
}
class WorkerMyDayResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var string|null */
public ?string $Route=null,
/** @var string|null */
public ?string $DateLabel=null,
/** @var bool|null */
public ?bool $IsCrewLead=null,
/** @var bool|null */
public ?bool $IsCrewMember=null,
/** @var array<WorkerVisit>|null */
public ?array $Visits=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Route'])) $this->Route = $o['Route'];
if (isset($o['DateLabel'])) $this->DateLabel = $o['DateLabel'];
if (isset($o['IsCrewLead'])) $this->IsCrewLead = $o['IsCrewLead'];
if (isset($o['IsCrewMember'])) $this->IsCrewMember = $o['IsCrewMember'];
if (isset($o['Visits'])) $this->Visits = JsonConverters::fromArray('WorkerVisit', $o['Visits']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Route)) $o['Route'] = $this->Route;
if (isset($this->DateLabel)) $o['DateLabel'] = $this->DateLabel;
if (isset($this->IsCrewLead)) $o['IsCrewLead'] = $this->IsCrewLead;
if (isset($this->IsCrewMember)) $o['IsCrewMember'] = $this->IsCrewMember;
if (isset($this->Visits)) $o['Visits'] = JsonConverters::toArray('WorkerVisit', $this->Visits);
return empty($o) ? new class(){} : $o;
}
}
class WorkerMyDayRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Date=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Date'])) $this->Date = $o['Date'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Date)) $o['Date'] = $this->Date;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/worker/myday HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Route":"String","DateLabel":"String","IsCrewLead":false,"IsCrewMember":false,"Visits":[{"WorkerScheduleItemID":0,"JobID":0,"SortOrder":0,"Status":"String","PropertyName":"String","Address":"String","TimeWindow":"String","DistanceLabel":"String","ServiceSummary":"String","AreaCount":0,"AccessNotes":"String","HasRestrictedDetails":false,"CanViewRestricted":false,"PriorVisitNotes":"String","RainRisk":false,"CompletedAtLabel":"String"}]}