Platform API

<back to all web services

RegisterDevice

Saves/Updates a Devices details and registers that device with an appliance.

Requires Authentication
<?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 DeviceTypeModel implements JsonSerializable
{
    public function __construct(
        /** @description Guid representing the saved Device Type */
        // @ApiMember(DataType="Guid", Description="Guid representing the saved Device Type", Name="DeviceTypeId", ParameterType="query")
        /** @var string */
        public string $DeviceTypeId='',

        /** @description Guid representing the saved Device Class */
        // @ApiMember(DataType="Guid", Description="Guid representing the saved Device Class", Name="DeviceClassId", ParameterType="query")
        /** @var string */
        public string $DeviceClassId='',

        /** @description The Device Class Name */
        // @ApiMember(DataType="string", Description="The Device Class Name", Name="DeviceClassName", ParameterType="query")
        /** @var string|null */
        public ?string $DeviceClassName=null,

        /** @description The Device Brand. */
        // @ApiMember(DataType="string", Description="The Device Brand.", Name="Brand", ParameterType="query")
        /** @var string|null */
        public ?string $Brand=null,

        /** @description The Device Model Name. */
        // @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
        /** @var string */
        public string $ModelName='',

        /** @description The Device Form, e.g Phone | Tablet. */
        // @ApiMember(DataType="string", Description="The Device Form, e.g Phone | Tablet.", Name="FormFactor", ParameterType="query")
        /** @var string|null */
        public ?string $FormFactor=null,

        /** @description The Device Dimensions (Height x Width x Depth). */
        // @ApiMember(DataType="string", Description="The Device Dimensions (Height x Width x Depth).", Name="Dimensions", ParameterType="query")
        /** @var string|null */
        public ?string $Dimensions=null,

        /** @description The Device display resolution width in pixels. */
        // @ApiMember(DataType="int", Description="The Device display resolution width in pixels.", Name="DisplayResolutionWidthPixels", ParameterType="query")
        /** @var int|null */
        public ?int $DisplayResolutionWidthPixels=null,

        /** @description The Device display resolution height in pixels. */
        // @ApiMember(DataType="int", Description="The Device display resolution height in pixels.", Name="DisplayResolutionHeightPixels", ParameterType="query")
        /** @var int|null */
        public ?int $DisplayResolutionHeightPixels=null,

        /** @description The Device display width size in inches. */
        // @ApiMember(DataType="decimal", Description="The Device display width size in inches.", Name="DisplaySizeWidthInches", ParameterType="query")
        /** @var float|null */
        public ?float $DisplaySizeWidthInches=null,

        /** @description The Device display height size in inches. */
        // @ApiMember(DataType="decimal", Description="The Device display height size in inches.", Name="DisplaySizeHeightInches", ParameterType="query")
        /** @var float|null */
        public ?float $DisplaySizeHeightInches=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DeviceTypeId'])) $this->DeviceTypeId = $o['DeviceTypeId'];
        if (isset($o['DeviceClassId'])) $this->DeviceClassId = $o['DeviceClassId'];
        if (isset($o['DeviceClassName'])) $this->DeviceClassName = $o['DeviceClassName'];
        if (isset($o['Brand'])) $this->Brand = $o['Brand'];
        if (isset($o['ModelName'])) $this->ModelName = $o['ModelName'];
        if (isset($o['FormFactor'])) $this->FormFactor = $o['FormFactor'];
        if (isset($o['Dimensions'])) $this->Dimensions = $o['Dimensions'];
        if (isset($o['DisplayResolutionWidthPixels'])) $this->DisplayResolutionWidthPixels = $o['DisplayResolutionWidthPixels'];
        if (isset($o['DisplayResolutionHeightPixels'])) $this->DisplayResolutionHeightPixels = $o['DisplayResolutionHeightPixels'];
        if (isset($o['DisplaySizeWidthInches'])) $this->DisplaySizeWidthInches = $o['DisplaySizeWidthInches'];
        if (isset($o['DisplaySizeHeightInches'])) $this->DisplaySizeHeightInches = $o['DisplaySizeHeightInches'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DeviceTypeId)) $o['DeviceTypeId'] = $this->DeviceTypeId;
        if (isset($this->DeviceClassId)) $o['DeviceClassId'] = $this->DeviceClassId;
        if (isset($this->DeviceClassName)) $o['DeviceClassName'] = $this->DeviceClassName;
        if (isset($this->Brand)) $o['Brand'] = $this->Brand;
        if (isset($this->ModelName)) $o['ModelName'] = $this->ModelName;
        if (isset($this->FormFactor)) $o['FormFactor'] = $this->FormFactor;
        if (isset($this->Dimensions)) $o['Dimensions'] = $this->Dimensions;
        if (isset($this->DisplayResolutionWidthPixels)) $o['DisplayResolutionWidthPixels'] = $this->DisplayResolutionWidthPixels;
        if (isset($this->DisplayResolutionHeightPixels)) $o['DisplayResolutionHeightPixels'] = $this->DisplayResolutionHeightPixels;
        if (isset($this->DisplaySizeWidthInches)) $o['DisplaySizeWidthInches'] = $this->DisplaySizeWidthInches;
        if (isset($this->DisplaySizeHeightInches)) $o['DisplaySizeHeightInches'] = $this->DisplaySizeHeightInches;
        return empty($o) ? new class(){} : $o;
    }
}

class DeviceHistoryModel implements JsonSerializable
{
    public function __construct(
        /** @description Guid representing the current Device History */
        // @ApiMember(DataType="Guid", Description="Guid representing the current Device History", Name="DeviceHistoryId", ParameterType="query")
        /** @var string */
        public string $DeviceHistoryId='',

        /** @description Guid representing the current Device History Device Configuration record. */
        // @ApiMember(DataType="Guid", Description="Guid representing the current Device History Device Configuration record.", Name="PrimaryDeviceHistoryDeviceConfigurationId", ParameterType="query")
        /** @var string */
        public string $PrimaryDeviceHistoryDeviceConfigurationId='',

        /** @description The Device name. */
        // @ApiMember(DataType="string", Description="The Device name.", Name="DeviceName", ParameterType="query")
        /** @var string|null */
        public ?string $DeviceName=null,

        /** @description The Device operating system. */
        // @ApiMember(DataType="string", Description="The Device operating system.", Name="OperatingSystem", ParameterType="query")
        /** @var string|null */
        public ?string $OperatingSystem=null,

        /** @description The Device operating system version. */
        // @ApiMember(DataType="string", Description="The Device operating system version.", Name="OperatingSystemVersion", ParameterType="query")
        /** @var string|null */
        public ?string $OperatingSystemVersion=null,

        /** @description The Device IP Address. */
        // @ApiMember(DataType="string", Description="The Device IP Address.", Name="IpAddress", ParameterType="query")
        /** @var string|null */
        public ?string $IpAddress=null,

        /** @description Any Notes about the device. */
        // @ApiMember(DataType="string", Description="Any Notes about the device.", Name="Notes", ParameterType="query")
        /** @var string|null */
        public ?string $Notes=null,

        /** @description Total memory size available (in bytes). */
        // @ApiMember(DataType="string", Description="Total memory size available (in bytes).", Name="TotalMemorySize", ParameterType="query")
        /** @var int|null */
        public ?int $TotalMemorySize=null,

        /** @description The Network provider name. */
        // @ApiMember(DataType="string", Description="The Network provider name.", Name="CellularProviderName", ParameterType="query")
        /** @var string|null */
        public ?string $CellularProviderName=null,

        /** @description The Mobile Country Code the device is currently located in. */
        // @ApiMember(DataType="string", Description="The Mobile Country Code the device is currently located in.", Name="MobileCountryCode", ParameterType="query")
        /** @var string|null */
        public ?string $MobileCountryCode=null,

        /** @description The Mobile Network Code the device is currently using. */
        // @ApiMember(DataType="string", Description="The Mobile Network Code the device is currently using.", Name="MobileNetworkCode", ParameterType="query")
        /** @var string|null */
        public ?string $MobileNetworkCode=null,

        /** @description The Language Code Identifier that represents the language used on the device. */
        // @ApiMember(DataType="string", Description="The Language Code Identifier that represents the language used on the device.", Name="LanguageCodeIdentifier", ParameterType="query")
        /** @var string|null */
        public ?string $LanguageCodeIdentifier=null,

        /** @description The latitude the device was last located at. */
        // @ApiMember(DataType="double", Description="The latitude the device was last located at.", Name="Latitude", ParameterType="query")
        /** @var float */
        public float $Latitude=0.0,

        /** @description The longitude the device was last located at. */
        // @ApiMember(DataType="double", Description="The longitude the device was last located at.", Name="Longitude", ParameterType="query")
        /** @var float */
        public float $Longitude=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DeviceHistoryId'])) $this->DeviceHistoryId = $o['DeviceHistoryId'];
        if (isset($o['PrimaryDeviceHistoryDeviceConfigurationId'])) $this->PrimaryDeviceHistoryDeviceConfigurationId = $o['PrimaryDeviceHistoryDeviceConfigurationId'];
        if (isset($o['DeviceName'])) $this->DeviceName = $o['DeviceName'];
        if (isset($o['OperatingSystem'])) $this->OperatingSystem = $o['OperatingSystem'];
        if (isset($o['OperatingSystemVersion'])) $this->OperatingSystemVersion = $o['OperatingSystemVersion'];
        if (isset($o['IpAddress'])) $this->IpAddress = $o['IpAddress'];
        if (isset($o['Notes'])) $this->Notes = $o['Notes'];
        if (isset($o['TotalMemorySize'])) $this->TotalMemorySize = $o['TotalMemorySize'];
        if (isset($o['CellularProviderName'])) $this->CellularProviderName = $o['CellularProviderName'];
        if (isset($o['MobileCountryCode'])) $this->MobileCountryCode = $o['MobileCountryCode'];
        if (isset($o['MobileNetworkCode'])) $this->MobileNetworkCode = $o['MobileNetworkCode'];
        if (isset($o['LanguageCodeIdentifier'])) $this->LanguageCodeIdentifier = $o['LanguageCodeIdentifier'];
        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->DeviceHistoryId)) $o['DeviceHistoryId'] = $this->DeviceHistoryId;
        if (isset($this->PrimaryDeviceHistoryDeviceConfigurationId)) $o['PrimaryDeviceHistoryDeviceConfigurationId'] = $this->PrimaryDeviceHistoryDeviceConfigurationId;
        if (isset($this->DeviceName)) $o['DeviceName'] = $this->DeviceName;
        if (isset($this->OperatingSystem)) $o['OperatingSystem'] = $this->OperatingSystem;
        if (isset($this->OperatingSystemVersion)) $o['OperatingSystemVersion'] = $this->OperatingSystemVersion;
        if (isset($this->IpAddress)) $o['IpAddress'] = $this->IpAddress;
        if (isset($this->Notes)) $o['Notes'] = $this->Notes;
        if (isset($this->TotalMemorySize)) $o['TotalMemorySize'] = $this->TotalMemorySize;
        if (isset($this->CellularProviderName)) $o['CellularProviderName'] = $this->CellularProviderName;
        if (isset($this->MobileCountryCode)) $o['MobileCountryCode'] = $this->MobileCountryCode;
        if (isset($this->MobileNetworkCode)) $o['MobileNetworkCode'] = $this->MobileNetworkCode;
        if (isset($this->LanguageCodeIdentifier)) $o['LanguageCodeIdentifier'] = $this->LanguageCodeIdentifier;
        if (isset($this->Latitude)) $o['Latitude'] = $this->Latitude;
        if (isset($this->Longitude)) $o['Longitude'] = $this->Longitude;
        return empty($o) ? new class(){} : $o;
    }
}

class DeviceModel implements JsonSerializable
{
    public function __construct(
        /** @description Guid representing the saved Device */
        // @ApiMember(DataType="Guid", Description="Guid representing the saved Device", Name="DeviceId", ParameterType="query")
        /** @var string */
        public string $DeviceId='',

        /** @description Details of the Type of Device */
        // @ApiMember(DataType="DeviceTypeModel", Description="Details of the Type of Device", Name="DeviceType", ParameterType="query")
        /** @var DeviceTypeModel|null */
        public ?DeviceTypeModel $DeviceType=null,

        /** @description Current saved settings of the Device */
        // @ApiMember(DataType="DeviceHistoryModel", Description="Current saved settings of the Device", Name="CurrentHistory", ParameterType="query")
        /** @var DeviceHistoryModel|null */
        public ?DeviceHistoryModel $CurrentHistory=null,

        /** @description The Device Model Name. */
        // @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
        /** @var string */
        public string $ModelName='',

        /** @description The Device model number. */
        // @ApiMember(DataType="string", Description="The Device model number.", Name="ModelNumber", ParameterType="query")
        /** @var string|null */
        public ?string $ModelNumber=null,

        /** @description The Device serial number. */
        // @ApiMember(DataType="string", Description="The Device serial number.", Name="SerialNumber", ParameterType="query")
        /** @var string|null */
        public ?string $SerialNumber=null,

        /** @description The Device manufacturers number. */
        // @ApiMember(DataType="string", Description="The Device manufacturers number.", Name="ManufacturerDeviceNumber", ParameterType="query")
        /** @var string|null */
        public ?string $ManufacturerDeviceNumber=null,

        /** @description The Device MAC Address. */
        // @ApiMember(DataType="string", Description="The Device MAC Address.", Name="MacAddress", ParameterType="query")
        /** @var string|null */
        public ?string $MacAddress=null,

        /** @description The current value of InstanceSeed that the device has stored.  If InstanceCounterLastValue has gone over 99999, this will contain a new seed value for the device. */
        // @ApiMember(DataType="int", Description="The current value of InstanceSeed that the device has stored.  If InstanceCounterLastValue has gone over 99999, this will contain a new seed value for the device.", IsRequired=true, Name="InstanceSeed", ParameterType="query")
        /** @var int */
        public int $InstanceSeed=0,

        /** @description The current value of InstanceCounterLastValue that the device has stored */
        // @ApiMember(DataType="int", Description="The current value of InstanceCounterLastValue that the device has stored", IsRequired=true, Name="InstanceCounterLastValue", ParameterType="query")
        /** @var int */
        public int $InstanceCounterLastValue=0,

        /** @description ServiceStack ResponseStatus. */
        // @ApiMember(DataType="ResponseStatus", Description="ServiceStack ResponseStatus.", Name="ResponseStatus", ParameterType="query")
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DeviceId'])) $this->DeviceId = $o['DeviceId'];
        if (isset($o['DeviceType'])) $this->DeviceType = JsonConverters::from('DeviceTypeModel', $o['DeviceType']);
        if (isset($o['CurrentHistory'])) $this->CurrentHistory = JsonConverters::from('DeviceHistoryModel', $o['CurrentHistory']);
        if (isset($o['ModelName'])) $this->ModelName = $o['ModelName'];
        if (isset($o['ModelNumber'])) $this->ModelNumber = $o['ModelNumber'];
        if (isset($o['SerialNumber'])) $this->SerialNumber = $o['SerialNumber'];
        if (isset($o['ManufacturerDeviceNumber'])) $this->ManufacturerDeviceNumber = $o['ManufacturerDeviceNumber'];
        if (isset($o['MacAddress'])) $this->MacAddress = $o['MacAddress'];
        if (isset($o['InstanceSeed'])) $this->InstanceSeed = $o['InstanceSeed'];
        if (isset($o['InstanceCounterLastValue'])) $this->InstanceCounterLastValue = $o['InstanceCounterLastValue'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DeviceId)) $o['DeviceId'] = $this->DeviceId;
        if (isset($this->DeviceType)) $o['DeviceType'] = JsonConverters::to('DeviceTypeModel', $this->DeviceType);
        if (isset($this->CurrentHistory)) $o['CurrentHistory'] = JsonConverters::to('DeviceHistoryModel', $this->CurrentHistory);
        if (isset($this->ModelName)) $o['ModelName'] = $this->ModelName;
        if (isset($this->ModelNumber)) $o['ModelNumber'] = $this->ModelNumber;
        if (isset($this->SerialNumber)) $o['SerialNumber'] = $this->SerialNumber;
        if (isset($this->ManufacturerDeviceNumber)) $o['ManufacturerDeviceNumber'] = $this->ManufacturerDeviceNumber;
        if (isset($this->MacAddress)) $o['MacAddress'] = $this->MacAddress;
        if (isset($this->InstanceSeed)) $o['InstanceSeed'] = $this->InstanceSeed;
        if (isset($this->InstanceCounterLastValue)) $o['InstanceCounterLastValue'] = $this->InstanceCounterLastValue;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Saves/Updates a Devices details and registers that device with an appliance. */
// @Api(Description="Saves/Updates a Devices details and registers that device with an appliance.")
class RegisterDevice implements JsonSerializable
{
    public function __construct(
        /** @description Guid of the Appliance this Device is Registering under. */
        // @ApiMember(DataType="Guid", Description="Guid of the Appliance this Device is Registering under.", IsRequired=true, Name="ApplianceId", ParameterType="query")
        /** @var string */
        public string $ApplianceId='',

        /** @description Guid of the Device. If empty the Device will be inserted, if provided the device will be updated. */
        // @ApiMember(DataType="Guid", Description="Guid of the Device. If empty the Device will be inserted, if provided the device will be updated.", IsRequired=true, Name="DeviceId", ParameterType="query")
        /** @var string */
        public string $DeviceId='',

        /** @description The Device manufacturers number. */
        // @ApiMember(DataType="string", Description="The Device manufacturers number.", Name="ManufacturerDeviceNumber", ParameterType="query")
        /** @var string|null */
        public ?string $ManufacturerDeviceNumber=null,

        /** @description The Device MAC Address. */
        // @ApiMember(DataType="string", Description="The Device MAC Address.", Name="MacAddress", ParameterType="query")
        /** @var string|null */
        public ?string $MacAddress=null,

        /** @description The Device Model Name. */
        // @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
        /** @var string */
        public string $ModelName='',

        /** @description The Device Form, e.g Phone | Tablet. */
        // @ApiMember(DataType="string", Description="The Device Form, e.g Phone | Tablet.", IsRequired=true, Name="FormFactor", ParameterType="query")
        /** @var string */
        public string $FormFactor='',

        /** @description The Device Brand. */
        // @ApiMember(DataType="string", Description="The Device Brand.", Name="Brand", ParameterType="query")
        /** @var string|null */
        public ?string $Brand=null,

        /** @description The Device Dimensions (Height x Width x Depth). */
        // @ApiMember(DataType="string", Description="The Device Dimensions (Height x Width x Depth).", Name="Dimensions", ParameterType="query")
        /** @var string|null */
        public ?string $Dimensions=null,

        /** @description The Device display resolution width in pixels. */
        // @ApiMember(DataType="int", Description="The Device display resolution width in pixels.", Name="DisplayResolutionWidthPixels", ParameterType="query")
        /** @var int|null */
        public ?int $DisplayResolutionWidthPixels=null,

        /** @description The Device display resolution height in pixels. */
        // @ApiMember(DataType="int", Description="The Device display resolution height in pixels.", Name="DisplayResolutionHeightPixels", ParameterType="query")
        /** @var int|null */
        public ?int $DisplayResolutionHeightPixels=null,

        /** @description The Device display width size in inches. */
        // @ApiMember(DataType="decimal", Description="The Device display width size in inches.", Name="DisplaySizeWidthInches", ParameterType="query")
        /** @var float|null */
        public ?float $DisplaySizeWidthInches=null,

        /** @description The Device display height size in inches. */
        // @ApiMember(DataType="decimal", Description="The Device display height size in inches.", Name="DisplaySizeHeightInches", ParameterType="query")
        /** @var float|null */
        public ?float $DisplaySizeHeightInches=null,

        /** @description The Device operating system. */
        // @ApiMember(DataType="string", Description="The Device operating system.", Name="OperatingSystem", ParameterType="query")
        /** @var string|null */
        public ?string $OperatingSystem=null,

        /** @description The Device operating system version. */
        // @ApiMember(DataType="string", Description="The Device operating system version.", Name="OperatingSystemVersion", ParameterType="query")
        /** @var string|null */
        public ?string $OperatingSystemVersion=null,

        /** @description The Device IP Address. */
        // @ApiMember(DataType="string", Description="The Device IP Address.", Name="IpAddress", ParameterType="query")
        /** @var string|null */
        public ?string $IpAddress=null,

        /** @description Any Notes about the device. */
        // @ApiMember(DataType="string", Description="Any Notes about the device.", Name="Notes", ParameterType="query")
        /** @var string|null */
        public ?string $Notes=null,

        /** @description Total memory size available (in bytes). */
        // @ApiMember(DataType="string", Description="Total memory size available (in bytes).", Name="TotalMemorySize", ParameterType="query")
        /** @var int|null */
        public ?int $TotalMemorySize=null,

        /** @description The Network provider name. */
        // @ApiMember(DataType="string", Description="The Network provider name.", Name="CellularProviderName", ParameterType="query")
        /** @var string|null */
        public ?string $CellularProviderName=null,

        /** @description The ISO Country Code of the country the device is currently located in. */
        // @ApiMember(DataType="string", Description="The ISO Country Code of the country the device is currently located in.", Name="ISOCountryCode", ParameterType="query")
        /** @var string|null */
        public ?string $ISOCountryCode=null,

        /** @description The Mobile Country Code the device is currently located in. */
        // @ApiMember(DataType="string", Description="The Mobile Country Code the device is currently located in.", Name="MobileCountryCode", ParameterType="query")
        /** @var string|null */
        public ?string $MobileCountryCode=null,

        /** @description The Mobile Network Code the device is currently using. */
        // @ApiMember(DataType="string", Description="The Mobile Network Code the device is currently using.", Name="MobileNetworkCode", ParameterType="query")
        /** @var string|null */
        public ?string $MobileNetworkCode=null,

        /** @description The Language Code Identifier that represents the language used on the device. */
        // @ApiMember(DataType="string", Description="The Language Code Identifier that represents the language used on the device.", Name="LanguageCodeIdentifier", ParameterType="query")
        /** @var string|null */
        public ?string $LanguageCodeIdentifier=null,

        /** @description The name of the Timezone the device was last used in. */
        // @ApiMember(DataType="string", Description="The name of the Timezone the device was last used in.", Name="LastKnownTimeZone", ParameterType="query")
        /** @var string|null */
        public ?string $LastKnownTimeZone=null,

        /** @description The UTC Offset of the Timezone the device was last used in.  Formatted as +-##:## */
        // @ApiMember(DataType="string", Description="The UTC Offset of the Timezone the device was last used in.  Formatted as +-##:##", Name="LastKnownTimeZoneOffset", ParameterType="query")
        /** @var string|null */
        public ?string $LastKnownTimeZoneOffset=null,

        /** @description The latitude the device was last located at. */
        // @ApiMember(DataType="double", Description="The latitude the device was last located at.", IsRequired=true, Name="Latitude", ParameterType="query")
        /** @var float */
        public float $Latitude=0.0,

        /** @description The longitude the device was last located at. */
        // @ApiMember(DataType="double", Description="The longitude the device was last located at.", IsRequired=true, Name="Longitude", ParameterType="query")
        /** @var float */
        public float $Longitude=0.0,

        /** @description The current value of InstanceSeed that the device has stored. */
        // @ApiMember(DataType="int", Description="The current value of InstanceSeed that the device has stored.", IsRequired=true, Name="InstanceSeed", ParameterType="query")
        /** @var int */
        public int $InstanceSeed=0,

        /** @description The current value of InstanceCounterLastValue that the device has stored */
        // @ApiMember(DataType="int", Description="The current value of InstanceCounterLastValue that the device has stored", IsRequired=true, Name="InstanceCounterLastValue", ParameterType="query")
        /** @var int */
        public int $InstanceCounterLastValue=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ApplianceId'])) $this->ApplianceId = $o['ApplianceId'];
        if (isset($o['DeviceId'])) $this->DeviceId = $o['DeviceId'];
        if (isset($o['ManufacturerDeviceNumber'])) $this->ManufacturerDeviceNumber = $o['ManufacturerDeviceNumber'];
        if (isset($o['MacAddress'])) $this->MacAddress = $o['MacAddress'];
        if (isset($o['ModelName'])) $this->ModelName = $o['ModelName'];
        if (isset($o['FormFactor'])) $this->FormFactor = $o['FormFactor'];
        if (isset($o['Brand'])) $this->Brand = $o['Brand'];
        if (isset($o['Dimensions'])) $this->Dimensions = $o['Dimensions'];
        if (isset($o['DisplayResolutionWidthPixels'])) $this->DisplayResolutionWidthPixels = $o['DisplayResolutionWidthPixels'];
        if (isset($o['DisplayResolutionHeightPixels'])) $this->DisplayResolutionHeightPixels = $o['DisplayResolutionHeightPixels'];
        if (isset($o['DisplaySizeWidthInches'])) $this->DisplaySizeWidthInches = $o['DisplaySizeWidthInches'];
        if (isset($o['DisplaySizeHeightInches'])) $this->DisplaySizeHeightInches = $o['DisplaySizeHeightInches'];
        if (isset($o['OperatingSystem'])) $this->OperatingSystem = $o['OperatingSystem'];
        if (isset($o['OperatingSystemVersion'])) $this->OperatingSystemVersion = $o['OperatingSystemVersion'];
        if (isset($o['IpAddress'])) $this->IpAddress = $o['IpAddress'];
        if (isset($o['Notes'])) $this->Notes = $o['Notes'];
        if (isset($o['TotalMemorySize'])) $this->TotalMemorySize = $o['TotalMemorySize'];
        if (isset($o['CellularProviderName'])) $this->CellularProviderName = $o['CellularProviderName'];
        if (isset($o['ISOCountryCode'])) $this->ISOCountryCode = $o['ISOCountryCode'];
        if (isset($o['MobileCountryCode'])) $this->MobileCountryCode = $o['MobileCountryCode'];
        if (isset($o['MobileNetworkCode'])) $this->MobileNetworkCode = $o['MobileNetworkCode'];
        if (isset($o['LanguageCodeIdentifier'])) $this->LanguageCodeIdentifier = $o['LanguageCodeIdentifier'];
        if (isset($o['LastKnownTimeZone'])) $this->LastKnownTimeZone = $o['LastKnownTimeZone'];
        if (isset($o['LastKnownTimeZoneOffset'])) $this->LastKnownTimeZoneOffset = $o['LastKnownTimeZoneOffset'];
        if (isset($o['Latitude'])) $this->Latitude = $o['Latitude'];
        if (isset($o['Longitude'])) $this->Longitude = $o['Longitude'];
        if (isset($o['InstanceSeed'])) $this->InstanceSeed = $o['InstanceSeed'];
        if (isset($o['InstanceCounterLastValue'])) $this->InstanceCounterLastValue = $o['InstanceCounterLastValue'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ApplianceId)) $o['ApplianceId'] = $this->ApplianceId;
        if (isset($this->DeviceId)) $o['DeviceId'] = $this->DeviceId;
        if (isset($this->ManufacturerDeviceNumber)) $o['ManufacturerDeviceNumber'] = $this->ManufacturerDeviceNumber;
        if (isset($this->MacAddress)) $o['MacAddress'] = $this->MacAddress;
        if (isset($this->ModelName)) $o['ModelName'] = $this->ModelName;
        if (isset($this->FormFactor)) $o['FormFactor'] = $this->FormFactor;
        if (isset($this->Brand)) $o['Brand'] = $this->Brand;
        if (isset($this->Dimensions)) $o['Dimensions'] = $this->Dimensions;
        if (isset($this->DisplayResolutionWidthPixels)) $o['DisplayResolutionWidthPixels'] = $this->DisplayResolutionWidthPixels;
        if (isset($this->DisplayResolutionHeightPixels)) $o['DisplayResolutionHeightPixels'] = $this->DisplayResolutionHeightPixels;
        if (isset($this->DisplaySizeWidthInches)) $o['DisplaySizeWidthInches'] = $this->DisplaySizeWidthInches;
        if (isset($this->DisplaySizeHeightInches)) $o['DisplaySizeHeightInches'] = $this->DisplaySizeHeightInches;
        if (isset($this->OperatingSystem)) $o['OperatingSystem'] = $this->OperatingSystem;
        if (isset($this->OperatingSystemVersion)) $o['OperatingSystemVersion'] = $this->OperatingSystemVersion;
        if (isset($this->IpAddress)) $o['IpAddress'] = $this->IpAddress;
        if (isset($this->Notes)) $o['Notes'] = $this->Notes;
        if (isset($this->TotalMemorySize)) $o['TotalMemorySize'] = $this->TotalMemorySize;
        if (isset($this->CellularProviderName)) $o['CellularProviderName'] = $this->CellularProviderName;
        if (isset($this->ISOCountryCode)) $o['ISOCountryCode'] = $this->ISOCountryCode;
        if (isset($this->MobileCountryCode)) $o['MobileCountryCode'] = $this->MobileCountryCode;
        if (isset($this->MobileNetworkCode)) $o['MobileNetworkCode'] = $this->MobileNetworkCode;
        if (isset($this->LanguageCodeIdentifier)) $o['LanguageCodeIdentifier'] = $this->LanguageCodeIdentifier;
        if (isset($this->LastKnownTimeZone)) $o['LastKnownTimeZone'] = $this->LastKnownTimeZone;
        if (isset($this->LastKnownTimeZoneOffset)) $o['LastKnownTimeZoneOffset'] = $this->LastKnownTimeZoneOffset;
        if (isset($this->Latitude)) $o['Latitude'] = $this->Latitude;
        if (isset($this->Longitude)) $o['Longitude'] = $this->Longitude;
        if (isset($this->InstanceSeed)) $o['InstanceSeed'] = $this->InstanceSeed;
        if (isset($this->InstanceCounterLastValue)) $o['InstanceCounterLastValue'] = $this->InstanceCounterLastValue;
        return empty($o) ? new class(){} : $o;
    }
}

PHP RegisterDevice DTOs

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

HTTP + XML

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

POST /xml/reply/RegisterDevice HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<RegisterDevice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
  <ApplianceId>00000000-0000-0000-0000-000000000000</ApplianceId>
  <Brand>String</Brand>
  <CellularProviderName>String</CellularProviderName>
  <DeviceId>00000000-0000-0000-0000-000000000000</DeviceId>
  <Dimensions>String</Dimensions>
  <DisplayResolutionHeightPixels>0</DisplayResolutionHeightPixels>
  <DisplayResolutionWidthPixels>0</DisplayResolutionWidthPixels>
  <DisplaySizeHeightInches>0</DisplaySizeHeightInches>
  <DisplaySizeWidthInches>0</DisplaySizeWidthInches>
  <FormFactor>String</FormFactor>
  <ISOCountryCode>String</ISOCountryCode>
  <InstanceCounterLastValue>0</InstanceCounterLastValue>
  <InstanceSeed>0</InstanceSeed>
  <IpAddress>String</IpAddress>
  <LanguageCodeIdentifier>String</LanguageCodeIdentifier>
  <LastKnownTimeZone>String</LastKnownTimeZone>
  <LastKnownTimeZoneOffset>String</LastKnownTimeZoneOffset>
  <Latitude>0</Latitude>
  <Longitude>0</Longitude>
  <MacAddress>String</MacAddress>
  <ManufacturerDeviceNumber>String</ManufacturerDeviceNumber>
  <MobileCountryCode>String</MobileCountryCode>
  <MobileNetworkCode>String</MobileNetworkCode>
  <ModelName>String</ModelName>
  <Notes>String</Notes>
  <OperatingSystem>String</OperatingSystem>
  <OperatingSystemVersion>String</OperatingSystemVersion>
  <TotalMemorySize>0</TotalMemorySize>
</RegisterDevice>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DeviceModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
  <CurrentHistory>
    <CellularProviderName>String</CellularProviderName>
    <DeviceHistoryId>00000000-0000-0000-0000-000000000000</DeviceHistoryId>
    <DeviceName>String</DeviceName>
    <IpAddress>String</IpAddress>
    <LanguageCodeIdentifier>String</LanguageCodeIdentifier>
    <Latitude>0</Latitude>
    <Longitude>0</Longitude>
    <MobileCountryCode>String</MobileCountryCode>
    <MobileNetworkCode>String</MobileNetworkCode>
    <Notes>String</Notes>
    <OperatingSystem>String</OperatingSystem>
    <OperatingSystemVersion>String</OperatingSystemVersion>
    <PrimaryDeviceHistoryDeviceConfigurationId>00000000-0000-0000-0000-000000000000</PrimaryDeviceHistoryDeviceConfigurationId>
    <TotalMemorySize>0</TotalMemorySize>
  </CurrentHistory>
  <DeviceId>00000000-0000-0000-0000-000000000000</DeviceId>
  <DeviceType>
    <Brand>String</Brand>
    <DeviceClassId>00000000-0000-0000-0000-000000000000</DeviceClassId>
    <DeviceClassName>String</DeviceClassName>
    <DeviceTypeId>00000000-0000-0000-0000-000000000000</DeviceTypeId>
    <Dimensions>String</Dimensions>
    <DisplayResolutionHeightPixels>0</DisplayResolutionHeightPixels>
    <DisplayResolutionWidthPixels>0</DisplayResolutionWidthPixels>
    <DisplaySizeHeightInches>0</DisplaySizeHeightInches>
    <DisplaySizeWidthInches>0</DisplaySizeWidthInches>
    <FormFactor>String</FormFactor>
    <ModelName>String</ModelName>
  </DeviceType>
  <InstanceCounterLastValue>0</InstanceCounterLastValue>
  <InstanceSeed>0</InstanceSeed>
  <MacAddress>String</MacAddress>
  <ManufacturerDeviceNumber>String</ManufacturerDeviceNumber>
  <ModelName>String</ModelName>
  <ModelNumber>String</ModelNumber>
  <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>
  <SerialNumber>String</SerialNumber>
</DeviceModel>