GalaxyMobile Client API

<back to all web services

PulsitTripHistoryDetailRequest

The following routes are available for this service:
GET/pulsit/triphistorydetail
<?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 PulsitTripHistoryEvent implements JsonSerializable
{
    public function __construct(
        /** @var float */
        public float $Latitude=0.0,
        /** @var float */
        public float $Longitude=0.0,
        /** @var string|null */
        public ?string $Address=null,
        /** @var int */
        public int $Speed=0,
        /** @var int */
        public int $Heading=0,
        /** @var int */
        public int $VehicleBatteryVolts=0,
        /** @var int */
        public int $ModuleBatteryVolts=0,
        /** @var string|null */
        public ?string $EventDescription=null,
        /** @var DateTime */
        public DateTime $EventTime=new DateTime()
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Latitude'])) $this->Latitude = $o['Latitude'];
        if (isset($o['Longitude'])) $this->Longitude = $o['Longitude'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['Speed'])) $this->Speed = $o['Speed'];
        if (isset($o['Heading'])) $this->Heading = $o['Heading'];
        if (isset($o['VehicleBatteryVolts'])) $this->VehicleBatteryVolts = $o['VehicleBatteryVolts'];
        if (isset($o['ModuleBatteryVolts'])) $this->ModuleBatteryVolts = $o['ModuleBatteryVolts'];
        if (isset($o['EventDescription'])) $this->EventDescription = $o['EventDescription'];
        if (isset($o['EventTime'])) $this->EventTime = JsonConverters::from('DateTime', $o['EventTime']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Latitude)) $o['Latitude'] = $this->Latitude;
        if (isset($this->Longitude)) $o['Longitude'] = $this->Longitude;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->Speed)) $o['Speed'] = $this->Speed;
        if (isset($this->Heading)) $o['Heading'] = $this->Heading;
        if (isset($this->VehicleBatteryVolts)) $o['VehicleBatteryVolts'] = $this->VehicleBatteryVolts;
        if (isset($this->ModuleBatteryVolts)) $o['ModuleBatteryVolts'] = $this->ModuleBatteryVolts;
        if (isset($this->EventDescription)) $o['EventDescription'] = $this->EventDescription;
        if (isset($this->EventTime)) $o['EventTime'] = JsonConverters::to('DateTime', $this->EventTime);
        return empty($o) ? new class(){} : $o;
    }
}

class PulsitTripHistoryDetailResponse 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 float */
        public float $Distance=0.0,
        /** @var array<PulsitTripHistoryEvent>|null */
        public ?array $Events=null
    ) {
        parent::__construct($Description,$Heading,$WasSuccessful,$ModelState);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['Distance'])) $this->Distance = $o['Distance'];
        if (isset($o['Events'])) $this->Events = JsonConverters::fromArray('PulsitTripHistoryEvent', $o['Events']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->Distance)) $o['Distance'] = $this->Distance;
        if (isset($this->Events)) $o['Events'] = JsonConverters::toArray('PulsitTripHistoryEvent', $this->Events);
        return empty($o) ? new class(){} : $o;
    }
}

class PulsitTripHistoryDetailRequest extends ApiServiceRequest implements JsonSerializable
{
    /**
     * @param string $ApiKey
     */
    public function __construct(
        string $ApiKey='',
        /** @var string|null */
        public ?string $PulsitModuleId=null,
        /** @var int */
        public int $PulsitStartId=0,
        /** @var int */
        public int $PulsitStopId=0
    ) {
        parent::__construct($ApiKey);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['PulsitModuleId'])) $this->PulsitModuleId = $o['PulsitModuleId'];
        if (isset($o['PulsitStartId'])) $this->PulsitStartId = $o['PulsitStartId'];
        if (isset($o['PulsitStopId'])) $this->PulsitStopId = $o['PulsitStopId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->PulsitModuleId)) $o['PulsitModuleId'] = $this->PulsitModuleId;
        if (isset($this->PulsitStartId)) $o['PulsitStartId'] = $this->PulsitStartId;
        if (isset($this->PulsitStopId)) $o['PulsitStopId'] = $this->PulsitStopId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP PulsitTripHistoryDetailRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /pulsit/triphistorydetail HTTP/1.1 
Host: galaxymobile.api.client.prod.86degrees.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Distance: 0,
	Events: 
	[
		{
			Latitude: 0,
			Longitude: 0,
			Address: String,
			Speed: 0,
			Heading: 0,
			VehicleBatteryVolts: 0,
			ModuleBatteryVolts: 0,
			EventDescription: String,
			EventTime: 0001-01-01
		}
	],
	Description: String,
	Heading: String,
	WasSuccessful: False,
	ModelState: {}
}