| GET,OPTIONS | /v1/fleet/live |
|---|
<?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 FleetRowDto implements JsonSerializable
{
public function __construct(
/** @var int */
public int $ContactID=0,
/** @var string|null */
public ?string $WorkerName=null,
/** @var int|null */
public ?int $CrewID=null,
/** @var string|null */
public ?string $CrewName=null,
/** @var string|null */
public ?string $BranchId=null,
/** @var string|null */
public ?string $LiveStatus=null,
/** @var int|null */
public ?int $WorkerScheduleItemID=null,
/** @var int|null */
public ?int $JobID=null,
/** @var string|null */
public ?string $CurProperty=null,
/** @var string|null */
public ?string $CurAddress=null,
/** @var string|null */
public ?string $CurZip=null,
/** @var string|null */
public ?string $EnRouteAt=null,
/** @var string|null */
public ?string $StartedAt=null,
/** @var float|null */
public ?float $LastLat=null,
/** @var float|null */
public ?float $LastLng=null,
/** @var string|null */
public ?string $LastLocAt=null,
/** @var string|null */
public ?string $NextProperty=null,
/** @var int */
public int $DoneVisits=0,
/** @var int */
public int $TotalVisits=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ContactID'])) $this->ContactID = $o['ContactID'];
if (isset($o['WorkerName'])) $this->WorkerName = $o['WorkerName'];
if (isset($o['CrewID'])) $this->CrewID = $o['CrewID'];
if (isset($o['CrewName'])) $this->CrewName = $o['CrewName'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['LiveStatus'])) $this->LiveStatus = $o['LiveStatus'];
if (isset($o['WorkerScheduleItemID'])) $this->WorkerScheduleItemID = $o['WorkerScheduleItemID'];
if (isset($o['JobID'])) $this->JobID = $o['JobID'];
if (isset($o['CurProperty'])) $this->CurProperty = $o['CurProperty'];
if (isset($o['CurAddress'])) $this->CurAddress = $o['CurAddress'];
if (isset($o['CurZip'])) $this->CurZip = $o['CurZip'];
if (isset($o['EnRouteAt'])) $this->EnRouteAt = $o['EnRouteAt'];
if (isset($o['StartedAt'])) $this->StartedAt = $o['StartedAt'];
if (isset($o['LastLat'])) $this->LastLat = $o['LastLat'];
if (isset($o['LastLng'])) $this->LastLng = $o['LastLng'];
if (isset($o['LastLocAt'])) $this->LastLocAt = $o['LastLocAt'];
if (isset($o['NextProperty'])) $this->NextProperty = $o['NextProperty'];
if (isset($o['DoneVisits'])) $this->DoneVisits = $o['DoneVisits'];
if (isset($o['TotalVisits'])) $this->TotalVisits = $o['TotalVisits'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ContactID)) $o['ContactID'] = $this->ContactID;
if (isset($this->WorkerName)) $o['WorkerName'] = $this->WorkerName;
if (isset($this->CrewID)) $o['CrewID'] = $this->CrewID;
if (isset($this->CrewName)) $o['CrewName'] = $this->CrewName;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->LiveStatus)) $o['LiveStatus'] = $this->LiveStatus;
if (isset($this->WorkerScheduleItemID)) $o['WorkerScheduleItemID'] = $this->WorkerScheduleItemID;
if (isset($this->JobID)) $o['JobID'] = $this->JobID;
if (isset($this->CurProperty)) $o['CurProperty'] = $this->CurProperty;
if (isset($this->CurAddress)) $o['CurAddress'] = $this->CurAddress;
if (isset($this->CurZip)) $o['CurZip'] = $this->CurZip;
if (isset($this->EnRouteAt)) $o['EnRouteAt'] = $this->EnRouteAt;
if (isset($this->StartedAt)) $o['StartedAt'] = $this->StartedAt;
if (isset($this->LastLat)) $o['LastLat'] = $this->LastLat;
if (isset($this->LastLng)) $o['LastLng'] = $this->LastLng;
if (isset($this->LastLocAt)) $o['LastLocAt'] = $this->LastLocAt;
if (isset($this->NextProperty)) $o['NextProperty'] = $this->NextProperty;
if (isset($this->DoneVisits)) $o['DoneVisits'] = $this->DoneVisits;
if (isset($this->TotalVisits)) $o['TotalVisits'] = $this->TotalVisits;
return empty($o) ? new class(){} : $o;
}
}
class FleetLiveResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<FleetRowDto>|null */
public ?array $Rows=null,
/** @var int */
public int $ActiveWorkers=0,
/** @var int */
public int $EnRoute=0,
/** @var int */
public int $OnSite=0,
/** @var int */
public int $Waiting=0,
/** @var int */
public int $Done=0,
/** @var int */
public int $RunningLate=0,
/** @var int */
public int $PageTotal=0,
/** @var int */
public int $Page=0,
/** @var int */
public int $PageSize=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['Rows'])) $this->Rows = JsonConverters::fromArray('FleetRowDto', $o['Rows']);
if (isset($o['ActiveWorkers'])) $this->ActiveWorkers = $o['ActiveWorkers'];
if (isset($o['EnRoute'])) $this->EnRoute = $o['EnRoute'];
if (isset($o['OnSite'])) $this->OnSite = $o['OnSite'];
if (isset($o['Waiting'])) $this->Waiting = $o['Waiting'];
if (isset($o['Done'])) $this->Done = $o['Done'];
if (isset($o['RunningLate'])) $this->RunningLate = $o['RunningLate'];
if (isset($o['PageTotal'])) $this->PageTotal = $o['PageTotal'];
if (isset($o['Page'])) $this->Page = $o['Page'];
if (isset($o['PageSize'])) $this->PageSize = $o['PageSize'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->Rows)) $o['Rows'] = JsonConverters::toArray('FleetRowDto', $this->Rows);
if (isset($this->ActiveWorkers)) $o['ActiveWorkers'] = $this->ActiveWorkers;
if (isset($this->EnRoute)) $o['EnRoute'] = $this->EnRoute;
if (isset($this->OnSite)) $o['OnSite'] = $this->OnSite;
if (isset($this->Waiting)) $o['Waiting'] = $this->Waiting;
if (isset($this->Done)) $o['Done'] = $this->Done;
if (isset($this->RunningLate)) $o['RunningLate'] = $this->RunningLate;
if (isset($this->PageTotal)) $o['PageTotal'] = $this->PageTotal;
if (isset($this->Page)) $o['Page'] = $this->Page;
if (isset($this->PageSize)) $o['PageSize'] = $this->PageSize;
return empty($o) ? new class(){} : $o;
}
}
class FleetLiveRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Date=null,
/** @var string|null */
public ?string $Status=null,
/** @var int|null */
public ?int $CrewID=null,
/** @var string|null */
public ?string $Zip=null,
/** @var string|null */
public ?string $BranchId=null,
/** @var string|null */
public ?string $Search=null,
/** @var int */
public int $Page=0,
/** @var int */
public int $PageSize=0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Date'])) $this->Date = $o['Date'];
if (isset($o['Status'])) $this->Status = $o['Status'];
if (isset($o['CrewID'])) $this->CrewID = $o['CrewID'];
if (isset($o['Zip'])) $this->Zip = $o['Zip'];
if (isset($o['BranchId'])) $this->BranchId = $o['BranchId'];
if (isset($o['Search'])) $this->Search = $o['Search'];
if (isset($o['Page'])) $this->Page = $o['Page'];
if (isset($o['PageSize'])) $this->PageSize = $o['PageSize'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Date)) $o['Date'] = $this->Date;
if (isset($this->Status)) $o['Status'] = $this->Status;
if (isset($this->CrewID)) $o['CrewID'] = $this->CrewID;
if (isset($this->Zip)) $o['Zip'] = $this->Zip;
if (isset($this->BranchId)) $o['BranchId'] = $this->BranchId;
if (isset($this->Search)) $o['Search'] = $this->Search;
if (isset($this->Page)) $o['Page'] = $this->Page;
if (isset($this->PageSize)) $o['PageSize'] = $this->PageSize;
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/fleet/live HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<FleetLiveResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<ActiveWorkers>0</ActiveWorkers>
<Done>0</Done>
<EnRoute>0</EnRoute>
<OnSite>0</OnSite>
<Page>0</Page>
<PageSize>0</PageSize>
<PageTotal>0</PageTotal>
<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>
<Rows>
<FleetRowDto>
<BranchId>00000000-0000-0000-0000-000000000000</BranchId>
<ContactID>0</ContactID>
<CrewID>0</CrewID>
<CrewName>String</CrewName>
<CurAddress>String</CurAddress>
<CurProperty>String</CurProperty>
<CurZip>String</CurZip>
<DoneVisits>0</DoneVisits>
<EnRouteAt>String</EnRouteAt>
<JobID>0</JobID>
<LastLat>0</LastLat>
<LastLng>0</LastLng>
<LastLocAt>String</LastLocAt>
<LiveStatus>String</LiveStatus>
<NextProperty>String</NextProperty>
<StartedAt>String</StartedAt>
<TotalVisits>0</TotalVisits>
<WorkerName>String</WorkerName>
<WorkerScheduleItemID>0</WorkerScheduleItemID>
</FleetRowDto>
</Rows>
<RunningLate>0</RunningLate>
<Waiting>0</Waiting>
</FleetLiveResponse>