| GET | /galaxy/mylegalhand/history | Get the history of My Legal Hand Galaxy panic activations. |
|---|
<?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 BaseActivationHistoryRequest extends ApiServiceRequest implements JsonSerializable
{
/**
* @param string $ApiKey
*/
public function __construct(
string $ApiKey='',
/** @description ID Number of the user making this request. */
// @ApiMember(Description="ID Number of the user making this request.", IsRequired=true)
/** @var string */
public string $IdNumber=''
) {
parent::__construct($ApiKey);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
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 ActivationHistoryData implements JsonSerializable
{
public function __construct(
/** @description Date and Time of the activation in ISO 8601 format. */
// @ApiMember(Description="Date and Time of the activation in ISO 8601 format.")
/** @var string|null */
public ?string $DateActivated=null,
/** @description Latitude of the activation location. */
// @ApiMember(Description="Latitude of the activation location.")
/** @var float */
public float $Latitude=0.0,
/** @description Longitude of the activation location. */
// @ApiMember(Description="Longitude of the activation location.")
/** @var float */
public float $Longitude=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['DateActivated'])) $this->DateActivated = $o['DateActivated'];
if (isset($o['Latitude'])) $this->Latitude = $o['Latitude'];
if (isset($o['Longitude'])) $this->Longitude = $o['Longitude'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->DateActivated)) $o['DateActivated'] = $this->DateActivated;
if (isset($this->Latitude)) $o['Latitude'] = $this->Latitude;
if (isset($this->Longitude)) $o['Longitude'] = $this->Longitude;
return empty($o) ? new class(){} : $o;
}
}
class ActivationHistoryResponse 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,
/** @description Is the requested product set up and enabled on Galaxy. */
// @ApiMember(Description="Is the requested product set up and enabled on Galaxy.")
/** @var bool|null */
public ?bool $ProductAvailable=null,
/** @description Does the user have access to this product, based on their Galaxy profile. */
// @ApiMember(Description="Does the user have access to this product, based on their Galaxy profile.")
/** @var bool|null */
public ?bool $UserHasAccess=null,
/** @description A list of activation history instances, ordered by most recent first. */
// @ApiMember(Description="A list of activation history instances, ordered by most recent first.")
/** @var array<ActivationHistoryData>|null */
public ?array $ActivationHistory=null
) {
parent::__construct($Description,$Heading,$WasSuccessful,$ModelState);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['ProductAvailable'])) $this->ProductAvailable = $o['ProductAvailable'];
if (isset($o['UserHasAccess'])) $this->UserHasAccess = $o['UserHasAccess'];
if (isset($o['ActivationHistory'])) $this->ActivationHistory = JsonConverters::fromArray('ActivationHistoryData', $o['ActivationHistory']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->ProductAvailable)) $o['ProductAvailable'] = $this->ProductAvailable;
if (isset($this->UserHasAccess)) $o['UserHasAccess'] = $this->UserHasAccess;
if (isset($this->ActivationHistory)) $o['ActivationHistory'] = JsonConverters::toArray('ActivationHistoryData', $this->ActivationHistory);
return empty($o) ? new class(){} : $o;
}
}
class MyLegalHandHistoryRequest extends BaseActivationHistoryRequest implements JsonSerializable
{
/**
* @param string $ApiKey
* @param string $IdNumber
*/
public function __construct(
string $ApiKey='',
string $IdNumber=''
) {
parent::__construct($ApiKey,$IdNumber);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
PHP MyLegalHandHistoryRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /galaxy/mylegalhand/history HTTP/1.1 Host: galaxymobile.api.client.prod.86degrees.com Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ProductAvailable":false,"UserHasAccess":false,"ActivationHistory":[{}],"Description":"String","Heading":"String","WasSuccessful":false,"ModelState":{}}