| GET,OPTIONS | /v1/routeplan/crews |
|---|
<?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 RoutePlanCrewsResponse implements JsonSerializable
{
public function __construct(
/** @var array<RoutePlanCrew>|null */
public ?array $Crews=null,
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Crews'])) $this->Crews = JsonConverters::fromArray('RoutePlanCrew', $o['Crews']);
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Crews)) $o['Crews'] = JsonConverters::toArray('RoutePlanCrew', $this->Crews);
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
return empty($o) ? new class(){} : $o;
}
}
class RoutePlanCrewsRequest implements JsonSerializable
{
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
return empty($o) ? new class(){} : $o;
}
}
PHP RoutePlanCrewsRequest DTOs
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/routeplan/crews HTTP/1.1 Host: api.dev.dynamics.trendsic.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<RoutePlanCrewsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Crews>
<RoutePlanCrew>
<CrewColor>String</CrewColor>
<CrewID>0</CrewID>
<CrewName>String</CrewName>
<DailyCapacityMin>0</DailyCapacityMin>
<HomeZip>String</HomeZip>
<Specialist>false</Specialist>
<WeeklyCapacityMin>0</WeeklyCapacityMin>
<YardLat>0</YardLat>
<YardLng>0</YardLng>
</RoutePlanCrew>
</Crews>
<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>
</RoutePlanCrewsResponse>