Platform API

<back to all web services

UpdateQuadrant

Update quadrant context - create a new session, retrieve settings and return new JWT Token

Requires Authentication
The following routes are available for this service:
All Verbs/api/quadrantupdate/token
All Verbs/api/quadrantupdate
<?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 SettingModel implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $SettingId='',
        /** @var string|null */
        public ?string $SettingName=null,
        /** @var string|null */
        public ?string $SettingValue=null
    ) {
    }

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

class UpdateQuadrantResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $PerspectiveSessionId='',
        /** @var array<SettingModel>|null */
        public ?array $Settings=null,
        /** @var array<string>|null */
        public ?array $Permissions=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['PerspectiveSessionId'])) $this->PerspectiveSessionId = $o['PerspectiveSessionId'];
        if (isset($o['Settings'])) $this->Settings = JsonConverters::fromArray('SettingModel', $o['Settings']);
        if (isset($o['Permissions'])) $this->Permissions = JsonConverters::fromArray('Guid', $o['Permissions']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->PerspectiveSessionId)) $o['PerspectiveSessionId'] = $this->PerspectiveSessionId;
        if (isset($this->Settings)) $o['Settings'] = JsonConverters::toArray('SettingModel', $this->Settings);
        if (isset($this->Permissions)) $o['Permissions'] = JsonConverters::toArray('Guid', $this->Permissions);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class SessionModel implements JsonSerializable
{
    public function __construct(
        /** @description Create user session for the specified user name */
        // @ApiMember(Description="Create user session for the specified user name", IsRequired=true, Name="UserName")
        /** @var string */
        public string $UserName='',

        /** @description Local or External account */
        // @ApiMember(Description="Local or External account", IsRequired=true, Name="AuthProvider")
        /** @var string */
        public string $AuthProvider='',

        /** @description Current user profile context */
        // @ApiMember(Description="Current user profile context", IsRequired=true, Name="UserProfileId")
        /** @var string */
        public string $UserProfileId='',

        /** @description Current appliance context */
        // @ApiMember(Description="Current appliance context", IsRequired=true, Name="Appliance")
        /** @var string */
        public string $ApplianceId='',

        /** @description Current role context */
        // @ApiMember(Description="Current role context", IsRequired=true, Name="RoleId")
        /** @var string */
        public string $RoleId='',

        /** @description Current licensee context */
        // @ApiMember(Description="Current licensee context", IsRequired=true, Name="LicenseeConnectionId")
        /** @var string */
        public string $LicenseeConnectionId='',

        /** @description Has 'Remember Me' option been selected? */
        // @ApiMember(Description="Has 'Remember Me' option been selected?", Name="IsPersistent")
        /** @var bool|null */
        public ?bool $IsPersistent=null,

        /** @description Licensee contact id of the current licensee context */
        // @ApiMember(Description="Licensee contact id of the current licensee context", IsRequired=true, Name="LicenseeContactId")
        /** @var string */
        public string $LicenseeContactId='',

        /** @description Connection Id linking the current user profile to the current licensee context */
        // @ApiMember(Description="Connection Id linking the current user profile to the current licensee context", IsRequired=true, Name="UserContactRoleConnectionId")
        /** @var string */
        public string $UserContactRoleConnectionId=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['UserName'])) $this->UserName = $o['UserName'];
        if (isset($o['AuthProvider'])) $this->AuthProvider = $o['AuthProvider'];
        if (isset($o['UserProfileId'])) $this->UserProfileId = $o['UserProfileId'];
        if (isset($o['ApplianceId'])) $this->ApplianceId = $o['ApplianceId'];
        if (isset($o['RoleId'])) $this->RoleId = $o['RoleId'];
        if (isset($o['LicenseeConnectionId'])) $this->LicenseeConnectionId = $o['LicenseeConnectionId'];
        if (isset($o['IsPersistent'])) $this->IsPersistent = $o['IsPersistent'];
        if (isset($o['LicenseeContactId'])) $this->LicenseeContactId = $o['LicenseeContactId'];
        if (isset($o['UserContactRoleConnectionId'])) $this->UserContactRoleConnectionId = $o['UserContactRoleConnectionId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->UserName)) $o['UserName'] = $this->UserName;
        if (isset($this->AuthProvider)) $o['AuthProvider'] = $this->AuthProvider;
        if (isset($this->UserProfileId)) $o['UserProfileId'] = $this->UserProfileId;
        if (isset($this->ApplianceId)) $o['ApplianceId'] = $this->ApplianceId;
        if (isset($this->RoleId)) $o['RoleId'] = $this->RoleId;
        if (isset($this->LicenseeConnectionId)) $o['LicenseeConnectionId'] = $this->LicenseeConnectionId;
        if (isset($this->IsPersistent)) $o['IsPersistent'] = $this->IsPersistent;
        if (isset($this->LicenseeContactId)) $o['LicenseeContactId'] = $this->LicenseeContactId;
        if (isset($this->UserContactRoleConnectionId)) $o['UserContactRoleConnectionId'] = $this->UserContactRoleConnectionId;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Update quadrant context - create a new session, retrieve settings and return new JWT Token */
// @Api(Description="Update quadrant context - create a new session, retrieve settings and return new JWT Token")
class UpdateQuadrant implements JsonSerializable
{
    public function __construct(
        /** @var SessionModel|null */
        public ?SessionModel $Session=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Session'])) $this->Session = JsonConverters::from('SessionModel', $o['Session']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Session)) $o['Session'] = JsonConverters::to('SessionModel', $this->Session);
        return empty($o) ? new class(){} : $o;
    }
}

PHP UpdateQuadrant DTOs

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

HTTP + OTHER

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

POST /api/quadrantupdate/token HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Session":{"UserName":"String","AuthProvider":"String","UserProfileId":"00000000-0000-0000-0000-000000000000","ApplianceId":"00000000-0000-0000-0000-000000000000","RoleId":"00000000-0000-0000-0000-000000000000","LicenseeConnectionId":"00000000-0000-0000-0000-000000000000","IsPersistent":false,"LicenseeContactId":"00000000-0000-0000-0000-000000000000","UserContactRoleConnectionId":"00000000-0000-0000-0000-000000000000"}}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"PerspectiveSessionId":"00000000-0000-0000-0000-000000000000","Settings":[{"SettingId":"00000000-0000-0000-0000-000000000000","SettingName":"String","SettingValue":"String"}],"Permissions":["00000000-0000-0000-0000-000000000000"],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}