| GET | /pulsit/moduletriphistory |
|---|
<?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 ApiServiceRequest implements IServiceRequest, IHasApiKey, JsonSerializable
{
public function __construct(
/** @description The API Key required for authentication */
// @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
/** @var string */
public string $ApiKey=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
return empty($o) ? new class(){} : $o;
}
}
class ApiServiceResponse implements IServiceResponse, JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $Description=null,
/** @var string|null */
public ?string $Heading=null,
/** @var bool|null */
public ?bool $WasSuccessful=null,
/** @var Object|null */
public ?Object $ModelState=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Description'])) $this->Description = $o['Description'];
if (isset($o['Heading'])) $this->Heading = $o['Heading'];
if (isset($o['WasSuccessful'])) $this->WasSuccessful = $o['WasSuccessful'];
if (isset($o['ModelState'])) $this->ModelState = JsonConverters::from('Object', $o['ModelState']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Description)) $o['Description'] = $this->Description;
if (isset($this->Heading)) $o['Heading'] = $this->Heading;
if (isset($this->WasSuccessful)) $o['WasSuccessful'] = $this->WasSuccessful;
if (isset($this->ModelState)) $o['ModelState'] = JsonConverters::to('Object', $this->ModelState);
return empty($o) ? new class(){} : $o;
}
}
class PulsitTripHistoryItem implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $TripNumber=null,
/** @var string|null */
public ?string $StartPulsitId=null,
/** @var DateTime */
public DateTime $StartEventTime=new DateTime(),
/** @var float */
public float $StartLatitude=0.0,
/** @var float */
public float $StartLongitude=0.0,
/** @var string|null */
public ?string $StartAddress=null,
/** @var string|null */
public ?string $StopPulsitId=null,
/** @var DateTime */
public DateTime $StopEventTime=new DateTime(),
/** @var float */
public float $StopLatitude=0.0,
/** @var float */
public float $StopLongitude=0.0,
/** @var string|null */
public ?string $StopAddress=null,
/** @var float */
public float $TripMinutes=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['TripNumber'])) $this->TripNumber = $o['TripNumber'];
if (isset($o['StartPulsitId'])) $this->StartPulsitId = $o['StartPulsitId'];
if (isset($o['StartEventTime'])) $this->StartEventTime = JsonConverters::from('DateTime', $o['StartEventTime']);
if (isset($o['StartLatitude'])) $this->StartLatitude = $o['StartLatitude'];
if (isset($o['StartLongitude'])) $this->StartLongitude = $o['StartLongitude'];
if (isset($o['StartAddress'])) $this->StartAddress = $o['StartAddress'];
if (isset($o['StopPulsitId'])) $this->StopPulsitId = $o['StopPulsitId'];
if (isset($o['StopEventTime'])) $this->StopEventTime = JsonConverters::from('DateTime', $o['StopEventTime']);
if (isset($o['StopLatitude'])) $this->StopLatitude = $o['StopLatitude'];
if (isset($o['StopLongitude'])) $this->StopLongitude = $o['StopLongitude'];
if (isset($o['StopAddress'])) $this->StopAddress = $o['StopAddress'];
if (isset($o['TripMinutes'])) $this->TripMinutes = $o['TripMinutes'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->TripNumber)) $o['TripNumber'] = $this->TripNumber;
if (isset($this->StartPulsitId)) $o['StartPulsitId'] = $this->StartPulsitId;
if (isset($this->StartEventTime)) $o['StartEventTime'] = JsonConverters::to('DateTime', $this->StartEventTime);
if (isset($this->StartLatitude)) $o['StartLatitude'] = $this->StartLatitude;
if (isset($this->StartLongitude)) $o['StartLongitude'] = $this->StartLongitude;
if (isset($this->StartAddress)) $o['StartAddress'] = $this->StartAddress;
if (isset($this->StopPulsitId)) $o['StopPulsitId'] = $this->StopPulsitId;
if (isset($this->StopEventTime)) $o['StopEventTime'] = JsonConverters::to('DateTime', $this->StopEventTime);
if (isset($this->StopLatitude)) $o['StopLatitude'] = $this->StopLatitude;
if (isset($this->StopLongitude)) $o['StopLongitude'] = $this->StopLongitude;
if (isset($this->StopAddress)) $o['StopAddress'] = $this->StopAddress;
if (isset($this->TripMinutes)) $o['TripMinutes'] = $this->TripMinutes;
return empty($o) ? new class(){} : $o;
}
}
class PulsitModuleTripHistoryResponse extends ApiServiceResponse implements JsonSerializable
{
/**
* @param string|null $Description
* @param string|null $Heading
* @param bool|null $WasSuccessful
* @param Object|null $ModelState
*/
public function __construct(
?string $Description=null,
?string $Heading=null,
?bool $WasSuccessful=null,
?Object $ModelState=null,
/** @var array<PulsitTripHistoryItem>|null */
public ?array $Trips=null
) {
parent::__construct($Description,$Heading,$WasSuccessful,$ModelState);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Trips'])) $this->Trips = JsonConverters::fromArray('PulsitTripHistoryItem', $o['Trips']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Trips)) $o['Trips'] = JsonConverters::toArray('PulsitTripHistoryItem', $this->Trips);
return empty($o) ? new class(){} : $o;
}
}
class PulsitModuleTripHistoryRequest extends ApiServiceRequest implements JsonSerializable
{
/**
* @param string $ApiKey
*/
public function __construct(
string $ApiKey='',
/** @var string|null */
public ?string $PulsitModuleId=null,
/** @var string|null */
public ?string $StartDate=null,
/** @var string|null */
public ?string $EndDate=null
) {
parent::__construct($ApiKey);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['PulsitModuleId'])) $this->PulsitModuleId = $o['PulsitModuleId'];
if (isset($o['StartDate'])) $this->StartDate = $o['StartDate'];
if (isset($o['EndDate'])) $this->EndDate = $o['EndDate'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->PulsitModuleId)) $o['PulsitModuleId'] = $this->PulsitModuleId;
if (isset($this->StartDate)) $o['StartDate'] = $this->StartDate;
if (isset($this->EndDate)) $o['EndDate'] = $this->EndDate;
return empty($o) ? new class(){} : $o;
}
}
PHP PulsitModuleTripHistoryRequest 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 /pulsit/moduletriphistory HTTP/1.1 Host: galaxymobile.api.client.prod.86degrees.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<PulsitModuleTripHistoryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebService.ClientApi.Services">
<Description xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">String</Description>
<Heading xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">String</Heading>
<ModelState xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base" />
<WasSuccessful xmlns="http://schemas.datacontract.org/2004/07/CommonService.Api.Models.Base">false</WasSuccessful>
<Trips>
<PulsitTripHistoryItem>
<StartAddress>String</StartAddress>
<StartEventTime>0001-01-01T00:00:00</StartEventTime>
<StartLatitude>0</StartLatitude>
<StartLongitude>0</StartLongitude>
<StartPulsitId>String</StartPulsitId>
<StopAddress>String</StopAddress>
<StopEventTime>0001-01-01T00:00:00</StopEventTime>
<StopLatitude>0</StopLatitude>
<StopLongitude>0</StopLongitude>
<StopPulsitId>String</StopPulsitId>
<TripMinutes>0</TripMinutes>
<TripNumber>String</TripNumber>
</PulsitTripHistoryItem>
</Trips>
</PulsitModuleTripHistoryResponse>