FrameAppWS

<back to all web services

CustomUserSession

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};


/**
 * @property string|null $Provider
 * @property string|null $UserId
 * @property string|null $AccessToken
 * @property string|null $AccessTokenSecret
 * @property string|null $RefreshToken
 * @property DateTime|null $RefreshTokenExpiry
 * @property string|null $RequestToken
 * @property string|null $RequestTokenSecret
 * @property array<string,string>|null $Items
 */
interface IAuthTokens
{
}

// @DataContract
class AuthUserSession implements IMeta, JsonSerializable
{
    public function __construct(
        // @DataMember(Order=1)
        /** @var string|null */
        public ?string $ReferrerUrl=null,

        // @DataMember(Order=2)
        /** @var string|null */
        public ?string $Id=null,

        // @DataMember(Order=3)
        /** @var string|null */
        public ?string $UserAuthId=null,

        // @DataMember(Order=4)
        /** @var string|null */
        public ?string $UserAuthName=null,

        // @DataMember(Order=5)
        /** @var string|null */
        public ?string $UserName=null,

        // @DataMember(Order=6)
        /** @var string|null */
        public ?string $TwitterUserId=null,

        // @DataMember(Order=7)
        /** @var string|null */
        public ?string $TwitterScreenName=null,

        // @DataMember(Order=8)
        /** @var string|null */
        public ?string $FacebookUserId=null,

        // @DataMember(Order=9)
        /** @var string|null */
        public ?string $FacebookUserName=null,

        // @DataMember(Order=10)
        /** @var string|null */
        public ?string $FirstName=null,

        // @DataMember(Order=11)
        /** @var string|null */
        public ?string $LastName=null,

        // @DataMember(Order=12)
        /** @var string|null */
        public ?string $DisplayName=null,

        // @DataMember(Order=13)
        /** @var string|null */
        public ?string $Company=null,

        // @DataMember(Order=14)
        /** @var string|null */
        public ?string $Email=null,

        // @DataMember(Order=15)
        /** @var string|null */
        public ?string $PrimaryEmail=null,

        // @DataMember(Order=16)
        /** @var string|null */
        public ?string $PhoneNumber=null,

        // @DataMember(Order=17)
        /** @var DateTime|null */
        public ?DateTime $BirthDate=null,

        // @DataMember(Order=18)
        /** @var string|null */
        public ?string $BirthDateRaw=null,

        // @DataMember(Order=19)
        /** @var string|null */
        public ?string $Address=null,

        // @DataMember(Order=20)
        /** @var string|null */
        public ?string $Address2=null,

        // @DataMember(Order=21)
        /** @var string|null */
        public ?string $City=null,

        // @DataMember(Order=22)
        /** @var string|null */
        public ?string $State=null,

        // @DataMember(Order=23)
        /** @var string|null */
        public ?string $Country=null,

        // @DataMember(Order=24)
        /** @var string|null */
        public ?string $Culture=null,

        // @DataMember(Order=25)
        /** @var string|null */
        public ?string $FullName=null,

        // @DataMember(Order=26)
        /** @var string|null */
        public ?string $Gender=null,

        // @DataMember(Order=27)
        /** @var string|null */
        public ?string $Language=null,

        // @DataMember(Order=28)
        /** @var string|null */
        public ?string $MailAddress=null,

        // @DataMember(Order=29)
        /** @var string|null */
        public ?string $Nickname=null,

        // @DataMember(Order=30)
        /** @var string|null */
        public ?string $PostalCode=null,

        // @DataMember(Order=31)
        /** @var string|null */
        public ?string $TimeZone=null,

        // @DataMember(Order=32)
        /** @var string|null */
        public ?string $RequestTokenSecret=null,

        // @DataMember(Order=33)
        /** @var DateTime */
        public DateTime $CreatedAt=new DateTime(),

        // @DataMember(Order=34)
        /** @var DateTime */
        public DateTime $LastModified=new DateTime(),

        // @DataMember(Order=35)
        /** @var array<string>|null */
        public ?array $Roles=null,

        // @DataMember(Order=36)
        /** @var array<string>|null */
        public ?array $Permissions=null,

        // @DataMember(Order=37)
        /** @var bool|null */
        public ?bool $IsAuthenticated=null,

        // @DataMember(Order=38)
        /** @var bool|null */
        public ?bool $FromToken=null,

        // @DataMember(Order=39)
        /** @var string|null */
        public ?string $ProfileUrl=null,

        // @DataMember(Order=40)
        /** @var string|null */
        public ?string $Sequence=null,

        // @DataMember(Order=41)
        /** @var int */
        public int $Tag=0,

        // @DataMember(Order=42)
        /** @var string|null */
        public ?string $AuthProvider=null,

        // @DataMember(Order=43)
        /** @var array<IAuthTokens>|null */
        public ?array $ProviderOAuthAccess=null,

        // @DataMember(Order=44)
        /** @var array<string,string>|null */
        public ?array $Meta=null,

        // @DataMember(Order=45)
        /** @var array<string>|null */
        public ?array $Audiences=null,

        // @DataMember(Order=46)
        /** @var array<string>|null */
        public ?array $Scopes=null,

        // @DataMember(Order=47)
        /** @var string|null */
        public ?string $Dns=null,

        // @DataMember(Order=48)
        /** @var string|null */
        public ?string $Rsa=null,

        // @DataMember(Order=49)
        /** @var string|null */
        public ?string $Sid=null,

        // @DataMember(Order=50)
        /** @var string|null */
        public ?string $Hash=null,

        // @DataMember(Order=51)
        /** @var string|null */
        public ?string $HomePhone=null,

        // @DataMember(Order=52)
        /** @var string|null */
        public ?string $MobilePhone=null,

        // @DataMember(Order=53)
        /** @var string|null */
        public ?string $Webpage=null,

        // @DataMember(Order=54)
        /** @var bool|null */
        public ?bool $EmailConfirmed=null,

        // @DataMember(Order=55)
        /** @var bool|null */
        public ?bool $PhoneNumberConfirmed=null,

        // @DataMember(Order=56)
        /** @var bool|null */
        public ?bool $TwoFactorEnabled=null,

        // @DataMember(Order=57)
        /** @var string|null */
        public ?string $SecurityStamp=null,

        // @DataMember(Order=58)
        /** @var string|null */
        public ?string $Type=null,

        // @DataMember(Order=59)
        /** @var string|null */
        public ?string $RecoveryToken=null,

        // @DataMember(Order=60)
        /** @var int|null */
        public ?int $RefId=null,

        // @DataMember(Order=61)
        /** @var string|null */
        public ?string $RefIdStr=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ReferrerUrl'])) $this->ReferrerUrl = $o['ReferrerUrl'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['UserAuthId'])) $this->UserAuthId = $o['UserAuthId'];
        if (isset($o['UserAuthName'])) $this->UserAuthName = $o['UserAuthName'];
        if (isset($o['UserName'])) $this->UserName = $o['UserName'];
        if (isset($o['TwitterUserId'])) $this->TwitterUserId = $o['TwitterUserId'];
        if (isset($o['TwitterScreenName'])) $this->TwitterScreenName = $o['TwitterScreenName'];
        if (isset($o['FacebookUserId'])) $this->FacebookUserId = $o['FacebookUserId'];
        if (isset($o['FacebookUserName'])) $this->FacebookUserName = $o['FacebookUserName'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['DisplayName'])) $this->DisplayName = $o['DisplayName'];
        if (isset($o['Company'])) $this->Company = $o['Company'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['PrimaryEmail'])) $this->PrimaryEmail = $o['PrimaryEmail'];
        if (isset($o['PhoneNumber'])) $this->PhoneNumber = $o['PhoneNumber'];
        if (isset($o['BirthDate'])) $this->BirthDate = JsonConverters::from('DateTime', $o['BirthDate']);
        if (isset($o['BirthDateRaw'])) $this->BirthDateRaw = $o['BirthDateRaw'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['Address2'])) $this->Address2 = $o['Address2'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Country'])) $this->Country = $o['Country'];
        if (isset($o['Culture'])) $this->Culture = $o['Culture'];
        if (isset($o['FullName'])) $this->FullName = $o['FullName'];
        if (isset($o['Gender'])) $this->Gender = $o['Gender'];
        if (isset($o['Language'])) $this->Language = $o['Language'];
        if (isset($o['MailAddress'])) $this->MailAddress = $o['MailAddress'];
        if (isset($o['Nickname'])) $this->Nickname = $o['Nickname'];
        if (isset($o['PostalCode'])) $this->PostalCode = $o['PostalCode'];
        if (isset($o['TimeZone'])) $this->TimeZone = $o['TimeZone'];
        if (isset($o['RequestTokenSecret'])) $this->RequestTokenSecret = $o['RequestTokenSecret'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
        if (isset($o['LastModified'])) $this->LastModified = JsonConverters::from('DateTime', $o['LastModified']);
        if (isset($o['Roles'])) $this->Roles = JsonConverters::fromArray('string', $o['Roles']);
        if (isset($o['Permissions'])) $this->Permissions = JsonConverters::fromArray('string', $o['Permissions']);
        if (isset($o['IsAuthenticated'])) $this->IsAuthenticated = $o['IsAuthenticated'];
        if (isset($o['FromToken'])) $this->FromToken = $o['FromToken'];
        if (isset($o['ProfileUrl'])) $this->ProfileUrl = $o['ProfileUrl'];
        if (isset($o['Sequence'])) $this->Sequence = $o['Sequence'];
        if (isset($o['Tag'])) $this->Tag = $o['Tag'];
        if (isset($o['AuthProvider'])) $this->AuthProvider = $o['AuthProvider'];
        if (isset($o['ProviderOAuthAccess'])) $this->ProviderOAuthAccess = JsonConverters::fromArray('IAuthTokens', $o['ProviderOAuthAccess']);
        if (isset($o['Meta'])) $this->Meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Meta']);
        if (isset($o['Audiences'])) $this->Audiences = JsonConverters::fromArray('string', $o['Audiences']);
        if (isset($o['Scopes'])) $this->Scopes = JsonConverters::fromArray('string', $o['Scopes']);
        if (isset($o['Dns'])) $this->Dns = $o['Dns'];
        if (isset($o['Rsa'])) $this->Rsa = $o['Rsa'];
        if (isset($o['Sid'])) $this->Sid = $o['Sid'];
        if (isset($o['Hash'])) $this->Hash = $o['Hash'];
        if (isset($o['HomePhone'])) $this->HomePhone = $o['HomePhone'];
        if (isset($o['MobilePhone'])) $this->MobilePhone = $o['MobilePhone'];
        if (isset($o['Webpage'])) $this->Webpage = $o['Webpage'];
        if (isset($o['EmailConfirmed'])) $this->EmailConfirmed = $o['EmailConfirmed'];
        if (isset($o['PhoneNumberConfirmed'])) $this->PhoneNumberConfirmed = $o['PhoneNumberConfirmed'];
        if (isset($o['TwoFactorEnabled'])) $this->TwoFactorEnabled = $o['TwoFactorEnabled'];
        if (isset($o['SecurityStamp'])) $this->SecurityStamp = $o['SecurityStamp'];
        if (isset($o['Type'])) $this->Type = $o['Type'];
        if (isset($o['RecoveryToken'])) $this->RecoveryToken = $o['RecoveryToken'];
        if (isset($o['RefId'])) $this->RefId = $o['RefId'];
        if (isset($o['RefIdStr'])) $this->RefIdStr = $o['RefIdStr'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ReferrerUrl)) $o['ReferrerUrl'] = $this->ReferrerUrl;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->UserAuthId)) $o['UserAuthId'] = $this->UserAuthId;
        if (isset($this->UserAuthName)) $o['UserAuthName'] = $this->UserAuthName;
        if (isset($this->UserName)) $o['UserName'] = $this->UserName;
        if (isset($this->TwitterUserId)) $o['TwitterUserId'] = $this->TwitterUserId;
        if (isset($this->TwitterScreenName)) $o['TwitterScreenName'] = $this->TwitterScreenName;
        if (isset($this->FacebookUserId)) $o['FacebookUserId'] = $this->FacebookUserId;
        if (isset($this->FacebookUserName)) $o['FacebookUserName'] = $this->FacebookUserName;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->DisplayName)) $o['DisplayName'] = $this->DisplayName;
        if (isset($this->Company)) $o['Company'] = $this->Company;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->PrimaryEmail)) $o['PrimaryEmail'] = $this->PrimaryEmail;
        if (isset($this->PhoneNumber)) $o['PhoneNumber'] = $this->PhoneNumber;
        if (isset($this->BirthDate)) $o['BirthDate'] = JsonConverters::to('DateTime', $this->BirthDate);
        if (isset($this->BirthDateRaw)) $o['BirthDateRaw'] = $this->BirthDateRaw;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->Address2)) $o['Address2'] = $this->Address2;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Country)) $o['Country'] = $this->Country;
        if (isset($this->Culture)) $o['Culture'] = $this->Culture;
        if (isset($this->FullName)) $o['FullName'] = $this->FullName;
        if (isset($this->Gender)) $o['Gender'] = $this->Gender;
        if (isset($this->Language)) $o['Language'] = $this->Language;
        if (isset($this->MailAddress)) $o['MailAddress'] = $this->MailAddress;
        if (isset($this->Nickname)) $o['Nickname'] = $this->Nickname;
        if (isset($this->PostalCode)) $o['PostalCode'] = $this->PostalCode;
        if (isset($this->TimeZone)) $o['TimeZone'] = $this->TimeZone;
        if (isset($this->RequestTokenSecret)) $o['RequestTokenSecret'] = $this->RequestTokenSecret;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        if (isset($this->LastModified)) $o['LastModified'] = JsonConverters::to('DateTime', $this->LastModified);
        if (isset($this->Roles)) $o['Roles'] = JsonConverters::toArray('string', $this->Roles);
        if (isset($this->Permissions)) $o['Permissions'] = JsonConverters::toArray('string', $this->Permissions);
        if (isset($this->IsAuthenticated)) $o['IsAuthenticated'] = $this->IsAuthenticated;
        if (isset($this->FromToken)) $o['FromToken'] = $this->FromToken;
        if (isset($this->ProfileUrl)) $o['ProfileUrl'] = $this->ProfileUrl;
        if (isset($this->Sequence)) $o['Sequence'] = $this->Sequence;
        if (isset($this->Tag)) $o['Tag'] = $this->Tag;
        if (isset($this->AuthProvider)) $o['AuthProvider'] = $this->AuthProvider;
        if (isset($this->ProviderOAuthAccess)) $o['ProviderOAuthAccess'] = JsonConverters::toArray('IAuthTokens', $this->ProviderOAuthAccess);
        if (isset($this->Meta)) $o['Meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Meta);
        if (isset($this->Audiences)) $o['Audiences'] = JsonConverters::toArray('string', $this->Audiences);
        if (isset($this->Scopes)) $o['Scopes'] = JsonConverters::toArray('string', $this->Scopes);
        if (isset($this->Dns)) $o['Dns'] = $this->Dns;
        if (isset($this->Rsa)) $o['Rsa'] = $this->Rsa;
        if (isset($this->Sid)) $o['Sid'] = $this->Sid;
        if (isset($this->Hash)) $o['Hash'] = $this->Hash;
        if (isset($this->HomePhone)) $o['HomePhone'] = $this->HomePhone;
        if (isset($this->MobilePhone)) $o['MobilePhone'] = $this->MobilePhone;
        if (isset($this->Webpage)) $o['Webpage'] = $this->Webpage;
        if (isset($this->EmailConfirmed)) $o['EmailConfirmed'] = $this->EmailConfirmed;
        if (isset($this->PhoneNumberConfirmed)) $o['PhoneNumberConfirmed'] = $this->PhoneNumberConfirmed;
        if (isset($this->TwoFactorEnabled)) $o['TwoFactorEnabled'] = $this->TwoFactorEnabled;
        if (isset($this->SecurityStamp)) $o['SecurityStamp'] = $this->SecurityStamp;
        if (isset($this->Type)) $o['Type'] = $this->Type;
        if (isset($this->RecoveryToken)) $o['RecoveryToken'] = $this->RecoveryToken;
        if (isset($this->RefId)) $o['RefId'] = $this->RefId;
        if (isset($this->RefIdStr)) $o['RefIdStr'] = $this->RefIdStr;
        return empty($o) ? new class(){} : $o;
    }
}

enum MotorBD : string
{
    case POSTGRESQL = 'POSTGRESQL';
    case ORACLE = 'ORACLE';
    case SQLSERVER = 'SQLSERVER';
}

// @DataContract
class CustomUserSession extends AuthUserSession implements JsonSerializable
{
    /**
     * @param string|null $ReferrerUrl
     * @param string|null $Id
     * @param string|null $UserAuthId
     * @param string|null $UserAuthName
     * @param string|null $UserName
     * @param string|null $TwitterUserId
     * @param string|null $TwitterScreenName
     * @param string|null $FacebookUserId
     * @param string|null $FacebookUserName
     * @param string|null $FirstName
     * @param string|null $LastName
     * @param string|null $DisplayName
     * @param string|null $Company
     * @param string|null $Email
     * @param string|null $PrimaryEmail
     * @param string|null $PhoneNumber
     * @param DateTime|null $BirthDate
     * @param string|null $BirthDateRaw
     * @param string|null $Address
     * @param string|null $Address2
     * @param string|null $City
     * @param string|null $State
     * @param string|null $Country
     * @param string|null $Culture
     * @param string|null $FullName
     * @param string|null $Gender
     * @param string|null $Language
     * @param string|null $MailAddress
     * @param string|null $Nickname
     * @param string|null $PostalCode
     * @param string|null $TimeZone
     * @param string|null $RequestTokenSecret
     * @param DateTime $CreatedAt
     * @param DateTime $LastModified
     * @param array<string>|null $Roles
     * @param array<string>|null $Permissions
     * @param bool|null $IsAuthenticated
     * @param bool|null $FromToken
     * @param string|null $ProfileUrl
     * @param string|null $Sequence
     * @param int $Tag
     * @param string|null $AuthProvider
     * @param array<IAuthTokens>|null $ProviderOAuthAccess
     * @param array<string,string>|null $Meta
     * @param array<string>|null $Audiences
     * @param array<string>|null $Scopes
     * @param string|null $Dns
     * @param string|null $Rsa
     * @param string|null $Sid
     * @param string|null $Hash
     * @param string|null $HomePhone
     * @param string|null $MobilePhone
     * @param string|null $Webpage
     * @param bool|null $EmailConfirmed
     * @param bool|null $PhoneNumberConfirmed
     * @param bool|null $TwoFactorEnabled
     * @param string|null $SecurityStamp
     * @param string|null $Type
     * @param string|null $RecoveryToken
     * @param int|null $RefId
     * @param string|null $RefIdStr
     */
    public function __construct(
        ?string $ReferrerUrl=null,
        ?string $Id=null,
        ?string $UserAuthId=null,
        ?string $UserAuthName=null,
        ?string $UserName=null,
        ?string $TwitterUserId=null,
        ?string $TwitterScreenName=null,
        ?string $FacebookUserId=null,
        ?string $FacebookUserName=null,
        ?string $FirstName=null,
        ?string $LastName=null,
        ?string $DisplayName=null,
        ?string $Company=null,
        ?string $Email=null,
        ?string $PrimaryEmail=null,
        ?string $PhoneNumber=null,
        ?DateTime $BirthDate=null,
        ?string $BirthDateRaw=null,
        ?string $Address=null,
        ?string $Address2=null,
        ?string $City=null,
        ?string $State=null,
        ?string $Country=null,
        ?string $Culture=null,
        ?string $FullName=null,
        ?string $Gender=null,
        ?string $Language=null,
        ?string $MailAddress=null,
        ?string $Nickname=null,
        ?string $PostalCode=null,
        ?string $TimeZone=null,
        ?string $RequestTokenSecret=null,
        DateTime $CreatedAt=new DateTime(),
        DateTime $LastModified=new DateTime(),
        ?array $Roles=null,
        ?array $Permissions=null,
        ?bool $IsAuthenticated=null,
        ?bool $FromToken=null,
        ?string $ProfileUrl=null,
        ?string $Sequence=null,
        int $Tag=0,
        ?string $AuthProvider=null,
        ?array $ProviderOAuthAccess=null,
        ?array $Meta=null,
        ?array $Audiences=null,
        ?array $Scopes=null,
        ?string $Dns=null,
        ?string $Rsa=null,
        ?string $Sid=null,
        ?string $Hash=null,
        ?string $HomePhone=null,
        ?string $MobilePhone=null,
        ?string $Webpage=null,
        ?bool $EmailConfirmed=null,
        ?bool $PhoneNumberConfirmed=null,
        ?bool $TwoFactorEnabled=null,
        ?string $SecurityStamp=null,
        ?string $Type=null,
        ?string $RecoveryToken=null,
        ?int $RefId=null,
        ?string $RefIdStr=null,
        // @DataMember
        /** @var string|null */
        public ?string $IDUsuario=null,

        // @DataMember
        /** @var float */
        public float $IDSistema=0.0,

        // @DataMember
        /** @var string|null */
        public ?string $IDEmpresaProd=null,

        // @DataMember
        /** @var float */
        public float $IDEmpresa=0.0,

        // @DataMember
        /** @var string|null */
        public ?string $IDModulo=null,

        // @DataMember
        /** @var MotorBD|null */
        public ?MotorBD $MotorProd=null,

        // @DataMember
        /** @var MotorBD|null */
        public ?MotorBD $MotorAppAdm=null,

        // @DataMember
        /** @var string|null */
        public ?string $ProdConnectionString=null,

        // @DataMember
        /** @var string|null */
        public ?string $AppAdmConnectionString=null,

        // @DataMember
        /** @var string|null */
        public ?string $CacheKeyAdm=null,

        // @DataMember
        /** @var string|null */
        public ?string $Password=null,

        // @DataMember
        /** @var bool|null */
        public ?bool $SessionDB=null,

        // @DataMember
        /** @var string|null */
        public ?string $MensajeError=null,

        // @DataMember
        /** @var string|null */
        public ?string $DocumentoUsuario=null,

        // @DataMember
        /** @var string|null */
        public ?string $app_adm=null,

        // @DataMember
        /** @var string|null */
        public ?string $imei=null,

        // @DataMember
        /** @var string|null */
        public ?string $BaseURL=null,

        // @DataMember
        /** @var string|null */
        public ?string $UsaServAux=null,

        // @DataMember
        /** @var string|null */
        public ?string $TipoValidaAuth=null,

        // @DataMember
        /** @var string|null */
        public ?string $TokenExt=null,

        // @DataMember
        /** @var string|null */
        public ?string $Subsistema=null,

        // @DataMember
        /** @var string|null */
        public ?string $TwoFactor=null
    ) {
        parent::__construct($ReferrerUrl,$Id,$UserAuthId,$UserAuthName,$UserName,$TwitterUserId,$TwitterScreenName,$FacebookUserId,$FacebookUserName,$FirstName,$LastName,$DisplayName,$Company,$Email,$PrimaryEmail,$PhoneNumber,$BirthDate,$BirthDateRaw,$Address,$Address2,$City,$State,$Country,$Culture,$FullName,$Gender,$Language,$MailAddress,$Nickname,$PostalCode,$TimeZone,$RequestTokenSecret,$CreatedAt,$LastModified,$Roles,$Permissions,$IsAuthenticated,$FromToken,$ProfileUrl,$Sequence,$Tag,$AuthProvider,$ProviderOAuthAccess,$Meta,$Audiences,$Scopes,$Dns,$Rsa,$Sid,$Hash,$HomePhone,$MobilePhone,$Webpage,$EmailConfirmed,$PhoneNumberConfirmed,$TwoFactorEnabled,$SecurityStamp,$Type,$RecoveryToken,$RefId,$RefIdStr);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['IDUsuario'])) $this->IDUsuario = $o['IDUsuario'];
        if (isset($o['IDSistema'])) $this->IDSistema = $o['IDSistema'];
        if (isset($o['IDEmpresaProd'])) $this->IDEmpresaProd = $o['IDEmpresaProd'];
        if (isset($o['IDEmpresa'])) $this->IDEmpresa = $o['IDEmpresa'];
        if (isset($o['IDModulo'])) $this->IDModulo = $o['IDModulo'];
        if (isset($o['MotorProd'])) $this->MotorProd = JsonConverters::from('MotorBD', $o['MotorProd']);
        if (isset($o['MotorAppAdm'])) $this->MotorAppAdm = JsonConverters::from('MotorBD', $o['MotorAppAdm']);
        if (isset($o['ProdConnectionString'])) $this->ProdConnectionString = $o['ProdConnectionString'];
        if (isset($o['AppAdmConnectionString'])) $this->AppAdmConnectionString = $o['AppAdmConnectionString'];
        if (isset($o['CacheKeyAdm'])) $this->CacheKeyAdm = $o['CacheKeyAdm'];
        if (isset($o['Password'])) $this->Password = $o['Password'];
        if (isset($o['SessionDB'])) $this->SessionDB = $o['SessionDB'];
        if (isset($o['MensajeError'])) $this->MensajeError = $o['MensajeError'];
        if (isset($o['DocumentoUsuario'])) $this->DocumentoUsuario = $o['DocumentoUsuario'];
        if (isset($o['app_adm'])) $this->app_adm = $o['app_adm'];
        if (isset($o['imei'])) $this->imei = $o['imei'];
        if (isset($o['BaseURL'])) $this->BaseURL = $o['BaseURL'];
        if (isset($o['UsaServAux'])) $this->UsaServAux = $o['UsaServAux'];
        if (isset($o['TipoValidaAuth'])) $this->TipoValidaAuth = $o['TipoValidaAuth'];
        if (isset($o['TokenExt'])) $this->TokenExt = $o['TokenExt'];
        if (isset($o['Subsistema'])) $this->Subsistema = $o['Subsistema'];
        if (isset($o['TwoFactor'])) $this->TwoFactor = $o['TwoFactor'];
        if (isset($o['ReferrerUrl'])) $this->ReferrerUrl = $o['ReferrerUrl'];
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['UserAuthId'])) $this->UserAuthId = $o['UserAuthId'];
        if (isset($o['UserAuthName'])) $this->UserAuthName = $o['UserAuthName'];
        if (isset($o['UserName'])) $this->UserName = $o['UserName'];
        if (isset($o['TwitterUserId'])) $this->TwitterUserId = $o['TwitterUserId'];
        if (isset($o['TwitterScreenName'])) $this->TwitterScreenName = $o['TwitterScreenName'];
        if (isset($o['FacebookUserId'])) $this->FacebookUserId = $o['FacebookUserId'];
        if (isset($o['FacebookUserName'])) $this->FacebookUserName = $o['FacebookUserName'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['DisplayName'])) $this->DisplayName = $o['DisplayName'];
        if (isset($o['Company'])) $this->Company = $o['Company'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['PrimaryEmail'])) $this->PrimaryEmail = $o['PrimaryEmail'];
        if (isset($o['PhoneNumber'])) $this->PhoneNumber = $o['PhoneNumber'];
        if (isset($o['BirthDate'])) $this->BirthDate = JsonConverters::from('DateTime', $o['BirthDate']);
        if (isset($o['BirthDateRaw'])) $this->BirthDateRaw = $o['BirthDateRaw'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['Address2'])) $this->Address2 = $o['Address2'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Country'])) $this->Country = $o['Country'];
        if (isset($o['Culture'])) $this->Culture = $o['Culture'];
        if (isset($o['FullName'])) $this->FullName = $o['FullName'];
        if (isset($o['Gender'])) $this->Gender = $o['Gender'];
        if (isset($o['Language'])) $this->Language = $o['Language'];
        if (isset($o['MailAddress'])) $this->MailAddress = $o['MailAddress'];
        if (isset($o['Nickname'])) $this->Nickname = $o['Nickname'];
        if (isset($o['PostalCode'])) $this->PostalCode = $o['PostalCode'];
        if (isset($o['TimeZone'])) $this->TimeZone = $o['TimeZone'];
        if (isset($o['RequestTokenSecret'])) $this->RequestTokenSecret = $o['RequestTokenSecret'];
        if (isset($o['CreatedAt'])) $this->CreatedAt = JsonConverters::from('DateTime', $o['CreatedAt']);
        if (isset($o['LastModified'])) $this->LastModified = JsonConverters::from('DateTime', $o['LastModified']);
        if (isset($o['Roles'])) $this->Roles = JsonConverters::fromArray('string', $o['Roles']);
        if (isset($o['Permissions'])) $this->Permissions = JsonConverters::fromArray('string', $o['Permissions']);
        if (isset($o['IsAuthenticated'])) $this->IsAuthenticated = $o['IsAuthenticated'];
        if (isset($o['FromToken'])) $this->FromToken = $o['FromToken'];
        if (isset($o['ProfileUrl'])) $this->ProfileUrl = $o['ProfileUrl'];
        if (isset($o['Sequence'])) $this->Sequence = $o['Sequence'];
        if (isset($o['Tag'])) $this->Tag = $o['Tag'];
        if (isset($o['AuthProvider'])) $this->AuthProvider = $o['AuthProvider'];
        if (isset($o['ProviderOAuthAccess'])) $this->ProviderOAuthAccess = JsonConverters::fromArray('IAuthTokens', $o['ProviderOAuthAccess']);
        if (isset($o['Meta'])) $this->Meta = JsonConverters::from(JsonConverters::context('Dictionary',genericArgs:['string','string']), $o['Meta']);
        if (isset($o['Audiences'])) $this->Audiences = JsonConverters::fromArray('string', $o['Audiences']);
        if (isset($o['Scopes'])) $this->Scopes = JsonConverters::fromArray('string', $o['Scopes']);
        if (isset($o['Dns'])) $this->Dns = $o['Dns'];
        if (isset($o['Rsa'])) $this->Rsa = $o['Rsa'];
        if (isset($o['Sid'])) $this->Sid = $o['Sid'];
        if (isset($o['Hash'])) $this->Hash = $o['Hash'];
        if (isset($o['HomePhone'])) $this->HomePhone = $o['HomePhone'];
        if (isset($o['MobilePhone'])) $this->MobilePhone = $o['MobilePhone'];
        if (isset($o['Webpage'])) $this->Webpage = $o['Webpage'];
        if (isset($o['EmailConfirmed'])) $this->EmailConfirmed = $o['EmailConfirmed'];
        if (isset($o['PhoneNumberConfirmed'])) $this->PhoneNumberConfirmed = $o['PhoneNumberConfirmed'];
        if (isset($o['TwoFactorEnabled'])) $this->TwoFactorEnabled = $o['TwoFactorEnabled'];
        if (isset($o['SecurityStamp'])) $this->SecurityStamp = $o['SecurityStamp'];
        if (isset($o['Type'])) $this->Type = $o['Type'];
        if (isset($o['RecoveryToken'])) $this->RecoveryToken = $o['RecoveryToken'];
        if (isset($o['RefId'])) $this->RefId = $o['RefId'];
        if (isset($o['RefIdStr'])) $this->RefIdStr = $o['RefIdStr'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->IDUsuario)) $o['IDUsuario'] = $this->IDUsuario;
        if (isset($this->IDSistema)) $o['IDSistema'] = $this->IDSistema;
        if (isset($this->IDEmpresaProd)) $o['IDEmpresaProd'] = $this->IDEmpresaProd;
        if (isset($this->IDEmpresa)) $o['IDEmpresa'] = $this->IDEmpresa;
        if (isset($this->IDModulo)) $o['IDModulo'] = $this->IDModulo;
        if (isset($this->MotorProd)) $o['MotorProd'] = JsonConverters::to('MotorBD', $this->MotorProd);
        if (isset($this->MotorAppAdm)) $o['MotorAppAdm'] = JsonConverters::to('MotorBD', $this->MotorAppAdm);
        if (isset($this->ProdConnectionString)) $o['ProdConnectionString'] = $this->ProdConnectionString;
        if (isset($this->AppAdmConnectionString)) $o['AppAdmConnectionString'] = $this->AppAdmConnectionString;
        if (isset($this->CacheKeyAdm)) $o['CacheKeyAdm'] = $this->CacheKeyAdm;
        if (isset($this->Password)) $o['Password'] = $this->Password;
        if (isset($this->SessionDB)) $o['SessionDB'] = $this->SessionDB;
        if (isset($this->MensajeError)) $o['MensajeError'] = $this->MensajeError;
        if (isset($this->DocumentoUsuario)) $o['DocumentoUsuario'] = $this->DocumentoUsuario;
        if (isset($this->app_adm)) $o['app_adm'] = $this->app_adm;
        if (isset($this->imei)) $o['imei'] = $this->imei;
        if (isset($this->BaseURL)) $o['BaseURL'] = $this->BaseURL;
        if (isset($this->UsaServAux)) $o['UsaServAux'] = $this->UsaServAux;
        if (isset($this->TipoValidaAuth)) $o['TipoValidaAuth'] = $this->TipoValidaAuth;
        if (isset($this->TokenExt)) $o['TokenExt'] = $this->TokenExt;
        if (isset($this->Subsistema)) $o['Subsistema'] = $this->Subsistema;
        if (isset($this->TwoFactor)) $o['TwoFactor'] = $this->TwoFactor;
        if (isset($this->ReferrerUrl)) $o['ReferrerUrl'] = $this->ReferrerUrl;
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->UserAuthId)) $o['UserAuthId'] = $this->UserAuthId;
        if (isset($this->UserAuthName)) $o['UserAuthName'] = $this->UserAuthName;
        if (isset($this->UserName)) $o['UserName'] = $this->UserName;
        if (isset($this->TwitterUserId)) $o['TwitterUserId'] = $this->TwitterUserId;
        if (isset($this->TwitterScreenName)) $o['TwitterScreenName'] = $this->TwitterScreenName;
        if (isset($this->FacebookUserId)) $o['FacebookUserId'] = $this->FacebookUserId;
        if (isset($this->FacebookUserName)) $o['FacebookUserName'] = $this->FacebookUserName;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->DisplayName)) $o['DisplayName'] = $this->DisplayName;
        if (isset($this->Company)) $o['Company'] = $this->Company;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->PrimaryEmail)) $o['PrimaryEmail'] = $this->PrimaryEmail;
        if (isset($this->PhoneNumber)) $o['PhoneNumber'] = $this->PhoneNumber;
        if (isset($this->BirthDate)) $o['BirthDate'] = JsonConverters::to('DateTime', $this->BirthDate);
        if (isset($this->BirthDateRaw)) $o['BirthDateRaw'] = $this->BirthDateRaw;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->Address2)) $o['Address2'] = $this->Address2;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Country)) $o['Country'] = $this->Country;
        if (isset($this->Culture)) $o['Culture'] = $this->Culture;
        if (isset($this->FullName)) $o['FullName'] = $this->FullName;
        if (isset($this->Gender)) $o['Gender'] = $this->Gender;
        if (isset($this->Language)) $o['Language'] = $this->Language;
        if (isset($this->MailAddress)) $o['MailAddress'] = $this->MailAddress;
        if (isset($this->Nickname)) $o['Nickname'] = $this->Nickname;
        if (isset($this->PostalCode)) $o['PostalCode'] = $this->PostalCode;
        if (isset($this->TimeZone)) $o['TimeZone'] = $this->TimeZone;
        if (isset($this->RequestTokenSecret)) $o['RequestTokenSecret'] = $this->RequestTokenSecret;
        if (isset($this->CreatedAt)) $o['CreatedAt'] = JsonConverters::to('DateTime', $this->CreatedAt);
        if (isset($this->LastModified)) $o['LastModified'] = JsonConverters::to('DateTime', $this->LastModified);
        if (isset($this->Roles)) $o['Roles'] = JsonConverters::toArray('string', $this->Roles);
        if (isset($this->Permissions)) $o['Permissions'] = JsonConverters::toArray('string', $this->Permissions);
        if (isset($this->IsAuthenticated)) $o['IsAuthenticated'] = $this->IsAuthenticated;
        if (isset($this->FromToken)) $o['FromToken'] = $this->FromToken;
        if (isset($this->ProfileUrl)) $o['ProfileUrl'] = $this->ProfileUrl;
        if (isset($this->Sequence)) $o['Sequence'] = $this->Sequence;
        if (isset($this->Tag)) $o['Tag'] = $this->Tag;
        if (isset($this->AuthProvider)) $o['AuthProvider'] = $this->AuthProvider;
        if (isset($this->ProviderOAuthAccess)) $o['ProviderOAuthAccess'] = JsonConverters::toArray('IAuthTokens', $this->ProviderOAuthAccess);
        if (isset($this->Meta)) $o['Meta'] = JsonConverters::to(JsonConverters::context('Dictionary',genericArgs:['string','string']), $this->Meta);
        if (isset($this->Audiences)) $o['Audiences'] = JsonConverters::toArray('string', $this->Audiences);
        if (isset($this->Scopes)) $o['Scopes'] = JsonConverters::toArray('string', $this->Scopes);
        if (isset($this->Dns)) $o['Dns'] = $this->Dns;
        if (isset($this->Rsa)) $o['Rsa'] = $this->Rsa;
        if (isset($this->Sid)) $o['Sid'] = $this->Sid;
        if (isset($this->Hash)) $o['Hash'] = $this->Hash;
        if (isset($this->HomePhone)) $o['HomePhone'] = $this->HomePhone;
        if (isset($this->MobilePhone)) $o['MobilePhone'] = $this->MobilePhone;
        if (isset($this->Webpage)) $o['Webpage'] = $this->Webpage;
        if (isset($this->EmailConfirmed)) $o['EmailConfirmed'] = $this->EmailConfirmed;
        if (isset($this->PhoneNumberConfirmed)) $o['PhoneNumberConfirmed'] = $this->PhoneNumberConfirmed;
        if (isset($this->TwoFactorEnabled)) $o['TwoFactorEnabled'] = $this->TwoFactorEnabled;
        if (isset($this->SecurityStamp)) $o['SecurityStamp'] = $this->SecurityStamp;
        if (isset($this->Type)) $o['Type'] = $this->Type;
        if (isset($this->RecoveryToken)) $o['RecoveryToken'] = $this->RecoveryToken;
        if (isset($this->RefId)) $o['RefId'] = $this->RefId;
        if (isset($this->RefIdStr)) $o['RefIdStr'] = $this->RefIdStr;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CustomUserSession 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.

POST /jsv/reply/CustomUserSession HTTP/1.1 
Host: soluser-recaudo.sgsas.co 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	"IDUsuario": "String",
	"IDSistema": 0,
	"IDEmpresaProd": "String",
	"IDEmpresa": 0,
	"IDModulo": "String",
	"MotorProd": "POSTGRESQL",
	"MotorAppAdm": "POSTGRESQL",
	"ProdConnectionString": "String",
	"AppAdmConnectionString": "String",
	"CacheKeyAdm": "String",
	"Password": "String",
	"SessionDB": false,
	"MensajeError": "String",
	"DocumentoUsuario": "String",
	"app_adm": "String",
	"imei": "String",
	"BaseURL": "String",
	"UsaServAux": "String",
	"TipoValidaAuth": "String",
	"TokenExt": "String",
	"Subsistema": "String",
	"TwoFactor": "String",
	"ReferrerUrl": "String",
	"Id": "String",
	"UserAuthId": "String",
	"UserAuthName": "String",
	"UserName": "String",
	"TwitterUserId": "String",
	"TwitterScreenName": "String",
	"FacebookUserId": "String",
	"FacebookUserName": "String",
	"FirstName": "String",
	"LastName": "String",
	"DisplayName": "String",
	"Company": "String",
	"Email": "String",
	"PrimaryEmail": "String",
	"PhoneNumber": "String",
	"BirthDate": "0001-01-01T00:00:00.0000000",
	"BirthDateRaw": "String",
	"Address": "String",
	"Address2": "String",
	"City": "String",
	"State": "String",
	"Country": "String",
	"Culture": "String",
	"FullName": "String",
	"Gender": "String",
	"Language": "String",
	"MailAddress": "String",
	"Nickname": "String",
	"PostalCode": "String",
	"TimeZone": "String",
	"RequestTokenSecret": "String",
	"Roles": 
	[
		"String"
	],
	"Permissions": 
	[
		"String"
	],
	"IsAuthenticated": false,
	"FromToken": false,
	"ProfileUrl": "String",
	"Sequence": "String",
	"Tag": 0,
	"AuthProvider": "String",
	"ProviderOAuthAccess": 
	[
		{
			
		}
	],
	"Meta": 
	{
		"String": "String"
	},
	"Audiences": 
	[
		"String"
	],
	"Scopes": 
	[
		"String"
	],
	"Dns": "String",
	"Rsa": "String",
	"Sid": "String",
	"Hash": "String",
	"HomePhone": "String",
	"MobilePhone": "String",
	"Webpage": "String",
	"EmailConfirmed": false,
	"PhoneNumberConfirmed": false,
	"TwoFactorEnabled": false,
	"SecurityStamp": "String",
	"Type": "String",
	"RecoveryToken": "String",
	"RefId": 0,
	"RefIdStr": "String"
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	"IDUsuario": "String",
	"IDSistema": 0,
	"IDEmpresaProd": "String",
	"IDEmpresa": 0,
	"IDModulo": "String",
	"MotorProd": "POSTGRESQL",
	"MotorAppAdm": "POSTGRESQL",
	"ProdConnectionString": "String",
	"AppAdmConnectionString": "String",
	"CacheKeyAdm": "String",
	"Password": "String",
	"SessionDB": false,
	"MensajeError": "String",
	"DocumentoUsuario": "String",
	"app_adm": "String",
	"imei": "String",
	"BaseURL": "String",
	"UsaServAux": "String",
	"TipoValidaAuth": "String",
	"TokenExt": "String",
	"Subsistema": "String",
	"TwoFactor": "String",
	"ReferrerUrl": "String",
	"Id": "String",
	"UserAuthId": "String",
	"UserAuthName": "String",
	"UserName": "String",
	"TwitterUserId": "String",
	"TwitterScreenName": "String",
	"FacebookUserId": "String",
	"FacebookUserName": "String",
	"FirstName": "String",
	"LastName": "String",
	"DisplayName": "String",
	"Company": "String",
	"Email": "String",
	"PrimaryEmail": "String",
	"PhoneNumber": "String",
	"BirthDate": "0001-01-01T00:00:00.0000000",
	"BirthDateRaw": "String",
	"Address": "String",
	"Address2": "String",
	"City": "String",
	"State": "String",
	"Country": "String",
	"Culture": "String",
	"FullName": "String",
	"Gender": "String",
	"Language": "String",
	"MailAddress": "String",
	"Nickname": "String",
	"PostalCode": "String",
	"TimeZone": "String",
	"RequestTokenSecret": "String",
	"Roles": 
	[
		"String"
	],
	"Permissions": 
	[
		"String"
	],
	"IsAuthenticated": false,
	"FromToken": false,
	"ProfileUrl": "String",
	"Sequence": "String",
	"Tag": 0,
	"AuthProvider": "String",
	"ProviderOAuthAccess": 
	[
		{
			
		}
	],
	"Meta": 
	{
		"String": "String"
	},
	"Audiences": 
	[
		"String"
	],
	"Scopes": 
	[
		"String"
	],
	"Dns": "String",
	"Rsa": "String",
	"Sid": "String",
	"Hash": "String",
	"HomePhone": "String",
	"MobilePhone": "String",
	"Webpage": "String",
	"EmailConfirmed": false,
	"PhoneNumberConfirmed": false,
	"TwoFactorEnabled": false,
	"SecurityStamp": "String",
	"Type": "String",
	"RecoveryToken": "String",
	"RefId": 0,
	"RefIdStr": "String"
}