| GET,OPTIONS | /v1/routeplan/week |
|---|
<?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 RoutePlanCrew implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CrewID=0,
/** @var string|null */
public ?string $CrewName=null,
/** @var string|null */
public ?string $CrewColor=null,
/** @var string|null */
public ?string $HomeZip=null,
/** @var float|null */
public ?float $YardLat=null,
/** @var float|null */
public ?float $YardLng=null,
/** @var int */
public int $DailyCapacityMin=0,
/** @var int */
public int $WeeklyCapacityMin=0,
/** @var bool|null */
public ?bool $Specialist=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CrewID'])) $this->CrewID = $o['CrewID'];
if (isset($o['CrewName'])) $this->CrewName = $o['CrewName'];
if (isset($o['CrewColor'])) $this->CrewColor = $o['CrewColor'];
if (isset($o['HomeZip'])) $this->HomeZip = $o['HomeZip'];
if (isset($o['YardLat'])) $this->YardLat = $o['YardLat'];
if (isset($o['YardLng'])) $this->YardLng = $o['YardLng'];
if (isset($o['DailyCapacityMin'])) $this->DailyCapacityMin = $o['DailyCapacityMin'];
if (isset($o['WeeklyCapacityMin'])) $this->WeeklyCapacityMin = $o['WeeklyCapacityMin'];
if (isset($o['Specialist'])) $this->Specialist = $o['Specialist'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CrewID)) $o['CrewID'] = $this->CrewID;
if (isset($this->CrewName)) $o['CrewName'] = $this->CrewName;
if (isset($this->CrewColor)) $o['CrewColor'] = $this->CrewColor;
if (isset($this->HomeZip)) $o['HomeZip'] = $this->HomeZip;
if (isset($this->YardLat)) $o['YardLat'] = $this->YardLat;
if (isset($this->YardLng)) $o['YardLng'] = $this->YardLng;
if (isset($this->DailyCapacityMin)) $o['DailyCapacityMin'] = $this->DailyCapacityMin;
if (isset($this->WeeklyCapacityMin)) $o['WeeklyCapacityMin'] = $this->WeeklyCapacityMin;
if (isset($this->Specialist)) $o['Specialist'] = $this->Specialist;
return empty($o) ? new class(){} : $o;
}
}
class RoutePlanVisit implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AgreementID=0,
/** @var int|null */
public ?int $AgreementJobID=null,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $Sub=null,
/** @var string|null */
public ?string $ServiceType=null,
/** @var string|null */
public ?string $Zip=null,
/** @var string|null */
public ?string $Area=null,
/** @var float|null */
public ?float $Lat=null,
/** @var float|null */
public ?float $Lng=null,
/** @var int */
public int $DurationMin=0,
/** @var string|null */
public ?string $DueIso=null,
/** @var string|null */
public ?string $DueLabel=null,
/** @var bool|null */
public ?bool $Overdue=null,
/** @var int|null */
public ?int $DefaultCrewID=null,
/** @var int|null */
public ?int $RouteCrewID=null,
/** @var int|null */
public ?int $RouteSeq=null,
/** @var string|null */
public ?string $RouteDateIso=null,
/** @var int */
public int $LateDays=0,
/** @var bool|null */
public ?bool $AutoPay=null,
/** @var string|null */
public ?string $SkipPolicy=null,
/** @var float */
public float $SkipCreditAmount=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AgreementID'])) $this->AgreementID = $o['AgreementID'];
if (isset($o['AgreementJobID'])) $this->AgreementJobID = $o['AgreementJobID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['Sub'])) $this->Sub = $o['Sub'];
if (isset($o['ServiceType'])) $this->ServiceType = $o['ServiceType'];
if (isset($o['Zip'])) $this->Zip = $o['Zip'];
if (isset($o['Area'])) $this->Area = $o['Area'];
if (isset($o['Lat'])) $this->Lat = $o['Lat'];
if (isset($o['Lng'])) $this->Lng = $o['Lng'];
if (isset($o['DurationMin'])) $this->DurationMin = $o['DurationMin'];
if (isset($o['DueIso'])) $this->DueIso = $o['DueIso'];
if (isset($o['DueLabel'])) $this->DueLabel = $o['DueLabel'];
if (isset($o['Overdue'])) $this->Overdue = $o['Overdue'];
if (isset($o['DefaultCrewID'])) $this->DefaultCrewID = $o['DefaultCrewID'];
if (isset($o['RouteCrewID'])) $this->RouteCrewID = $o['RouteCrewID'];
if (isset($o['RouteSeq'])) $this->RouteSeq = $o['RouteSeq'];
if (isset($o['RouteDateIso'])) $this->RouteDateIso = $o['RouteDateIso'];
if (isset($o['LateDays'])) $this->LateDays = $o['LateDays'];
if (isset($o['AutoPay'])) $this->AutoPay = $o['AutoPay'];
if (isset($o['SkipPolicy'])) $this->SkipPolicy = $o['SkipPolicy'];
if (isset($o['SkipCreditAmount'])) $this->SkipCreditAmount = $o['SkipCreditAmount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AgreementID)) $o['AgreementID'] = $this->AgreementID;
if (isset($this->AgreementJobID)) $o['AgreementJobID'] = $this->AgreementJobID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->Sub)) $o['Sub'] = $this->Sub;
if (isset($this->ServiceType)) $o['ServiceType'] = $this->ServiceType;
if (isset($this->Zip)) $o['Zip'] = $this->Zip;
if (isset($this->Area)) $o['Area'] = $this->Area;
if (isset($this->Lat)) $o['Lat'] = $this->Lat;
if (isset($this->Lng)) $o['Lng'] = $this->Lng;
if (isset($this->DurationMin)) $o['DurationMin'] = $this->DurationMin;
if (isset($this->DueIso)) $o['DueIso'] = $this->DueIso;
if (isset($this->DueLabel)) $o['DueLabel'] = $this->DueLabel;
if (isset($this->Overdue)) $o['Overdue'] = $this->Overdue;
if (isset($this->DefaultCrewID)) $o['DefaultCrewID'] = $this->DefaultCrewID;
if (isset($this->RouteCrewID)) $o['RouteCrewID'] = $this->RouteCrewID;
if (isset($this->RouteSeq)) $o['RouteSeq'] = $this->RouteSeq;
if (isset($this->RouteDateIso)) $o['RouteDateIso'] = $this->RouteDateIso;
if (isset($this->LateDays)) $o['LateDays'] = $this->LateDays;
if (isset($this->AutoPay)) $o['AutoPay'] = $this->AutoPay;
if (isset($this->SkipPolicy)) $o['SkipPolicy'] = $this->SkipPolicy;
if (isset($this->SkipCreditAmount)) $o['SkipCreditAmount'] = $this->SkipCreditAmount;
return empty($o) ? new class(){} : $o;
}
}
class RoutePlanSkippedVisit implements JsonSerializable
{
public function __construct(
/** @var int */
public int $AgreementJobID=0,
/** @var int */
public int $AgreementID=0,
/** @var string|null */
public ?string $Name=null,
/** @var string|null */
public ?string $DateIso=null,
/** @var string|null */
public ?string $Reason=null,
/** @var float */
public float $CreditAmount=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['AgreementJobID'])) $this->AgreementJobID = $o['AgreementJobID'];
if (isset($o['AgreementID'])) $this->AgreementID = $o['AgreementID'];
if (isset($o['Name'])) $this->Name = $o['Name'];
if (isset($o['DateIso'])) $this->DateIso = $o['DateIso'];
if (isset($o['Reason'])) $this->Reason = $o['Reason'];
if (isset($o['CreditAmount'])) $this->CreditAmount = $o['CreditAmount'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->AgreementJobID)) $o['AgreementJobID'] = $this->AgreementJobID;
if (isset($this->AgreementID)) $o['AgreementID'] = $this->AgreementID;
if (isset($this->Name)) $o['Name'] = $this->Name;
if (isset($this->DateIso)) $o['DateIso'] = $this->DateIso;
if (isset($this->Reason)) $o['Reason'] = $this->Reason;
if (isset($this->CreditAmount)) $o['CreditAmount'] = $this->CreditAmount;
return empty($o) ? new class(){} : $o;
}
}
class RoutePlanWeekResponse implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $FromIso=null,
/** @var string|null */
public ?string $ToIso=null,
/** @var array<RoutePlanCrew>|null */
public ?array $Crews=null,
/** @var array<RoutePlanVisit>|null */
public ?array $Visits=null,
/** @var array<RoutePlanSkippedVisit>|null */
public ?array $Skipped=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['FromIso'])) $this->FromIso = $o['FromIso'];
if (isset($o['ToIso'])) $this->ToIso = $o['ToIso'];
if (isset($o['Crews'])) $this->Crews = JsonConverters::fromArray('RoutePlanCrew', $o['Crews']);
if (isset($o['Visits'])) $this->Visits = JsonConverters::fromArray('RoutePlanVisit', $o['Visits']);
if (isset($o['Skipped'])) $this->Skipped = JsonConverters::fromArray('RoutePlanSkippedVisit', $o['Skipped']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->FromIso)) $o['FromIso'] = $this->FromIso;
if (isset($this->ToIso)) $o['ToIso'] = $this->ToIso;
if (isset($this->Crews)) $o['Crews'] = JsonConverters::toArray('RoutePlanCrew', $this->Crews);
if (isset($this->Visits)) $o['Visits'] = JsonConverters::toArray('RoutePlanVisit', $this->Visits);
if (isset($this->Skipped)) $o['Skipped'] = JsonConverters::toArray('RoutePlanSkippedVisit', $this->Skipped);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class RoutePlanWeekRequest implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $From=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['From'])) $this->From = $o['From'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->From)) $o['From'] = $this->From;
return empty($o) ? new class(){} : $o;
}
}
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/routeplan/week HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"FromIso":"String","ToIso":"String","Crews":[{"CrewID":0,"CrewName":"String","CrewColor":"String","HomeZip":"String","YardLat":0,"YardLng":0,"DailyCapacityMin":0,"WeeklyCapacityMin":0,"Specialist":false}],"Visits":[{"AgreementID":0,"AgreementJobID":0,"Name":"String","Sub":"String","ServiceType":"String","Zip":"String","Area":"String","Lat":0,"Lng":0,"DurationMin":0,"DueIso":"String","DueLabel":"String","Overdue":false,"DefaultCrewID":0,"RouteCrewID":0,"RouteSeq":0,"RouteDateIso":"String","LateDays":0,"AutoPay":false,"SkipPolicy":"String","SkipCreditAmount":0}],"Skipped":[{"AgreementJobID":0,"AgreementID":0,"Name":"String","DateIso":"String","Reason":"String","CreditAmount":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}