Module resonitepy.classes

This module define some of the Resonite API json responce under usable python classes.

Expand source code
"""
This module define some of the Resonite API json
responce under usable python classes.
"""

import json
import logging
import os
from dataclasses import field
from datetime import datetime
from enum import Enum
from pathlib import PureWindowsPath

from typing import Annotated, List, Literal, Optional
from urllib.parse import ParseResult, urlparse
from pydantic import BeforeValidator, ConfigDict, model_validator, Field
from pydantic.dataclasses import dataclass as pydantic_dataclass

from resonitepy.secrets import generate
from resonitepy.exceptions import ResoniteException

_RESONITE_CLASS_CONFIG = ConfigDict(
    extra='allow',
    arbitrary_types_allowed=True,
    validate_by_name=True,
    validate_by_alias=True,
)

_TRACK_API_FIELDS = os.environ.get("RESONITEPY_DRIFT") == "1"


def _record_api_fields(cls, data, handler):
    """ Records which fields the API actually sent, for drift detection in test.py
    """
    keys = set(data.keys()) if isinstance(data, dict) else None
    obj = handler(data)
    if keys is not None:
        object.__setattr__(obj, "__api_fields__", keys)
    return obj


def resonite_class(cls):
    if _TRACK_API_FIELDS:
        cls.__record_api_fields__ = model_validator(mode="wrap")(classmethod(_record_api_fields))
    return pydantic_dataclass(config=_RESONITE_CLASS_CONFIG, kw_only=True)(cls)

logger = logging.getLogger(__name__)

class UnknownEnumMixin:

    @classmethod
    def _missing_(cls, value):
        logger.warning(
            "Unknown %s value %r, falling back to %s.UNKNOWN",
            cls.__name__, value, cls.__name__,
        )
        return cls.UNKNOWN

class RecordType(UnknownEnumMixin, Enum):
    """ Enum representing the type of a Resonite record.
    """

    OBJECT = "object"
    """Represents an object record."""
    LINK = "link"
    """Represents a link record."""
    DIRECTORY = "directory"
    """Represents a directory record."""
    WORLD = "world"
    """Represents a world record."""
    TEXTURE = "texture"
    """Represents a texture record."""
    AUDIO = "audio"
    """Represents an audio record."""
    UNKNOWN = "__unknown__"


@resonite_class
class ResoniteRecordVersion:
    """ Data class representing the version of a Resonite record.
    """

    globalVersion: int
    """The global version of the record."""
    localVersion: int
    """The local version of the record."""
    lastModifyingUserId: Optional[str] = None
    """The ID of the user who last modified the record. (optional)"""
    lastModifyingMachineId: Optional[str] = None
    """The ID of the machine that last modified the record. (optional"""

@resonite_class
class ResoniteRecord:
    """ Data class representing a Resonite record.
    """

    id: str
    """The ID of the record."""
    assetUri: Optional[str] = None
    """The URI of the asset associated with the record."""
    version: ResoniteRecordVersion
    """The version of the record."""
    name: str
    """The name of the record."""
    recordType: RecordType
    """The type of the record."""
    ownerName: str
    """The name of the owner of the record."""
    path: Optional[str] = None
    """The path of the record."""
    thumbnailUri: Optional[str] = None
    """The URI of the thumbnail associated with the record."""
    isPublic: bool
    """Whether the record is public."""
    isForPatrons: bool
    """Whether the record is for patrons."""
    isListed: bool
    """Whether the record is listed."""
    isDeleted: bool
    """Whether the record is deleted."""
    tags: Optional[list] = None
    """The tags associated with the record."""
    creationTime: Optional[datetime] = None
    """The creation time of the record."""
    lastModificationTime: datetime
    """The last modification time of the record."""
    randomOrder: int
    """The random order of the record."""
    visits: int
    """The number of visits to the record."""
    rating: int
    """The rating of the record."""
    ownerId: str
    """The ID of the owner of the record."""
    isReadOnly: bool
    """Whether the record is read only."""


@resonite_class
class ResoniteLink(ResoniteRecord):
    """ Data class representing a Resonite link.
    """

    assetUri: Annotated[
        ParseResult,
        BeforeValidator(lambda v: urlparse(v) if isinstance(v, str) else v),
    ]
    """The parsed URI of the asset associated with the link."""


@resonite_class
class ResoniteAssetManifestEntry:
    """ Data class representing an asset referenced by a record.
    """

    hash: str
    """The hash of the asset in the Resonite asset database."""
    bytes: int
    """The size of the asset in bytes."""


@resonite_class
class ResoniteDirectory(ResoniteRecord):
    """ Data class representing a Resonite directory.
    """

    lastModifyingMachineId: Optional[str] = None
    """The ID of the machine that last modified the directory."""
    ownerName: str
    """The name of the owner of the directory."""
    tags: List[str]
    """The tags associated with the directory."""
    creationTime: Optional[datetime] = None
    """The creation time of the directory."""
    migrationMetadata: Optional[dict] = None
    assetManifest: Optional[List[ResoniteAssetManifestEntry]] = None

    @property
    def content_path(self) -> str:
        """The path of the content within the directory."""
        return str(PureWindowsPath(self.path, self.name))


@resonite_class
class ResoniteObject(ResoniteRecord):
    """ Data class representing a Resonite object.
    """

    assetUri: str
    """The URI of the asset associated with the object."""
    lastModifyingMachineId: Optional[str] = None
    """ The ID of the machine that last modified the object."""
    ownerName: str
    """The name of the owner of the object."""
    tags: List[str]
    """The tags associated with the object."""
    creationTime: datetime
    """The creation time of the object."""

@resonite_class
class ResoniteWorld(ResoniteRecord):
    """ Data class representing a Resonite world.
    """
    pass

@resonite_class
class ResoniteTexture(ResoniteRecord):
    """ Data class representing a Resonite texture.
    """
    pass

@resonite_class
class ResoniteAudio(ResoniteRecord):
    """ Data class representing a Resonite audio.
    """
    pass


recordTypeMapping = {
    RecordType.DIRECTORY: ResoniteDirectory,
    RecordType.LINK: ResoniteLink,
    RecordType.OBJECT: ResoniteObject,
    RecordType.WORLD: ResoniteWorld,
    RecordType.TEXTURE: ResoniteTexture,
    RecordType.AUDIO: ResoniteAudio,
}


@resonite_class
class LoginDetailsAuth:
    """ Data class representing a login details for authentication.
    """

    password: str
    """The password for authentication."""

    def build_dict(self):
        """ Returns a dictionary representation of the login details.

        Returns:
            dict: A dictionary containing the login details.

        Example:
            >>> LoginDetailsAuth("my_password").build_dict()
            {'$type': 'password', 'password': 'my_password', 'recoveryCode': None}
        """
        return {
            "$type": "password",
            "password": self.password,
            "recoveryCode": None
        }


@resonite_class
class LoginDetails:
    """ Data class representing a login details.

    Raises:
        ResoniteException: If neither ownerId, username, nor email is provided during post-initialization.
        ResoniteException: If authentication details are not provided during post-initialization.
    """

    authentication: LoginDetailsAuth
    """The authentication details for the login."""
    ownerId: Optional[str] = None
    """The ownerId of the login which should start with an `U-`."""
    username: Optional[str] = None
    """The username of the login."""
    email: Optional[str] = None
    """The email of the login."""
    secretMachineId: str = field(default_factory=generate)
    """The secret machine ID for the login. See the generate class in the resonite.secrets module."""
    rememberMe: Optional[str] = False
    """The remember me option for the login."""

    def __post_init__(self):
        """ Performs post-initialization checks for a class instance."""
        if not self.ownerId and not self.username and not self.email:
            raise ResoniteException(
                'Either an ownerId, an username or an email is needed')
        if not self.authentication:
            raise ResoniteException('A password is needed')


@resonite_class
class ProfileData:
    """ Data class representing a profile data.
    """

    iconUrl: Optional[str] = None
    """The URL of the profile icon."""
    tokenOutOut: Optional[List[str]] = None
    """The list of token outputs."""
    displayBadges: Optional[list] = None
    """The list of display badges."""
    tagline: Optional[str] = None
    """The tagline of the profile."""
    description: Optional[str] = None
    """The description of the profile."""
    pronouns: Optional[str] = None
    """The pronouns of the profile."""


@resonite_class
class Snapshot:
    """ Data class representing a snapshot of data.
    """

    totalCents: int
    """The total cents."""
    patreonRawCents: int
    """The raw cents from Patreon."""
    deltaCents: int
    """The delta cents."""
    pledgeCents: int
    """The pledge cents."""
    email: str
    """The email associated with the snapshot."""
    timestamp: str
    """The timestamp of the snapshot."""

@resonite_class
class PatreonData:
    """ Data class representing a Patreon data.
    """

    isPatreonSupporter: bool
    """Whether the user is a Patreon supporter."""
    patreonId: Optional[str] = None
    """The Patreon ID of the user."""
    lastPatreonEmail: str
    """The last Patreon email associated with the user."""
    snapshots: List[Snapshot]
    """A list of snapshots associated with the user."""
    lastPatreonPledgeCents: int
    """The last Patreon pledge amount in cents."""
    lastTotalCents: int
    """The last total amount in cents."""
    minimumTotalUnits: int
    """The minimum total units."""
    externalCents: int
    """The external amount in cents."""
    lastExternalCents: int
    """The last external amount in cents."""
    hasSupported: bool
    """Whether the user has supported."""
    lastIsAnorak: Optional[bool] = None # Deprecated
    """Deprecated"""
    priorityIssue: int
    """The priority issue."""
    lastPlusActivationTime: Optional[datetime] = None # Depreacted
    """Deprecated"""
    lastActivationTime: Optional[datetime] = None # Deprecated
    """Deprecated"""
    lastPlusPledgeAmount: Optional[int] = None # Deprecated
    """Deprecated"""
    lastPaidPledgeAmount: int
    """The last paid pledge amount."""
    accountName: Optional[str] = None # Deprecated
    """Deprecated"""
    currentAccountType: Optional[int] = None # Deprecated
    """Deprecated"""
    currentAccountCents: Optional[int] = None # Deprecated
    """Deprecated"""
    pledgedAccountType: Optional[int] = None # Deprecated
    """Deprecated"""


@resonite_class
class QuotaBytesSources:
    """ Data class representing the quota bytes sources.
    """

    base: int
    """The base quota bytes."""
    patreon: int
    """The Patreon quota bytes."""
    paid: int
    """The paid quota bytes."""
    mmc21_honorary: int
    """The MMC21 honorary quota bytes."""


@resonite_class
class ResoniteUserQuotaBytesSources:
    """ Data class representing the quota bytes sources for a Resonite user.
    """

    base: int
    """The base quota bytes."""
    patreon: Optional[int] = None
    """The Patreon quota bytes."""
    paid: Optional[int] = None
    """The paid quota bytes."""


@resonite_class
class ResoniteUserMigrationData:
    """ Data class representing the migration data for a Resonite user.
    """

    username: str
    """The username of the user."""
    email: Optional[str] = None
    """The email of the user."""
    userId: str
    """The ID of the user."""
    quotaBytes: int
    """The quota bytes of the user."""
    usedBytes: int
    """The used bytes of the user."""
    patreonData: Optional[PatreonData] = None
    """ The Patreon data of the user."""
    quotaBytesSources: Optional[ResoniteUserQuotaBytesSources] = None
    """The quota bytes sources of the user."""
    registrationDate: datetime
    """The registration date of the user."""

@resonite_class
class ResoniteUserEntitlementUnknown:
    """ Fallback for entitlement types this module doesn't know yet.
    """
    type_: str = Field(alias='$type', default='__unknown__')

@resonite_class
class ResoniteUserEntitlementShoutOut:
    """ Data class representing an entitlement shout-out for a Resonite user.
    """

    type_: Literal['shoutOut'] = Field(alias='$type', default='shoutOut')
    """The $type tag sent by the API for this entitlement."""
    shoutoutType: str
    """The type of the shout-out."""
    friendlyDescription: str
    """The friendly description of the shout-out."""


@resonite_class
class ResoniteUserEntitlementCredits:
    """ Data class representingan entitlement credit for a Resonite user.
    """

    type_: Literal['credits'] = Field(alias='$type', default='credits')
    """The $type tag sent by the API for this entitlement."""
    creditType: str
    """The type of the credit."""
    friendlyDescription: str
    """The friendly description of the credit."""
    entitlementOrigins: list[str]
    """The entitlement origins."""


@resonite_class
class ResoniteUserEntitlementGroupCreation:
    """ Data class representing the entitlement for the group creation for a Resonite user.
    """

    type_: Literal['groupCreation'] = Field(alias='$type', default='groupCreation')
    """The $type tag sent by the API for this entitlement."""
    groupCount: int
    """The number of groups the user is entitled to create."""
    entitlementOrigins: list[str]
    """The entitlement origins."""


@resonite_class
class ResoniteEntitlementDeleteRecovery:
    """ Data class representing the entitlement for deleting recovery data in Resonite.
    """

    type_: Literal['deleteRecovery'] = Field(alias='$type', default='deleteRecovery')
    """The $type tag sent by the API for this entitlement."""
    entitlementOrigins: list[str]
    """The entitlement origins."""


@resonite_class
class ResoniteUserEntitlementBadge:
    """ Data class representing an entitlement badge for a Resonite user.
    """

    type_: Literal['badge'] = Field(alias='$type', default='badge')
    """The $type tag sent by the API for this entitlement."""
    badgeType: str
    """The type of the badge."""
    badgeCount: int
    """The count of the badge."""
    entitlementOrigins: list[str]
    """The entitlement origins."""


@resonite_class
class ResoniteUserEntitlementHeadless:
    """ Data class representing a headless entitlement for a Resonite user.
    """

    type_: Literal['headless'] = Field(alias='$type', default='headless')
    """The $type tag sent by the API for this entitlement."""
    friendlyDescription: str
    """The friendly description of the headless entitlement."""
    entitlementOrigins: list[str]
    """The entitlement origins."""


@resonite_class
class ResoniteUserEntitlementExitMessage:
    """ Data class representing an exit message entitlement for a Resonite user.
    """

    type_: Literal['exitMessage'] = Field(alias='$type', default='exitMessage')
    """The $type tag sent by the API for this entitlement."""
    isLifetime: bool
    """Indicates whether the entitlement is lifetime."""
    messageCount: int
    """The count of exit messages."""
    friendlyDescription: str
    """The friendly description of the exit message entitlement."""
    entitlementOrigins: list[str]
    """The entitlement origins."""


@resonite_class
class ResoniteUserEntitlementStorageSpace:
    """ Data class representing a storage space entitlement for a Resonite user.
    """

    type_: Literal['storageSpace'] = Field(alias='$type', default='storageSpace')
    """The $type tag sent by the API for this entitlement."""
    bytes: int
    """The amount of storage space in bytes."""
    maximumShareLevel: str
    """The maximum share level."""
    storageId: str
    """The ID of the storage space."""
    group: str
    """The group associated with the storage space."""
    startsOn: datetime
    """The start date of the entitlement."""
    expiresOn: datetime
    """The expiration date of the entitlement."""
    name: str
    """The name of the storage space."""
    description: str
    """The description of the storage space."""
    entitlementOrigins: list[str]
    """The entitlement origins."""

@resonite_class
class supporterMetadataUnknown:
    """ Fallback for supporter metadata types this module doesn't know yet.
    """

@resonite_class
class supporterMetadataPatreon:
    """ Data class representing the Patreon supporter metadata.
    """

    type_: Literal['patreon'] = Field(alias='$type', default='patreon')
    """The $type tag sent by the API for this supporter metadata."""
    isActiveSupporter: bool
    """Whether the user is an active supporter."""
    isActive: bool
    """Whether the user is an active."""
    totalSupportMonths: int
    """The total number of months of support."""
    totalSupportCents: int
    """The total amount of support in cents."""
    lastTierCents: int
    """The amount of the last tier in cents."""
    highestTierCents: int
    """The amount of the highest tier in cents."""
    lowestTierCents: int
    """The amount of the lowest tier in cents."""
    firstSupportTimestamp: datetime
    """The timestamp of the first support."""
    lastSupportTimestamp: datetime
    """The timestamp of the last support."""

@resonite_class
class supporterMetadataStripe:
    type_: Literal['stripe'] = Field(alias='$type', default='stripe')
    totalSupportCents: int
    firstSupportTimestamp: str
    lowestTierCents: int
    lastTierCents: int
    isActive: bool
    isActiveSupporter: bool
    highestTierCents: int
    lastSupportTimestamp: str
    totalSupportMonths: int


@resonite_class
class supporterMetadataPromo:
    type_: Literal['promo'] = Field(alias='$type', default='promo')
    isActiveSupporter: bool
    isActive: bool
    totalSupportMonths: int
    totalSupportCents: int
    lastTierCents: int
    highestTierCents: int
    lowestTierCents: int
    firstSupportTimestamp: datetime
    lastSupportTimestamp: datetime


@resonite_class
class ResoniteUser:
    """ Data class representing a Resonite user.
    """

    id: str
    """The ID of the user."""
    username: str
    """The username of the user."""
    normalizedUsername: str
    """The normalized username of the user."""
    alternateNormalizedNames: Optional[list[str]] = None
    """The alternate normalized username of the user."""
    email: Optional[str] = None
    """The email of the user."""
    registrationDate: datetime
    """The registration date of the user."""
    isVerified: bool
    """Indicates whether the user is verified."""
    isLocked: bool
    """Whether the user is locked."""
    supressBanEvasion: bool
    """Whether ban evasion is suppressed for the user."""
    two_fa_login: Optional[bool] = Field(alias='2fa_login', default=None)
    """Whether two-factor authentication is enabled for login."""
    profile: Optional[ProfileData] = None
    """The profile data of the user."""
    supporterMetadata: Optional[List[
        Annotated[
            supporterMetadataPatreon
            | supporterMetadataStripe
            | supporterMetadataPromo,
            Field(discriminator='type_'),
        ]
        | supporterMetadataUnknown
    ]] = None
    """The Patreon supporter metadata of the user."""
    entitlements: Optional[List[
        Annotated[
            ResoniteUserEntitlementShoutOut
            | ResoniteUserEntitlementCredits
            | ResoniteUserEntitlementGroupCreation
            | ResoniteEntitlementDeleteRecovery
            | ResoniteUserEntitlementBadge
            | ResoniteUserEntitlementHeadless
            | ResoniteUserEntitlementExitMessage
            | ResoniteUserEntitlementStorageSpace,
            Field(discriminator='type_'),
        ]
        | ResoniteUserEntitlementUnknown
    ]] = None
    """The entitlements of the user."""
    migratedData: Optional[ResoniteUserMigrationData] = None
    """The migrated data of the user."""
    """The tags associated with the user."""
    isActiveSupporter: bool
    promoCode: Optional[str] = None
    tags: Optional[List[str]] = field(default_factory=list)

@resonite_class
class ResoniteUserMembership:
    id: str
    groupName: str
    isMigrated: bool
    ownerId: str

@resonite_class
class WorldId:
    """ Data class representing a World ID.
    """

    ownerId: str
    """The owner ID of the world. Start with `U-`"""
    recordId: str
    """The record ID of the world."""

@resonite_class
class ResoniteGroup:
    id: str
    adminUserId: str
    name: str
    isMigrated: bool

@resonite_class
class ResoniteGroupMember:
    id: str
    isMigrated: bool
    ownerId: str

class CurrentResoniteSessionAccessLevel(UnknownEnumMixin, Enum):
    """ Enum representing the access level of a Resonite session.
    """
    PRIVATE = "Private"
    """Private access level."""
    LAN = "LAN"
    """LAN access level."""
    FRIENDS = "Contacts"
    """Contacts access level."""
    FRIENDSOFFRIENDS = "ContactsPlus"
    """Contacts+ access level."""
    REGISTEREDUSERS = "RegisteredUsers"
    """Registered Users access level."""
    ANYONE = "Anyone"
    """Anyone access level."""
    UNKNOWN = "__unknown__"

    def __str__(self):
        """Returns the string representation of the access level."""
        text = {
            'PRIVATE': 'Private',
            'LAN': 'LAN',
            'FRIENDS': 'Contacts',
            'FRIENDSOFFRIENDS': 'Contacts+',
            'REGISTEREDUSERS': 'Registered Users',
            'ANYONE': 'Anyone',
            'UNKNOWN': 'Unknown'
        }
        return text[self.name]


@resonite_class
class ResoniteSessionUser:
    """ Data class representing a Resonite session user.
    """

    isPresent: bool
    """Whether the user is present."""
    userID: Optional[str] = None
    """The ID of the user."""
    username: str
    """The username of the user."""
    userSessionId: Optional[str] = None
    """The session ID of the user."""
    outputDevice: Optional[int] = None
    """The output device of the user."""

@resonite_class
class DataModelAssemblies:
    name: str
    compatibilityHash: str

class UserSessionType(UnknownEnumMixin, Enum):
    """ Enum representing the kind of client behind a user session.
    """

    GRAPHICAL_CLIENT = "GraphicalClient"
    """The full Resonite client."""
    CHAT_CLIENT = "ChatClient"
    """A chat-only client."""
    HEADLESS = "Headless"
    """A headless server."""
    BOT = "Bot"
    """A bot."""
    UNKNOWN = "__unknown__"
    """Fallback for session types this module doesn't know yet."""

@resonite_class
class ResoniteSessionMetadata:
    """ Datra class representing one session entry inside a hub status update.
    """

    sessionHash: str
    accessLevel: CurrentResoniteSessionAccessLevel
    sessionHidden: bool
    isHost: bool
    broadcastKey: Optional[str] = None

@resonite_class
class ResoniteSession:
    """ Data class representing a Resonite session.
    """

    activeSessions: Optional[str] = None
    """The active sessions."""
    activeUsers: int
    """ The number of active users."""
    compatibilityHash: Optional[str] = None
    """The compatibility hash."""
    systemCompatibilityHash: Optional[str] = None
    """The system compatibility hash."""
    correspondingWorldId: Optional[WorldId] = None
    """The corresponding world ID."""
    description: Optional[str] = None
    """The description of the session."""
    accessLevel: CurrentResoniteSessionAccessLevel
    """The access level of the session."""
    hasEnded: bool
    """Whether the session has ended."""
    headlessHost: bool
    """Whether the host is headless."""
    hostMachineId: str
    """The machine ID of the host."""
    hostUserSessionId: Optional[str] = None
    """The user session ID of the host."""
    hostUserId: Optional[str] = None
    """The user ID of the host."""
    hostUsername: str
    """The username of the host."""
    isValid: bool
    """Whether the session is valid."""
    joinedUsers: int
    """The number of joined users."""
    lastUpdate: datetime
    """The timestamp of the last update."""
    maxUsers: int
    """The maximum number of users."""
    mobileFriendly: bool
    """Whether the session is mobile-friendly."""
    name: str
    """The name of the session."""
    appVersion: str
    """The version of the app."""
    normalizedSessionId: str
    """The normalized session ID."""
    sessionBeginTime: datetime
    """The timestamp of the session begin time."""
    sessionId: str
    """The session ID."""
    nestedSessionIds: Optional[List[str]] = None
    """The IDs of the sessions nested under this session."""
    parentSessionIds: Optional[List[str]] = None
    """The IDs of the parent sessions of this session."""
    sessionURLs: List[str]
    """The URLs of the session."""
    sessionUsers: List[ResoniteSessionUser]
    """The users in the session."""
    tags: List[str]
    """The tags associated with the session."""
    thumbnailUrl: Optional[str] = None
    """The URL of the thumbnail."""
    totalActiveUsers: int
    """The total number of active users."""
    totalJoinedUsers: int
    """The total number of joined users."""
    hideFromListing: bool
    """Whether the session is hidden from listing."""
    dataModelAssemblies: List[DataModelAssemblies]
    """Data model assemblies."""
    universeId: Optional[str] = None
    """The universe id of the session."""
    awayKickEnabled: bool
    awayKickMinutes: int


@resonite_class
class PublicRSAKey:
    """ Data class representing a public RSA key.
    """

    Exponent: str
    """The exponent of the RSA key."""
    Modulus: str
    """The modulus of the RSA key."""
    P: Optional[str] = None
    Q: Optional[str] = None
    DP: Optional[str] = None
    DQ: Optional[str] = None
    InverseQ: Optional[str] = None
    D: Optional[str] = None


class OnlineStatus(UnknownEnumMixin, Enum):
    """ Enum representing the online status of a Resonite user.
    """

    ONLINE = "Online"
    AWAY = "Away"
    BUSY = "Busy"
    OFFLINE = "Offline"
    SOCIABLE = "Sociable"
    INVISIBLE = "Invisible"
    UNKNOWN = "__unknown__"

@resonite_class
class ResoniteHubUserStatus:
    """ Data class representing a user status as sent by the hub's event."""

    userId: str
    """The ID of the user this status belongs to."""
    userSessionId: str
    """The ID of the user session broadcasting this status."""
    sessionType: UserSessionType
    """The kind of client behind this user session."""
    isMobile: bool
    """Whether the user is on a mobile device."""
    isPresent: bool
    """Whether the user is present at their device."""
    lastStatusChange: datetime
    """The timestamp of the last status change."""
    hashSalt: Optional[str] = None
    """Salt used to hash the session ids in sessions."""
    appVersion: str
    """The version of the app broadcasting this status."""
    sessions: List[ResoniteSessionMetadata]
    """The sessions the user is currently in (hashed)."""
    currentSessionIndex: int
    """The index is sessions of the user's current session."""
    onlineStatus: Optional[OnlineStatus] = None
    """The online status of the user. Headless sessions send none."""
    outputDevice: Optional[str] = None
    """The output device of the user."""
    lastPresenceTimestamp: Optional[datetime] = None
    """The timestamp of the last presence change."""
    compatibilityHash: Optional[str] = None
    """The compatibility hash."""
    publicRSAKey: Optional[PublicRSAKey] = None
    """The public RSA key of this user session."""

@resonite_class
class UserStatusData:
    """ Data class representing an user status data.
    """

    activeSessions: Optional[List[ResoniteSession]] = None
    """The list of active sessions."""
    currentSession: Optional[ResoniteSession] = None
    """The current session."""
    compatibilityHash: Optional[str] = None
    """The compatibility hash."""
    currentHosting: bool
    """Whether the user is currently hosting a session."""
    currentSessionAccessLevel: CurrentResoniteSessionAccessLevel
    """The access level of the current session."""
    currentSessionHidden: bool
    """Whether the current session is hidden."""
    currentSessionId: Optional[str] = None
    """The ID of the current session."""
    isMobile: bool
    """Whether the user is on a mobile device."""
    lastStatusChange: datetime
    """The timestamp of the last status change."""
    neosVersion: Optional[str] = None
    """The version of Neos."""
    onlineStatus: OnlineStatus
    """The online status of the user."""
    OutputDevice: Optional[str] = None
    """The output device of the user."""
    publicRSAKey: Optional[PublicRSAKey] = None
    """The public RSA key of the user."""

@resonite_class
class ResoniteUserStatus:
    """ Data class representing the status of a Resonite user.
    """

    onlineStatus: OnlineStatus
    """The online status of the user."""
    lastStatusChange: datetime
    """The timestamp of the last status change."""
    currentSessionAccessLevel: int
    """The access level of the current session."""
    currentSessionHidden: bool
    """Whether the current session is hidden."""
    currentHosting: bool
    """Whether the user is currently hosting a session."""
    compatibilityHash: Optional[str] = None
    """The compatibility hash."""
    neosVersion: Optional[str] = None
    """The version of Neos. """
    publicRSAKey: Optional[PublicRSAKey] = None
    """The public RSA key."""
    OutputDevice: Optional[str] = None
    """The output device."""
    isMobile: bool
    """Whether the user is on a mobile device."""

class ContactStatus(UnknownEnumMixin, Enum):
    """ Enum representing the status of a contact.
    """

    ACCEPTED = "Accepted"
    """The contact request has been accepted."""
    IGNORED = "Ignored"
    """The contact request has been ignored."""
    REQUESTED = "Requested"
    """The contact request has been sent but not yet accepted."""
    BLOCKED = "Blocked"
    """The contact is blocked."""
    NONE = "None"
    """No contact status."""
    UNKNOWN = "__unknown__"


@resonite_class
class ResoniteContact:
    id: str
    contactUsername: str
    contactStatus: ContactStatus
    isAccepted: bool
    profile: Optional[ProfileData] = None
    latestMessageTime: datetime
    isMigrated: bool
    isCounterpartMigrated: bool
    ownerId: str
    universeId: Optional[str] = None

class ResoniteMessageType(UnknownEnumMixin, Enum):
    """ Enum representing a Resonite message type.
    """

    TEXT = "Text"
    """Text type message."""
    OBJECT = "Object"
    """Object type message."""
    SOUND = "Sound"
    """Audio type message."""
    SESSIONINVITE = "SessionInvite"
    """Session invite type message."""
    INVITEREQUEST = "InviteRequest"
    """Invite request type message."""
    CREDITTRANSFER = "CreditTransfer"
    """Credit transfert type message."""
    SUGARCUBES = "SugarCubes"
    """Sugar cubes type message."""
    UNKNOWN = "__unknown__"


@resonite_class
class ResoniteMessageContentUnknown:
    """ Fallback content for message types this module doesn't know yet.
    """
    raw: str

@resonite_class
class ResoniteMessageContentText:
    content: str

    def __str__(self) -> str:
        return self.content

@resonite_class
class ResoniteMessageContentObject:
    """ Data class representing the content of a Resonite object message.
    """

    id: str
    """The ID of the object."""
    ownerId: str
    """The ID of the object owner."""
    assetUri: str
    """The URI of the object asset."""
    version: Optional[ResoniteRecordVersion] = None
    """The version of the object record."""
    name: str
    """The name of the object."""
    recordType: RecordType
    """The type of the object record."""
    ownerName: Optional[str] = None
    """The name of the object owner."""
    tags: List[str]
    """The tags associated with the object."""
    path: Optional[str] = None
    """The path of the object."""
    thumbnailUri: str
    """The URI of the object thumbnail."""
    isPublic: bool
    """Whether the object is public."""
    isForPatrons: bool
    """Whether the object is for patrons."""
    isListed: bool
    """Whether the object is listed."""
    isReadOnly: bool
    """Whether the object is read-only."""
    lastModificationTime: datetime
    """The timestamp of the last modification."""
    creationTime: datetime
    """The timestamp of the creation."""
    firstPublishTime: Optional[datetime] = None
    """The timestamp of the first publish."""
    isDeleted: Optional[bool] = None
    """Whether the object is deleted."""
    visits: int
    """The number of visits."""
    rating: float
    """The rating of the object."""
    randomOrder: int
    """The random order of the object."""
    submissions: Optional[str] = None
    """The submissions of the object."""

@resonite_class
class ResoniteMessageContentSessionInvite:
    name: str
    description: Optional[str] = None
    correspondingWorldId: Optional[WorldId] = None
    tags: List[str]
    sessionId: str
    normalizedSessionId: str
    hostMachineId: str
    hostUsername: str
    hostUserId: Optional[str] = None
    hostUserSessionId: Optional[str] = None
    compatibilityHash: Optional[str] = None
    universeId: Optional[str] = None
    appVersion: Optional[str] = None
    headlessHost: Optional[bool] = None
    sessionURLs: List[str]
    thumbnailUrl: Optional[str] = None
    parentSessionIds: Optional[List[str]] = None
    nestedSessionIds: Optional[List[str]] = None
    sessionUsers: List[ResoniteSessionUser]
    thumbnail: Optional[str] = None
    joinedUsers: int
    activeUsers: int
    totalActiveUsers: int
    totalJoinedUsers: int
    maxUsers: int
    mobileFriendly: bool
    sessionBeginTime: datetime
    lastUpdate: datetime
    accessLevel: CurrentResoniteSessionAccessLevel
    broadcastKey: Optional[str] = None
    dataModelAssemblies: List[DataModelAssemblies]
    hideFromListing: bool
    systemCompatibilityHash: str
    awayKickEnabled: bool
    awayKickMinutes: int
    HasEnded: bool
    IsValid: bool

@resonite_class
class ResoniteMessageContentRequestInvite:
    inviteRequestId: str
    userIdToInvite: str
    usernameToInvite: str
    requestingFromUserId: str
    requestingFromUsername: str
    forSessionId: Optional[str] = None
    forSessionName: Optional[str] = None
    isContactOfHost: Optional[str] = None
    response: Optional[str] = None
    invite: Optional[dict] = None

@resonite_class
class ResoniteMessageContentSound:
    id: str
    ownerId: Optional[str] = None
    assetUri: str
    globalVersion: Optional[int] = None
    localVersion: Optional[int] = None
    lastModifyingUserId: Optional[str] = None
    lastModifyingMachineId: Optional[str] = None
    name: str
    recordType: RecordType
    ownerName: Optional[str] = None
    tags: List[str]
    path: Optional[str] = None
    isPublic: bool
    isForPatrons: Optional[bool] = None
    isListed: bool
    lastModificationTime: datetime
    creationTime: datetime
    firstPublishTime: Optional[datetime] = None
    visits: int
    rating: float
    randomOrder: int
    submissions: Optional[str] = None
    neosDBmanifest: Optional[list] = None
    assetManifest: List[ResoniteAssetManifestEntry]
    isForPatrons: bool
    version: ResoniteRecordVersion
    isDeleted: bool
    isReadOnly: Optional[bool] = None
    description: Optional[str] = None
    thumbnailUri: Optional[str] = None
    rootRecordId: Optional[int] = None
    migrationMetadata: Optional[str] = None
    IsValidOwnerId: bool
    IsValidRecordId: bool



@resonite_class
class ResoniteMessage:
    """Representation of a Resonite message."""
    id: str
    senderId: str
    ownerId: str
    """The ownerId of a ResoniteMessage should start with `U-`"""
    sendTime: str
    recipientId: str
    messageType: ResoniteMessageType
    senderUserSessionId: Optional[str] = None
    isMigrated: bool
    readTime: Optional[datetime] = None
    otherId: Optional[str] = None
    lastUpdateTime: datetime
    description: Optional[str] = None
    content: Optional[
        ResoniteMessageContentText
        | ResoniteMessageContentSessionInvite
        | ResoniteMessageContentRequestInvite
        | ResoniteMessageContentObject
        | ResoniteMessageContentSound
        | ResoniteMessageContentUnknown
    ] = None

    @model_validator(mode='before')
    @classmethod
    def _parse_content(cls, data):
        if isinstance(data, dict) and isinstance(data.get('content'), str):
            raw = data['content']
            mtype = data.get('messageType')
            if mtype == 'Text':
                data = {**data, 'content': {'content': raw}}
            elif mtype in ('SessionInvite', 'InviteRequest', 'Object', 'Sound'):
                data = {**data, 'content': json.loads(raw)}
            else:
                data = {**data, 'content': {'raw': raw}}
        return data

@resonite_class
class ResoniteCloudVar:
    """Representation of Resonite clound variable."""
    ownerId: str
    """The ownerId of a ResoniteCloudVar should start with `U-`"""
    path: str
    """The path of a ResoniteCloudVar should start with a `U-` for a user owned path and a `G-` for a group owned path."""
    value: Optional[str] = None
    partitionKey: str
    rowKey: str
    timestamp: Optional[str] = None
    eTag: Optional[str] = None


class OwnerType(UnknownEnumMixin, Enum):
    MACHINE = "Machine"
    USER = "User"
    GROUP = "Group"
    INVALID = "Invalid"
    UNKNOWN = "__unknown__"


@resonite_class
class ResoniteCloudVarDefs:
    definitionOwnerId: str
    subpath: str
    variableType: str
    defaultValue: Optional[str] = None
    deleteScheduled: bool
    readPermissions: List[str]
    writePermissions: List[str]
    listPermissions: List[str]
    partitionKey: str
    rowKey: str
    timestamp: str
    eTag: str


@resonite_class
class Platform:
    name: str
    shortNamePrefix: str
    abbreviation: str
    domain: str
    moderationURL: str
    supportURL: str
    policiesPage: str
    email: str
    discordInviteURL: str
    patreonURL: str
    webRecordEndpoint: str
    webSessionEndpoint: str
    groupId: str
    teamGroupId: str
    computeGroupId: str
    networkGroupId: str
    appUsername: str
    devBotUsername: str
    computeUsername: str
    networkUsername: str
    appUserId: str
    devBotUserId: str
    computeUserId: str
    networkUserId: str
    authScheme: str
    appScheme: str
    dbScheme: str
    sessionScheme: str
    recordScheme: str
    userSessionScheme: str
    steamAppId: str
    discordAppId: int
    studioNameLong: str
    studioNameShort: str
    wiki: str

@resonite_class
class ResoniteBadge:
    tag: str
    url: str
    slotName: str

Functions

def resonite_class(cls)
Expand source code
def resonite_class(cls):
    if _TRACK_API_FIELDS:
        cls.__record_api_fields__ = model_validator(mode="wrap")(classmethod(_record_api_fields))
    return pydantic_dataclass(config=_RESONITE_CLASS_CONFIG, kw_only=True)(cls)

Classes

class ContactStatus (*args, **kwds)

Enum representing the status of a contact.

Expand source code
class ContactStatus(UnknownEnumMixin, Enum):
    """ Enum representing the status of a contact.
    """

    ACCEPTED = "Accepted"
    """The contact request has been accepted."""
    IGNORED = "Ignored"
    """The contact request has been ignored."""
    REQUESTED = "Requested"
    """The contact request has been sent but not yet accepted."""
    BLOCKED = "Blocked"
    """The contact is blocked."""
    NONE = "None"
    """No contact status."""
    UNKNOWN = "__unknown__"

Ancestors

Class variables

var ACCEPTED

The contact request has been accepted.

var BLOCKED

The contact is blocked.

var IGNORED

The contact request has been ignored.

var NONE

No contact status.

var REQUESTED

The contact request has been sent but not yet accepted.

var UNKNOWN
class CurrentResoniteSessionAccessLevel (*args, **kwds)

Enum representing the access level of a Resonite session.

Expand source code
class CurrentResoniteSessionAccessLevel(UnknownEnumMixin, Enum):
    """ Enum representing the access level of a Resonite session.
    """
    PRIVATE = "Private"
    """Private access level."""
    LAN = "LAN"
    """LAN access level."""
    FRIENDS = "Contacts"
    """Contacts access level."""
    FRIENDSOFFRIENDS = "ContactsPlus"
    """Contacts+ access level."""
    REGISTEREDUSERS = "RegisteredUsers"
    """Registered Users access level."""
    ANYONE = "Anyone"
    """Anyone access level."""
    UNKNOWN = "__unknown__"

    def __str__(self):
        """Returns the string representation of the access level."""
        text = {
            'PRIVATE': 'Private',
            'LAN': 'LAN',
            'FRIENDS': 'Contacts',
            'FRIENDSOFFRIENDS': 'Contacts+',
            'REGISTEREDUSERS': 'Registered Users',
            'ANYONE': 'Anyone',
            'UNKNOWN': 'Unknown'
        }
        return text[self.name]

Ancestors

Class variables

var ANYONE

Anyone access level.

var FRIENDS

Contacts access level.

var FRIENDSOFFRIENDS

Contacts+ access level.

var LAN

LAN access level.

var PRIVATE

Private access level.

var REGISTEREDUSERS

Registered Users access level.

var UNKNOWN
class DataModelAssemblies (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class DataModelAssemblies:
    name: str
    compatibilityHash: str

Class variables

var compatibilityHash : str
var name : str
class LoginDetails (*args: Any, **kwargs: Any)

Data class representing a login details.

Raises
-----=
ResoniteException
If neither ownerId, username, nor email is provided during post-initialization.
ResoniteException
If authentication details are not provided during post-initialization.
Expand source code
@resonite_class
class LoginDetails:
    """ Data class representing a login details.

    Raises:
        ResoniteException: If neither ownerId, username, nor email is provided during post-initialization.
        ResoniteException: If authentication details are not provided during post-initialization.
    """

    authentication: LoginDetailsAuth
    """The authentication details for the login."""
    ownerId: Optional[str] = None
    """The ownerId of the login which should start with an `U-`."""
    username: Optional[str] = None
    """The username of the login."""
    email: Optional[str] = None
    """The email of the login."""
    secretMachineId: str = field(default_factory=generate)
    """The secret machine ID for the login. See the generate class in the resonite.secrets module."""
    rememberMe: Optional[str] = False
    """The remember me option for the login."""

    def __post_init__(self):
        """ Performs post-initialization checks for a class instance."""
        if not self.ownerId and not self.username and not self.email:
            raise ResoniteException(
                'Either an ownerId, an username or an email is needed')
        if not self.authentication:
            raise ResoniteException('A password is needed')

Class variables

var authenticationLoginDetailsAuth

The authentication details for the login.

var email : Optional[str]

The email of the login.

var ownerId : Optional[str]

The ownerId of the login which should start with an U-.

var rememberMe : Optional[str]

The remember me option for the login.

var secretMachineId : str

The secret machine ID for the login. See the generate class in the resonite.secrets module.

var username : Optional[str]

The username of the login.

class LoginDetailsAuth (*args: Any, **kwargs: Any)

Data class representing a login details for authentication.

Expand source code
@resonite_class
class LoginDetailsAuth:
    """ Data class representing a login details for authentication.
    """

    password: str
    """The password for authentication."""

    def build_dict(self):
        """ Returns a dictionary representation of the login details.

        Returns:
            dict: A dictionary containing the login details.

        Example:
            >>> LoginDetailsAuth("my_password").build_dict()
            {'$type': 'password', 'password': 'my_password', 'recoveryCode': None}
        """
        return {
            "$type": "password",
            "password": self.password,
            "recoveryCode": None
        }

Class variables

var password : str

The password for authentication.

Methods

def build_dict(self)

Returns a dictionary representation of the login details.

Returns
-----=
dict
A dictionary containing the login details.

Example -----=

>>> LoginDetailsAuth("my_password").build_dict()
{'$type': 'password', 'password': 'my_password', 'recoveryCode': None}
Expand source code
def build_dict(self):
    """ Returns a dictionary representation of the login details.

    Returns:
        dict: A dictionary containing the login details.

    Example:
        >>> LoginDetailsAuth("my_password").build_dict()
        {'$type': 'password', 'password': 'my_password', 'recoveryCode': None}
    """
    return {
        "$type": "password",
        "password": self.password,
        "recoveryCode": None
    }
class OnlineStatus (*args, **kwds)

Enum representing the online status of a Resonite user.

Expand source code
class OnlineStatus(UnknownEnumMixin, Enum):
    """ Enum representing the online status of a Resonite user.
    """

    ONLINE = "Online"
    AWAY = "Away"
    BUSY = "Busy"
    OFFLINE = "Offline"
    SOCIABLE = "Sociable"
    INVISIBLE = "Invisible"
    UNKNOWN = "__unknown__"

Ancestors

Class variables

var AWAY
var BUSY
var INVISIBLE
var OFFLINE
var ONLINE
var SOCIABLE
var UNKNOWN
class OwnerType (*args, **kwds)

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access::
>>> Color.RED
<Color.RED: 1>
  • value lookup:
>>> Color(1)
<Color.RED: 1>
  • name lookup:
>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Expand source code
class OwnerType(UnknownEnumMixin, Enum):
    MACHINE = "Machine"
    USER = "User"
    GROUP = "Group"
    INVALID = "Invalid"
    UNKNOWN = "__unknown__"

Ancestors

Class variables

var GROUP
var INVALID
var MACHINE
var UNKNOWN
var USER
class PatreonData (*args: Any, **kwargs: Any)

Data class representing a Patreon data.

Expand source code
@resonite_class
class PatreonData:
    """ Data class representing a Patreon data.
    """

    isPatreonSupporter: bool
    """Whether the user is a Patreon supporter."""
    patreonId: Optional[str] = None
    """The Patreon ID of the user."""
    lastPatreonEmail: str
    """The last Patreon email associated with the user."""
    snapshots: List[Snapshot]
    """A list of snapshots associated with the user."""
    lastPatreonPledgeCents: int
    """The last Patreon pledge amount in cents."""
    lastTotalCents: int
    """The last total amount in cents."""
    minimumTotalUnits: int
    """The minimum total units."""
    externalCents: int
    """The external amount in cents."""
    lastExternalCents: int
    """The last external amount in cents."""
    hasSupported: bool
    """Whether the user has supported."""
    lastIsAnorak: Optional[bool] = None # Deprecated
    """Deprecated"""
    priorityIssue: int
    """The priority issue."""
    lastPlusActivationTime: Optional[datetime] = None # Depreacted
    """Deprecated"""
    lastActivationTime: Optional[datetime] = None # Deprecated
    """Deprecated"""
    lastPlusPledgeAmount: Optional[int] = None # Deprecated
    """Deprecated"""
    lastPaidPledgeAmount: int
    """The last paid pledge amount."""
    accountName: Optional[str] = None # Deprecated
    """Deprecated"""
    currentAccountType: Optional[int] = None # Deprecated
    """Deprecated"""
    currentAccountCents: Optional[int] = None # Deprecated
    """Deprecated"""
    pledgedAccountType: Optional[int] = None # Deprecated
    """Deprecated"""

Class variables

var accountName : Optional[str]

Deprecated

var currentAccountCents : Optional[int]

Deprecated

var currentAccountType : Optional[int]

Deprecated

var externalCents : int

The external amount in cents.

var hasSupported : bool

Whether the user has supported.

var isPatreonSupporter : bool

Whether the user is a Patreon supporter.

var lastActivationTime : Optional[datetime.datetime]

Deprecated

var lastExternalCents : int

The last external amount in cents.

var lastIsAnorak : Optional[bool]

Deprecated

var lastPaidPledgeAmount : int

The last paid pledge amount.

var lastPatreonEmail : str

The last Patreon email associated with the user.

var lastPatreonPledgeCents : int

The last Patreon pledge amount in cents.

var lastPlusActivationTime : Optional[datetime.datetime]

Deprecated

var lastPlusPledgeAmount : Optional[int]

Deprecated

var lastTotalCents : int

The last total amount in cents.

var minimumTotalUnits : int

The minimum total units.

var patreonId : Optional[str]

The Patreon ID of the user.

var pledgedAccountType : Optional[int]

Deprecated

var priorityIssue : int

The priority issue.

var snapshots : List[Snapshot]

A list of snapshots associated with the user.

class Platform (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class Platform:
    name: str
    shortNamePrefix: str
    abbreviation: str
    domain: str
    moderationURL: str
    supportURL: str
    policiesPage: str
    email: str
    discordInviteURL: str
    patreonURL: str
    webRecordEndpoint: str
    webSessionEndpoint: str
    groupId: str
    teamGroupId: str
    computeGroupId: str
    networkGroupId: str
    appUsername: str
    devBotUsername: str
    computeUsername: str
    networkUsername: str
    appUserId: str
    devBotUserId: str
    computeUserId: str
    networkUserId: str
    authScheme: str
    appScheme: str
    dbScheme: str
    sessionScheme: str
    recordScheme: str
    userSessionScheme: str
    steamAppId: str
    discordAppId: int
    studioNameLong: str
    studioNameShort: str
    wiki: str

Class variables

var abbreviation : str
var appScheme : str
var appUserId : str
var appUsername : str
var authScheme : str
var computeGroupId : str
var computeUserId : str
var computeUsername : str
var dbScheme : str
var devBotUserId : str
var devBotUsername : str
var discordAppId : int
var discordInviteURL : str
var domain : str
var email : str
var groupId : str
var moderationURL : str
var name : str
var networkGroupId : str
var networkUserId : str
var networkUsername : str
var patreonURL : str
var policiesPage : str
var recordScheme : str
var sessionScheme : str
var shortNamePrefix : str
var steamAppId : str
var studioNameLong : str
var studioNameShort : str
var supportURL : str
var teamGroupId : str
var userSessionScheme : str
var webRecordEndpoint : str
var webSessionEndpoint : str
var wiki : str
class ProfileData (*args: Any, **kwargs: Any)

Data class representing a profile data.

Expand source code
@resonite_class
class ProfileData:
    """ Data class representing a profile data.
    """

    iconUrl: Optional[str] = None
    """The URL of the profile icon."""
    tokenOutOut: Optional[List[str]] = None
    """The list of token outputs."""
    displayBadges: Optional[list] = None
    """The list of display badges."""
    tagline: Optional[str] = None
    """The tagline of the profile."""
    description: Optional[str] = None
    """The description of the profile."""
    pronouns: Optional[str] = None
    """The pronouns of the profile."""

Class variables

var description : Optional[str]

The description of the profile.

var displayBadges : Optional[list]

The list of display badges.

var iconUrl : Optional[str]

The URL of the profile icon.

var pronouns : Optional[str]

The pronouns of the profile.

var tagline : Optional[str]

The tagline of the profile.

var tokenOutOut : Optional[List[str]]

The list of token outputs.

class PublicRSAKey (*args: Any, **kwargs: Any)

Data class representing a public RSA key.

Expand source code
@resonite_class
class PublicRSAKey:
    """ Data class representing a public RSA key.
    """

    Exponent: str
    """The exponent of the RSA key."""
    Modulus: str
    """The modulus of the RSA key."""
    P: Optional[str] = None
    Q: Optional[str] = None
    DP: Optional[str] = None
    DQ: Optional[str] = None
    InverseQ: Optional[str] = None
    D: Optional[str] = None

Class variables

var D : Optional[str]
var DP : Optional[str]
var DQ : Optional[str]
var Exponent : str

The exponent of the RSA key.

var InverseQ : Optional[str]
var Modulus : str

The modulus of the RSA key.

var P : Optional[str]
var Q : Optional[str]
class QuotaBytesSources (*args: Any, **kwargs: Any)

Data class representing the quota bytes sources.

Expand source code
@resonite_class
class QuotaBytesSources:
    """ Data class representing the quota bytes sources.
    """

    base: int
    """The base quota bytes."""
    patreon: int
    """The Patreon quota bytes."""
    paid: int
    """The paid quota bytes."""
    mmc21_honorary: int
    """The MMC21 honorary quota bytes."""

Class variables

var base : int

The base quota bytes.

var mmc21_honorary : int

The MMC21 honorary quota bytes.

var paid : int

The paid quota bytes.

var patreon : int

The Patreon quota bytes.

class RecordType (*args, **kwds)

Enum representing the type of a Resonite record.

Expand source code
class RecordType(UnknownEnumMixin, Enum):
    """ Enum representing the type of a Resonite record.
    """

    OBJECT = "object"
    """Represents an object record."""
    LINK = "link"
    """Represents a link record."""
    DIRECTORY = "directory"
    """Represents a directory record."""
    WORLD = "world"
    """Represents a world record."""
    TEXTURE = "texture"
    """Represents a texture record."""
    AUDIO = "audio"
    """Represents an audio record."""
    UNKNOWN = "__unknown__"

Ancestors

Class variables

var AUDIO

Represents an audio record.

var DIRECTORY

Represents a directory record.

Represents a link record.

var OBJECT

Represents an object record.

var TEXTURE

Represents a texture record.

var UNKNOWN
var WORLD

Represents a world record.

class ResoniteAssetManifestEntry (*args: Any, **kwargs: Any)

Data class representing an asset referenced by a record.

Expand source code
@resonite_class
class ResoniteAssetManifestEntry:
    """ Data class representing an asset referenced by a record.
    """

    hash: str
    """The hash of the asset in the Resonite asset database."""
    bytes: int
    """The size of the asset in bytes."""

Class variables

var bytes : int

The size of the asset in bytes.

var hash : str

The hash of the asset in the Resonite asset database.

class ResoniteAudio (*args: Any, **kwargs: Any)

Data class representing a Resonite audio.

Expand source code
@resonite_class
class ResoniteAudio(ResoniteRecord):
    """ Data class representing a Resonite audio.
    """
    pass

Ancestors

Inherited members

class ResoniteBadge (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteBadge:
    tag: str
    url: str
    slotName: str

Class variables

var slotName : str
var tag : str
var url : str
class ResoniteCloudVar (*args: Any, **kwargs: Any)

Representation of Resonite clound variable.

Expand source code
@resonite_class
class ResoniteCloudVar:
    """Representation of Resonite clound variable."""
    ownerId: str
    """The ownerId of a ResoniteCloudVar should start with `U-`"""
    path: str
    """The path of a ResoniteCloudVar should start with a `U-` for a user owned path and a `G-` for a group owned path."""
    value: Optional[str] = None
    partitionKey: str
    rowKey: str
    timestamp: Optional[str] = None
    eTag: Optional[str] = None

Class variables

var eTag : Optional[str]
var ownerId : str

The ownerId of a ResoniteCloudVar should start with U-

var partitionKey : str
var path : str

The path of a ResoniteCloudVar should start with a U- for a user owned path and a G- for a group owned path.

var rowKey : str
var timestamp : Optional[str]
var value : Optional[str]
class ResoniteCloudVarDefs (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteCloudVarDefs:
    definitionOwnerId: str
    subpath: str
    variableType: str
    defaultValue: Optional[str] = None
    deleteScheduled: bool
    readPermissions: List[str]
    writePermissions: List[str]
    listPermissions: List[str]
    partitionKey: str
    rowKey: str
    timestamp: str
    eTag: str

Class variables

var defaultValue : Optional[str]
var definitionOwnerId : str
var deleteScheduled : bool
var eTag : str
var listPermissions : List[str]
var partitionKey : str
var readPermissions : List[str]
var rowKey : str
var subpath : str
var timestamp : str
var variableType : str
var writePermissions : List[str]
class ResoniteContact (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteContact:
    id: str
    contactUsername: str
    contactStatus: ContactStatus
    isAccepted: bool
    profile: Optional[ProfileData] = None
    latestMessageTime: datetime
    isMigrated: bool
    isCounterpartMigrated: bool
    ownerId: str
    universeId: Optional[str] = None

Class variables

var contactStatusContactStatus
var contactUsername : str
var id : str
var isAccepted : bool
var isCounterpartMigrated : bool
var isMigrated : bool
var latestMessageTime : datetime.datetime
var ownerId : str
var profile : Optional[ProfileData]
var universeId : Optional[str]
class ResoniteDirectory (*args: Any, **kwargs: Any)

Data class representing a Resonite directory.

Expand source code
@resonite_class
class ResoniteDirectory(ResoniteRecord):
    """ Data class representing a Resonite directory.
    """

    lastModifyingMachineId: Optional[str] = None
    """The ID of the machine that last modified the directory."""
    ownerName: str
    """The name of the owner of the directory."""
    tags: List[str]
    """The tags associated with the directory."""
    creationTime: Optional[datetime] = None
    """The creation time of the directory."""
    migrationMetadata: Optional[dict] = None
    assetManifest: Optional[List[ResoniteAssetManifestEntry]] = None

    @property
    def content_path(self) -> str:
        """The path of the content within the directory."""
        return str(PureWindowsPath(self.path, self.name))

Ancestors

Class variables

var assetManifest : Optional[List[ResoniteAssetManifestEntry]]
var lastModifyingMachineId : Optional[str]

The ID of the machine that last modified the directory.

var migrationMetadata : Optional[dict]

Instance variables

var content_path : str

The path of the content within the directory.

Expand source code
@property
def content_path(self) -> str:
    """The path of the content within the directory."""
    return str(PureWindowsPath(self.path, self.name))

Inherited members

class ResoniteEntitlementDeleteRecovery (*args: Any, **kwargs: Any)

Data class representing the entitlement for deleting recovery data in Resonite.

Expand source code
@resonite_class
class ResoniteEntitlementDeleteRecovery:
    """ Data class representing the entitlement for deleting recovery data in Resonite.
    """

    type_: Literal['deleteRecovery'] = Field(alias='$type', default='deleteRecovery')
    """The $type tag sent by the API for this entitlement."""
    entitlementOrigins: list[str]
    """The entitlement origins."""

Class variables

var entitlementOrigins : list[str]

The entitlement origins.

var type_ : Literal['deleteRecovery']

The $type tag sent by the API for this entitlement.

class ResoniteGroup (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteGroup:
    id: str
    adminUserId: str
    name: str
    isMigrated: bool

Class variables

var adminUserId : str
var id : str
var isMigrated : bool
var name : str
class ResoniteGroupMember (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteGroupMember:
    id: str
    isMigrated: bool
    ownerId: str

Class variables

var id : str
var isMigrated : bool
var ownerId : str
class ResoniteHubUserStatus (*args: Any, **kwargs: Any)

Data class representing a user status as sent by the hub's event.

Expand source code
@resonite_class
class ResoniteHubUserStatus:
    """ Data class representing a user status as sent by the hub's event."""

    userId: str
    """The ID of the user this status belongs to."""
    userSessionId: str
    """The ID of the user session broadcasting this status."""
    sessionType: UserSessionType
    """The kind of client behind this user session."""
    isMobile: bool
    """Whether the user is on a mobile device."""
    isPresent: bool
    """Whether the user is present at their device."""
    lastStatusChange: datetime
    """The timestamp of the last status change."""
    hashSalt: Optional[str] = None
    """Salt used to hash the session ids in sessions."""
    appVersion: str
    """The version of the app broadcasting this status."""
    sessions: List[ResoniteSessionMetadata]
    """The sessions the user is currently in (hashed)."""
    currentSessionIndex: int
    """The index is sessions of the user's current session."""
    onlineStatus: Optional[OnlineStatus] = None
    """The online status of the user. Headless sessions send none."""
    outputDevice: Optional[str] = None
    """The output device of the user."""
    lastPresenceTimestamp: Optional[datetime] = None
    """The timestamp of the last presence change."""
    compatibilityHash: Optional[str] = None
    """The compatibility hash."""
    publicRSAKey: Optional[PublicRSAKey] = None
    """The public RSA key of this user session."""

Class variables

var appVersion : str

The version of the app broadcasting this status.

var compatibilityHash : Optional[str]

The compatibility hash.

var currentSessionIndex : int

The index is sessions of the user's current session.

var hashSalt : Optional[str]

Salt used to hash the session ids in sessions.

var isMobile : bool

Whether the user is on a mobile device.

var isPresent : bool

Whether the user is present at their device.

var lastPresenceTimestamp : Optional[datetime.datetime]

The timestamp of the last presence change.

var lastStatusChange : datetime.datetime

The timestamp of the last status change.

var onlineStatus : Optional[OnlineStatus]

The online status of the user. Headless sessions send none.

var outputDevice : Optional[str]

The output device of the user.

var publicRSAKey : Optional[PublicRSAKey]

The public RSA key of this user session.

var sessionTypeUserSessionType

The kind of client behind this user session.

var sessions : List[ResoniteSessionMetadata]

The sessions the user is currently in (hashed).

var userId : str

The ID of the user this status belongs to.

var userSessionId : str

The ID of the user session broadcasting this status.

Data class representing a Resonite link.

Expand source code
@resonite_class
class ResoniteLink(ResoniteRecord):
    """ Data class representing a Resonite link.
    """

    assetUri: Annotated[
        ParseResult,
        BeforeValidator(lambda v: urlparse(v) if isinstance(v, str) else v),
    ]
    """The parsed URI of the asset associated with the link."""

Ancestors

Inherited members

class ResoniteMessage (*args: Any, **kwargs: Any)

Representation of a Resonite message.

Expand source code
@resonite_class
class ResoniteMessage:
    """Representation of a Resonite message."""
    id: str
    senderId: str
    ownerId: str
    """The ownerId of a ResoniteMessage should start with `U-`"""
    sendTime: str
    recipientId: str
    messageType: ResoniteMessageType
    senderUserSessionId: Optional[str] = None
    isMigrated: bool
    readTime: Optional[datetime] = None
    otherId: Optional[str] = None
    lastUpdateTime: datetime
    description: Optional[str] = None
    content: Optional[
        ResoniteMessageContentText
        | ResoniteMessageContentSessionInvite
        | ResoniteMessageContentRequestInvite
        | ResoniteMessageContentObject
        | ResoniteMessageContentSound
        | ResoniteMessageContentUnknown
    ] = None

    @model_validator(mode='before')
    @classmethod
    def _parse_content(cls, data):
        if isinstance(data, dict) and isinstance(data.get('content'), str):
            raw = data['content']
            mtype = data.get('messageType')
            if mtype == 'Text':
                data = {**data, 'content': {'content': raw}}
            elif mtype in ('SessionInvite', 'InviteRequest', 'Object', 'Sound'):
                data = {**data, 'content': json.loads(raw)}
            else:
                data = {**data, 'content': {'raw': raw}}
        return data

Class variables

var content : Union[ResoniteMessageContentTextResoniteMessageContentSessionInviteResoniteMessageContentRequestInviteResoniteMessageContentObjectResoniteMessageContentSoundResoniteMessageContentUnknown, ForwardRef(None)]
var description : Optional[str]
var id : str
var isMigrated : bool
var lastUpdateTime : datetime.datetime
var messageTypeResoniteMessageType
var otherId : Optional[str]
var ownerId : str

The ownerId of a ResoniteMessage should start with U-

var readTime : Optional[datetime.datetime]
var recipientId : str
var sendTime : str
var senderId : str
var senderUserSessionId : Optional[str]
class ResoniteMessageContentObject (*args: Any, **kwargs: Any)

Data class representing the content of a Resonite object message.

Expand source code
@resonite_class
class ResoniteMessageContentObject:
    """ Data class representing the content of a Resonite object message.
    """

    id: str
    """The ID of the object."""
    ownerId: str
    """The ID of the object owner."""
    assetUri: str
    """The URI of the object asset."""
    version: Optional[ResoniteRecordVersion] = None
    """The version of the object record."""
    name: str
    """The name of the object."""
    recordType: RecordType
    """The type of the object record."""
    ownerName: Optional[str] = None
    """The name of the object owner."""
    tags: List[str]
    """The tags associated with the object."""
    path: Optional[str] = None
    """The path of the object."""
    thumbnailUri: str
    """The URI of the object thumbnail."""
    isPublic: bool
    """Whether the object is public."""
    isForPatrons: bool
    """Whether the object is for patrons."""
    isListed: bool
    """Whether the object is listed."""
    isReadOnly: bool
    """Whether the object is read-only."""
    lastModificationTime: datetime
    """The timestamp of the last modification."""
    creationTime: datetime
    """The timestamp of the creation."""
    firstPublishTime: Optional[datetime] = None
    """The timestamp of the first publish."""
    isDeleted: Optional[bool] = None
    """Whether the object is deleted."""
    visits: int
    """The number of visits."""
    rating: float
    """The rating of the object."""
    randomOrder: int
    """The random order of the object."""
    submissions: Optional[str] = None
    """The submissions of the object."""

Class variables

var assetUri : str

The URI of the object asset.

var creationTime : datetime.datetime

The timestamp of the creation.

var firstPublishTime : Optional[datetime.datetime]

The timestamp of the first publish.

var id : str

The ID of the object.

var isDeleted : Optional[bool]

Whether the object is deleted.

var isForPatrons : bool

Whether the object is for patrons.

var isListed : bool

Whether the object is listed.

var isPublic : bool

Whether the object is public.

var isReadOnly : bool

Whether the object is read-only.

var lastModificationTime : datetime.datetime

The timestamp of the last modification.

var name : str

The name of the object.

var ownerId : str

The ID of the object owner.

var ownerName : Optional[str]

The name of the object owner.

var path : Optional[str]

The path of the object.

var randomOrder : int

The random order of the object.

var rating : float

The rating of the object.

var recordTypeRecordType

The type of the object record.

var submissions : Optional[str]

The submissions of the object.

var tags : List[str]

The tags associated with the object.

var thumbnailUri : str

The URI of the object thumbnail.

var version : Optional[ResoniteRecordVersion]

The version of the object record.

var visits : int

The number of visits.

class ResoniteMessageContentRequestInvite (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteMessageContentRequestInvite:
    inviteRequestId: str
    userIdToInvite: str
    usernameToInvite: str
    requestingFromUserId: str
    requestingFromUsername: str
    forSessionId: Optional[str] = None
    forSessionName: Optional[str] = None
    isContactOfHost: Optional[str] = None
    response: Optional[str] = None
    invite: Optional[dict] = None

Class variables

var forSessionId : Optional[str]
var forSessionName : Optional[str]
var invite : Optional[dict]
var inviteRequestId : str
var isContactOfHost : Optional[str]
var requestingFromUserId : str
var requestingFromUsername : str
var response : Optional[str]
var userIdToInvite : str
var usernameToInvite : str
class ResoniteMessageContentSessionInvite (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteMessageContentSessionInvite:
    name: str
    description: Optional[str] = None
    correspondingWorldId: Optional[WorldId] = None
    tags: List[str]
    sessionId: str
    normalizedSessionId: str
    hostMachineId: str
    hostUsername: str
    hostUserId: Optional[str] = None
    hostUserSessionId: Optional[str] = None
    compatibilityHash: Optional[str] = None
    universeId: Optional[str] = None
    appVersion: Optional[str] = None
    headlessHost: Optional[bool] = None
    sessionURLs: List[str]
    thumbnailUrl: Optional[str] = None
    parentSessionIds: Optional[List[str]] = None
    nestedSessionIds: Optional[List[str]] = None
    sessionUsers: List[ResoniteSessionUser]
    thumbnail: Optional[str] = None
    joinedUsers: int
    activeUsers: int
    totalActiveUsers: int
    totalJoinedUsers: int
    maxUsers: int
    mobileFriendly: bool
    sessionBeginTime: datetime
    lastUpdate: datetime
    accessLevel: CurrentResoniteSessionAccessLevel
    broadcastKey: Optional[str] = None
    dataModelAssemblies: List[DataModelAssemblies]
    hideFromListing: bool
    systemCompatibilityHash: str
    awayKickEnabled: bool
    awayKickMinutes: int
    HasEnded: bool
    IsValid: bool

Class variables

var HasEnded : bool
var IsValid : bool
var accessLevelCurrentResoniteSessionAccessLevel
var activeUsers : int
var appVersion : Optional[str]
var awayKickEnabled : bool
var awayKickMinutes : int
var broadcastKey : Optional[str]
var compatibilityHash : Optional[str]
var correspondingWorldId : Optional[WorldId]
var dataModelAssemblies : List[DataModelAssemblies]
var description : Optional[str]
var headlessHost : Optional[bool]
var hideFromListing : bool
var hostMachineId : str
var hostUserId : Optional[str]
var hostUserSessionId : Optional[str]
var hostUsername : str
var joinedUsers : int
var lastUpdate : datetime.datetime
var maxUsers : int
var mobileFriendly : bool
var name : str
var nestedSessionIds : Optional[List[str]]
var normalizedSessionId : str
var parentSessionIds : Optional[List[str]]
var sessionBeginTime : datetime.datetime
var sessionId : str
var sessionURLs : List[str]
var sessionUsers : List[ResoniteSessionUser]
var systemCompatibilityHash : str
var tags : List[str]
var thumbnail : Optional[str]
var thumbnailUrl : Optional[str]
var totalActiveUsers : int
var totalJoinedUsers : int
var universeId : Optional[str]
class ResoniteMessageContentSound (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteMessageContentSound:
    id: str
    ownerId: Optional[str] = None
    assetUri: str
    globalVersion: Optional[int] = None
    localVersion: Optional[int] = None
    lastModifyingUserId: Optional[str] = None
    lastModifyingMachineId: Optional[str] = None
    name: str
    recordType: RecordType
    ownerName: Optional[str] = None
    tags: List[str]
    path: Optional[str] = None
    isPublic: bool
    isForPatrons: Optional[bool] = None
    isListed: bool
    lastModificationTime: datetime
    creationTime: datetime
    firstPublishTime: Optional[datetime] = None
    visits: int
    rating: float
    randomOrder: int
    submissions: Optional[str] = None
    neosDBmanifest: Optional[list] = None
    assetManifest: List[ResoniteAssetManifestEntry]
    isForPatrons: bool
    version: ResoniteRecordVersion
    isDeleted: bool
    isReadOnly: Optional[bool] = None
    description: Optional[str] = None
    thumbnailUri: Optional[str] = None
    rootRecordId: Optional[int] = None
    migrationMetadata: Optional[str] = None
    IsValidOwnerId: bool
    IsValidRecordId: bool

Class variables

var IsValidOwnerId : bool
var IsValidRecordId : bool
var assetManifest : List[ResoniteAssetManifestEntry]
var assetUri : str
var creationTime : datetime.datetime
var description : Optional[str]
var firstPublishTime : Optional[datetime.datetime]
var globalVersion : Optional[int]
var id : str
var isDeleted : bool
var isForPatrons : bool
var isListed : bool
var isPublic : bool
var isReadOnly : Optional[bool]
var lastModificationTime : datetime.datetime
var lastModifyingMachineId : Optional[str]
var lastModifyingUserId : Optional[str]
var localVersion : Optional[int]
var migrationMetadata : Optional[str]
var name : str
var neosDBmanifest : Optional[list]
var ownerId : Optional[str]
var ownerName : Optional[str]
var path : Optional[str]
var randomOrder : int
var rating : float
var recordTypeRecordType
var rootRecordId : Optional[int]
var submissions : Optional[str]
var tags : List[str]
var thumbnailUri : Optional[str]
var versionResoniteRecordVersion
var visits : int
class ResoniteMessageContentText (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteMessageContentText:
    content: str

    def __str__(self) -> str:
        return self.content

Class variables

var content : str
class ResoniteMessageContentUnknown (*args: Any, **kwargs: Any)

Fallback content for message types this module doesn't know yet.

Expand source code
@resonite_class
class ResoniteMessageContentUnknown:
    """ Fallback content for message types this module doesn't know yet.
    """
    raw: str

Class variables

var raw : str
class ResoniteMessageType (*args, **kwds)

Enum representing a Resonite message type.

Expand source code
class ResoniteMessageType(UnknownEnumMixin, Enum):
    """ Enum representing a Resonite message type.
    """

    TEXT = "Text"
    """Text type message."""
    OBJECT = "Object"
    """Object type message."""
    SOUND = "Sound"
    """Audio type message."""
    SESSIONINVITE = "SessionInvite"
    """Session invite type message."""
    INVITEREQUEST = "InviteRequest"
    """Invite request type message."""
    CREDITTRANSFER = "CreditTransfer"
    """Credit transfert type message."""
    SUGARCUBES = "SugarCubes"
    """Sugar cubes type message."""
    UNKNOWN = "__unknown__"

Ancestors

Class variables

var CREDITTRANSFER

Credit transfert type message.

var INVITEREQUEST

Invite request type message.

var OBJECT

Object type message.

var SESSIONINVITE

Session invite type message.

var SOUND

Audio type message.

var SUGARCUBES

Sugar cubes type message.

var TEXT

Text type message.

var UNKNOWN
class ResoniteObject (*args: Any, **kwargs: Any)

Data class representing a Resonite object.

Expand source code
@resonite_class
class ResoniteObject(ResoniteRecord):
    """ Data class representing a Resonite object.
    """

    assetUri: str
    """The URI of the asset associated with the object."""
    lastModifyingMachineId: Optional[str] = None
    """ The ID of the machine that last modified the object."""
    ownerName: str
    """The name of the owner of the object."""
    tags: List[str]
    """The tags associated with the object."""
    creationTime: datetime
    """The creation time of the object."""

Ancestors

Class variables

var lastModifyingMachineId : Optional[str]

The ID of the machine that last modified the object.

Inherited members

class ResoniteRecord (*args: Any, **kwargs: Any)

Data class representing a Resonite record.

Expand source code
@resonite_class
class ResoniteRecord:
    """ Data class representing a Resonite record.
    """

    id: str
    """The ID of the record."""
    assetUri: Optional[str] = None
    """The URI of the asset associated with the record."""
    version: ResoniteRecordVersion
    """The version of the record."""
    name: str
    """The name of the record."""
    recordType: RecordType
    """The type of the record."""
    ownerName: str
    """The name of the owner of the record."""
    path: Optional[str] = None
    """The path of the record."""
    thumbnailUri: Optional[str] = None
    """The URI of the thumbnail associated with the record."""
    isPublic: bool
    """Whether the record is public."""
    isForPatrons: bool
    """Whether the record is for patrons."""
    isListed: bool
    """Whether the record is listed."""
    isDeleted: bool
    """Whether the record is deleted."""
    tags: Optional[list] = None
    """The tags associated with the record."""
    creationTime: Optional[datetime] = None
    """The creation time of the record."""
    lastModificationTime: datetime
    """The last modification time of the record."""
    randomOrder: int
    """The random order of the record."""
    visits: int
    """The number of visits to the record."""
    rating: int
    """The rating of the record."""
    ownerId: str
    """The ID of the owner of the record."""
    isReadOnly: bool
    """Whether the record is read only."""

Subclasses

Class variables

var assetUri : Optional[str]

The URI of the asset associated with the record.

var creationTime : Optional[datetime.datetime]

The creation time of the record.

var id : str

The ID of the record.

var isDeleted : bool

Whether the record is deleted.

var isForPatrons : bool

Whether the record is for patrons.

var isListed : bool

Whether the record is listed.

var isPublic : bool

Whether the record is public.

var isReadOnly : bool

Whether the record is read only.

var lastModificationTime : datetime.datetime

The last modification time of the record.

var name : str

The name of the record.

var ownerId : str

The ID of the owner of the record.

var ownerName : str

The name of the owner of the record.

var path : Optional[str]

The path of the record.

var randomOrder : int

The random order of the record.

var rating : int

The rating of the record.

var recordTypeRecordType

The type of the record.

var tags : Optional[list]

The tags associated with the record.

var thumbnailUri : Optional[str]

The URI of the thumbnail associated with the record.

var versionResoniteRecordVersion

The version of the record.

var visits : int

The number of visits to the record.

class ResoniteRecordVersion (*args: Any, **kwargs: Any)

Data class representing the version of a Resonite record.

Expand source code
@resonite_class
class ResoniteRecordVersion:
    """ Data class representing the version of a Resonite record.
    """

    globalVersion: int
    """The global version of the record."""
    localVersion: int
    """The local version of the record."""
    lastModifyingUserId: Optional[str] = None
    """The ID of the user who last modified the record. (optional)"""
    lastModifyingMachineId: Optional[str] = None
    """The ID of the machine that last modified the record. (optional"""

Class variables

var globalVersion : int

The global version of the record.

var lastModifyingMachineId : Optional[str]

The ID of the machine that last modified the record. (optional

var lastModifyingUserId : Optional[str]

The ID of the user who last modified the record. (optional)

var localVersion : int

The local version of the record.

class ResoniteSession (*args: Any, **kwargs: Any)

Data class representing a Resonite session.

Expand source code
@resonite_class
class ResoniteSession:
    """ Data class representing a Resonite session.
    """

    activeSessions: Optional[str] = None
    """The active sessions."""
    activeUsers: int
    """ The number of active users."""
    compatibilityHash: Optional[str] = None
    """The compatibility hash."""
    systemCompatibilityHash: Optional[str] = None
    """The system compatibility hash."""
    correspondingWorldId: Optional[WorldId] = None
    """The corresponding world ID."""
    description: Optional[str] = None
    """The description of the session."""
    accessLevel: CurrentResoniteSessionAccessLevel
    """The access level of the session."""
    hasEnded: bool
    """Whether the session has ended."""
    headlessHost: bool
    """Whether the host is headless."""
    hostMachineId: str
    """The machine ID of the host."""
    hostUserSessionId: Optional[str] = None
    """The user session ID of the host."""
    hostUserId: Optional[str] = None
    """The user ID of the host."""
    hostUsername: str
    """The username of the host."""
    isValid: bool
    """Whether the session is valid."""
    joinedUsers: int
    """The number of joined users."""
    lastUpdate: datetime
    """The timestamp of the last update."""
    maxUsers: int
    """The maximum number of users."""
    mobileFriendly: bool
    """Whether the session is mobile-friendly."""
    name: str
    """The name of the session."""
    appVersion: str
    """The version of the app."""
    normalizedSessionId: str
    """The normalized session ID."""
    sessionBeginTime: datetime
    """The timestamp of the session begin time."""
    sessionId: str
    """The session ID."""
    nestedSessionIds: Optional[List[str]] = None
    """The IDs of the sessions nested under this session."""
    parentSessionIds: Optional[List[str]] = None
    """The IDs of the parent sessions of this session."""
    sessionURLs: List[str]
    """The URLs of the session."""
    sessionUsers: List[ResoniteSessionUser]
    """The users in the session."""
    tags: List[str]
    """The tags associated with the session."""
    thumbnailUrl: Optional[str] = None
    """The URL of the thumbnail."""
    totalActiveUsers: int
    """The total number of active users."""
    totalJoinedUsers: int
    """The total number of joined users."""
    hideFromListing: bool
    """Whether the session is hidden from listing."""
    dataModelAssemblies: List[DataModelAssemblies]
    """Data model assemblies."""
    universeId: Optional[str] = None
    """The universe id of the session."""
    awayKickEnabled: bool
    awayKickMinutes: int

Class variables

var accessLevelCurrentResoniteSessionAccessLevel

The access level of the session.

var activeSessions : Optional[str]

The active sessions.

var activeUsers : int

The number of active users.

var appVersion : str

The version of the app.

var awayKickEnabled : bool
var awayKickMinutes : int
var compatibilityHash : Optional[str]

The compatibility hash.

var correspondingWorldId : Optional[WorldId]

The corresponding world ID.

var dataModelAssemblies : List[DataModelAssemblies]

Data model assemblies.

var description : Optional[str]

The description of the session.

var hasEnded : bool

Whether the session has ended.

var headlessHost : bool

Whether the host is headless.

var hideFromListing : bool

Whether the session is hidden from listing.

var hostMachineId : str

The machine ID of the host.

var hostUserId : Optional[str]

The user ID of the host.

var hostUserSessionId : Optional[str]

The user session ID of the host.

var hostUsername : str

The username of the host.

var isValid : bool

Whether the session is valid.

var joinedUsers : int

The number of joined users.

var lastUpdate : datetime.datetime

The timestamp of the last update.

var maxUsers : int

The maximum number of users.

var mobileFriendly : bool

Whether the session is mobile-friendly.

var name : str

The name of the session.

var nestedSessionIds : Optional[List[str]]

The IDs of the sessions nested under this session.

var normalizedSessionId : str

The normalized session ID.

var parentSessionIds : Optional[List[str]]

The IDs of the parent sessions of this session.

var sessionBeginTime : datetime.datetime

The timestamp of the session begin time.

var sessionId : str

The session ID.

var sessionURLs : List[str]

The URLs of the session.

var sessionUsers : List[ResoniteSessionUser]

The users in the session.

var systemCompatibilityHash : Optional[str]

The system compatibility hash.

var tags : List[str]

The tags associated with the session.

var thumbnailUrl : Optional[str]

The URL of the thumbnail.

var totalActiveUsers : int

The total number of active users.

var totalJoinedUsers : int

The total number of joined users.

var universeId : Optional[str]

The universe id of the session.

class ResoniteSessionMetadata (*args: Any, **kwargs: Any)

Datra class representing one session entry inside a hub status update.

Expand source code
@resonite_class
class ResoniteSessionMetadata:
    """ Datra class representing one session entry inside a hub status update.
    """

    sessionHash: str
    accessLevel: CurrentResoniteSessionAccessLevel
    sessionHidden: bool
    isHost: bool
    broadcastKey: Optional[str] = None

Class variables

var accessLevelCurrentResoniteSessionAccessLevel
var broadcastKey : Optional[str]
var isHost : bool
var sessionHash : str
var sessionHidden : bool
class ResoniteSessionUser (*args: Any, **kwargs: Any)

Data class representing a Resonite session user.

Expand source code
@resonite_class
class ResoniteSessionUser:
    """ Data class representing a Resonite session user.
    """

    isPresent: bool
    """Whether the user is present."""
    userID: Optional[str] = None
    """The ID of the user."""
    username: str
    """The username of the user."""
    userSessionId: Optional[str] = None
    """The session ID of the user."""
    outputDevice: Optional[int] = None
    """The output device of the user."""

Class variables

var isPresent : bool

Whether the user is present.

var outputDevice : Optional[int]

The output device of the user.

var userID : Optional[str]

The ID of the user.

var userSessionId : Optional[str]

The session ID of the user.

var username : str

The username of the user.

class ResoniteTexture (*args: Any, **kwargs: Any)

Data class representing a Resonite texture.

Expand source code
@resonite_class
class ResoniteTexture(ResoniteRecord):
    """ Data class representing a Resonite texture.
    """
    pass

Ancestors

Inherited members

class ResoniteUser (*args: Any, **kwargs: Any)

Data class representing a Resonite user.

Expand source code
@resonite_class
class ResoniteUser:
    """ Data class representing a Resonite user.
    """

    id: str
    """The ID of the user."""
    username: str
    """The username of the user."""
    normalizedUsername: str
    """The normalized username of the user."""
    alternateNormalizedNames: Optional[list[str]] = None
    """The alternate normalized username of the user."""
    email: Optional[str] = None
    """The email of the user."""
    registrationDate: datetime
    """The registration date of the user."""
    isVerified: bool
    """Indicates whether the user is verified."""
    isLocked: bool
    """Whether the user is locked."""
    supressBanEvasion: bool
    """Whether ban evasion is suppressed for the user."""
    two_fa_login: Optional[bool] = Field(alias='2fa_login', default=None)
    """Whether two-factor authentication is enabled for login."""
    profile: Optional[ProfileData] = None
    """The profile data of the user."""
    supporterMetadata: Optional[List[
        Annotated[
            supporterMetadataPatreon
            | supporterMetadataStripe
            | supporterMetadataPromo,
            Field(discriminator='type_'),
        ]
        | supporterMetadataUnknown
    ]] = None
    """The Patreon supporter metadata of the user."""
    entitlements: Optional[List[
        Annotated[
            ResoniteUserEntitlementShoutOut
            | ResoniteUserEntitlementCredits
            | ResoniteUserEntitlementGroupCreation
            | ResoniteEntitlementDeleteRecovery
            | ResoniteUserEntitlementBadge
            | ResoniteUserEntitlementHeadless
            | ResoniteUserEntitlementExitMessage
            | ResoniteUserEntitlementStorageSpace,
            Field(discriminator='type_'),
        ]
        | ResoniteUserEntitlementUnknown
    ]] = None
    """The entitlements of the user."""
    migratedData: Optional[ResoniteUserMigrationData] = None
    """The migrated data of the user."""
    """The tags associated with the user."""
    isActiveSupporter: bool
    promoCode: Optional[str] = None
    tags: Optional[List[str]] = field(default_factory=list)

Class variables

var alternateNormalizedNames : Optional[list[str]]

The alternate normalized username of the user.

var email : Optional[str]

The email of the user.

var entitlements : Optional[List[Union[ResoniteUserEntitlementShoutOutResoniteUserEntitlementCreditsResoniteUserEntitlementGroupCreationResoniteEntitlementDeleteRecoveryResoniteUserEntitlementBadgeResoniteUserEntitlementHeadlessResoniteUserEntitlementExitMessageResoniteUserEntitlementStorageSpaceResoniteUserEntitlementUnknown]]]

The entitlements of the user.

var id : str

The ID of the user.

var isActiveSupporter : bool
var isLocked : bool

Whether the user is locked.

var isVerified : bool

Indicates whether the user is verified.

var migratedData : Optional[ResoniteUserMigrationData]

The migrated data of the user.

var normalizedUsername : str

The normalized username of the user.

var profile : Optional[ProfileData]

The profile data of the user.

var promoCode : Optional[str]
var registrationDate : datetime.datetime

The registration date of the user.

var supporterMetadata : Optional[List[Union[supporterMetadataPatreonsupporterMetadataStripesupporterMetadataPromosupporterMetadataUnknown]]]

The Patreon supporter metadata of the user.

var supressBanEvasion : bool

Whether ban evasion is suppressed for the user.

var tags : Optional[List[str]]
var two_fa_login : Optional[bool]

Whether two-factor authentication is enabled for login.

var username : str

The username of the user.

class ResoniteUserEntitlementBadge (*args: Any, **kwargs: Any)

Data class representing an entitlement badge for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserEntitlementBadge:
    """ Data class representing an entitlement badge for a Resonite user.
    """

    type_: Literal['badge'] = Field(alias='$type', default='badge')
    """The $type tag sent by the API for this entitlement."""
    badgeType: str
    """The type of the badge."""
    badgeCount: int
    """The count of the badge."""
    entitlementOrigins: list[str]
    """The entitlement origins."""

Class variables

var badgeCount : int

The count of the badge.

var badgeType : str

The type of the badge.

var entitlementOrigins : list[str]

The entitlement origins.

var type_ : Literal['badge']

The $type tag sent by the API for this entitlement.

class ResoniteUserEntitlementCredits (*args: Any, **kwargs: Any)

Data class representingan entitlement credit for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserEntitlementCredits:
    """ Data class representingan entitlement credit for a Resonite user.
    """

    type_: Literal['credits'] = Field(alias='$type', default='credits')
    """The $type tag sent by the API for this entitlement."""
    creditType: str
    """The type of the credit."""
    friendlyDescription: str
    """The friendly description of the credit."""
    entitlementOrigins: list[str]
    """The entitlement origins."""

Class variables

var creditType : str

The type of the credit.

var entitlementOrigins : list[str]

The entitlement origins.

var friendlyDescription : str

The friendly description of the credit.

var type_ : Literal['credits']

The $type tag sent by the API for this entitlement.

class ResoniteUserEntitlementExitMessage (*args: Any, **kwargs: Any)

Data class representing an exit message entitlement for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserEntitlementExitMessage:
    """ Data class representing an exit message entitlement for a Resonite user.
    """

    type_: Literal['exitMessage'] = Field(alias='$type', default='exitMessage')
    """The $type tag sent by the API for this entitlement."""
    isLifetime: bool
    """Indicates whether the entitlement is lifetime."""
    messageCount: int
    """The count of exit messages."""
    friendlyDescription: str
    """The friendly description of the exit message entitlement."""
    entitlementOrigins: list[str]
    """The entitlement origins."""

Class variables

var entitlementOrigins : list[str]

The entitlement origins.

var friendlyDescription : str

The friendly description of the exit message entitlement.

var isLifetime : bool

Indicates whether the entitlement is lifetime.

var messageCount : int

The count of exit messages.

var type_ : Literal['exitMessage']

The $type tag sent by the API for this entitlement.

class ResoniteUserEntitlementGroupCreation (*args: Any, **kwargs: Any)

Data class representing the entitlement for the group creation for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserEntitlementGroupCreation:
    """ Data class representing the entitlement for the group creation for a Resonite user.
    """

    type_: Literal['groupCreation'] = Field(alias='$type', default='groupCreation')
    """The $type tag sent by the API for this entitlement."""
    groupCount: int
    """The number of groups the user is entitled to create."""
    entitlementOrigins: list[str]
    """The entitlement origins."""

Class variables

var entitlementOrigins : list[str]

The entitlement origins.

var groupCount : int

The number of groups the user is entitled to create.

var type_ : Literal['groupCreation']

The $type tag sent by the API for this entitlement.

class ResoniteUserEntitlementHeadless (*args: Any, **kwargs: Any)

Data class representing a headless entitlement for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserEntitlementHeadless:
    """ Data class representing a headless entitlement for a Resonite user.
    """

    type_: Literal['headless'] = Field(alias='$type', default='headless')
    """The $type tag sent by the API for this entitlement."""
    friendlyDescription: str
    """The friendly description of the headless entitlement."""
    entitlementOrigins: list[str]
    """The entitlement origins."""

Class variables

var entitlementOrigins : list[str]

The entitlement origins.

var friendlyDescription : str

The friendly description of the headless entitlement.

var type_ : Literal['headless']

The $type tag sent by the API for this entitlement.

class ResoniteUserEntitlementShoutOut (*args: Any, **kwargs: Any)

Data class representing an entitlement shout-out for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserEntitlementShoutOut:
    """ Data class representing an entitlement shout-out for a Resonite user.
    """

    type_: Literal['shoutOut'] = Field(alias='$type', default='shoutOut')
    """The $type tag sent by the API for this entitlement."""
    shoutoutType: str
    """The type of the shout-out."""
    friendlyDescription: str
    """The friendly description of the shout-out."""

Class variables

var friendlyDescription : str

The friendly description of the shout-out.

var shoutoutType : str

The type of the shout-out.

var type_ : Literal['shoutOut']

The $type tag sent by the API for this entitlement.

class ResoniteUserEntitlementStorageSpace (*args: Any, **kwargs: Any)

Data class representing a storage space entitlement for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserEntitlementStorageSpace:
    """ Data class representing a storage space entitlement for a Resonite user.
    """

    type_: Literal['storageSpace'] = Field(alias='$type', default='storageSpace')
    """The $type tag sent by the API for this entitlement."""
    bytes: int
    """The amount of storage space in bytes."""
    maximumShareLevel: str
    """The maximum share level."""
    storageId: str
    """The ID of the storage space."""
    group: str
    """The group associated with the storage space."""
    startsOn: datetime
    """The start date of the entitlement."""
    expiresOn: datetime
    """The expiration date of the entitlement."""
    name: str
    """The name of the storage space."""
    description: str
    """The description of the storage space."""
    entitlementOrigins: list[str]
    """The entitlement origins."""

Class variables

var bytes : int

The amount of storage space in bytes.

var description : str

The description of the storage space.

var entitlementOrigins : list[str]

The entitlement origins.

var expiresOn : datetime.datetime

The expiration date of the entitlement.

var group : str

The group associated with the storage space.

var maximumShareLevel : str

The maximum share level.

var name : str

The name of the storage space.

var startsOn : datetime.datetime

The start date of the entitlement.

var storageId : str

The ID of the storage space.

var type_ : Literal['storageSpace']

The $type tag sent by the API for this entitlement.

class ResoniteUserEntitlementUnknown (*args: Any, **kwargs: Any)

Fallback for entitlement types this module doesn't know yet.

Expand source code
@resonite_class
class ResoniteUserEntitlementUnknown:
    """ Fallback for entitlement types this module doesn't know yet.
    """
    type_: str = Field(alias='$type', default='__unknown__')

Class variables

var type_ : str
class ResoniteUserMembership (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class ResoniteUserMembership:
    id: str
    groupName: str
    isMigrated: bool
    ownerId: str

Class variables

var groupName : str
var id : str
var isMigrated : bool
var ownerId : str
class ResoniteUserMigrationData (*args: Any, **kwargs: Any)

Data class representing the migration data for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserMigrationData:
    """ Data class representing the migration data for a Resonite user.
    """

    username: str
    """The username of the user."""
    email: Optional[str] = None
    """The email of the user."""
    userId: str
    """The ID of the user."""
    quotaBytes: int
    """The quota bytes of the user."""
    usedBytes: int
    """The used bytes of the user."""
    patreonData: Optional[PatreonData] = None
    """ The Patreon data of the user."""
    quotaBytesSources: Optional[ResoniteUserQuotaBytesSources] = None
    """The quota bytes sources of the user."""
    registrationDate: datetime
    """The registration date of the user."""

Class variables

var email : Optional[str]

The email of the user.

var patreonData : Optional[PatreonData]

The Patreon data of the user.

var quotaBytes : int

The quota bytes of the user.

var quotaBytesSources : Optional[ResoniteUserQuotaBytesSources]

The quota bytes sources of the user.

var registrationDate : datetime.datetime

The registration date of the user.

var usedBytes : int

The used bytes of the user.

var userId : str

The ID of the user.

var username : str

The username of the user.

class ResoniteUserQuotaBytesSources (*args: Any, **kwargs: Any)

Data class representing the quota bytes sources for a Resonite user.

Expand source code
@resonite_class
class ResoniteUserQuotaBytesSources:
    """ Data class representing the quota bytes sources for a Resonite user.
    """

    base: int
    """The base quota bytes."""
    patreon: Optional[int] = None
    """The Patreon quota bytes."""
    paid: Optional[int] = None
    """The paid quota bytes."""

Class variables

var base : int

The base quota bytes.

var paid : Optional[int]

The paid quota bytes.

var patreon : Optional[int]

The Patreon quota bytes.

class ResoniteUserStatus (*args: Any, **kwargs: Any)

Data class representing the status of a Resonite user.

Expand source code
@resonite_class
class ResoniteUserStatus:
    """ Data class representing the status of a Resonite user.
    """

    onlineStatus: OnlineStatus
    """The online status of the user."""
    lastStatusChange: datetime
    """The timestamp of the last status change."""
    currentSessionAccessLevel: int
    """The access level of the current session."""
    currentSessionHidden: bool
    """Whether the current session is hidden."""
    currentHosting: bool
    """Whether the user is currently hosting a session."""
    compatibilityHash: Optional[str] = None
    """The compatibility hash."""
    neosVersion: Optional[str] = None
    """The version of Neos. """
    publicRSAKey: Optional[PublicRSAKey] = None
    """The public RSA key."""
    OutputDevice: Optional[str] = None
    """The output device."""
    isMobile: bool
    """Whether the user is on a mobile device."""

Class variables

var OutputDevice : Optional[str]

The output device.

var compatibilityHash : Optional[str]

The compatibility hash.

var currentHosting : bool

Whether the user is currently hosting a session.

var currentSessionAccessLevel : int

The access level of the current session.

var currentSessionHidden : bool

Whether the current session is hidden.

var isMobile : bool

Whether the user is on a mobile device.

var lastStatusChange : datetime.datetime

The timestamp of the last status change.

var neosVersion : Optional[str]

The version of Neos.

var onlineStatusOnlineStatus

The online status of the user.

var publicRSAKey : Optional[PublicRSAKey]

The public RSA key.

class ResoniteWorld (*args: Any, **kwargs: Any)

Data class representing a Resonite world.

Expand source code
@resonite_class
class ResoniteWorld(ResoniteRecord):
    """ Data class representing a Resonite world.
    """
    pass

Ancestors

Inherited members

class Snapshot (*args: Any, **kwargs: Any)

Data class representing a snapshot of data.

Expand source code
@resonite_class
class Snapshot:
    """ Data class representing a snapshot of data.
    """

    totalCents: int
    """The total cents."""
    patreonRawCents: int
    """The raw cents from Patreon."""
    deltaCents: int
    """The delta cents."""
    pledgeCents: int
    """The pledge cents."""
    email: str
    """The email associated with the snapshot."""
    timestamp: str
    """The timestamp of the snapshot."""

Class variables

var deltaCents : int

The delta cents.

var email : str

The email associated with the snapshot.

var patreonRawCents : int

The raw cents from Patreon.

var pledgeCents : int

The pledge cents.

var timestamp : str

The timestamp of the snapshot.

var totalCents : int

The total cents.

class UnknownEnumMixin
Expand source code
class UnknownEnumMixin:

    @classmethod
    def _missing_(cls, value):
        logger.warning(
            "Unknown %s value %r, falling back to %s.UNKNOWN",
            cls.__name__, value, cls.__name__,
        )
        return cls.UNKNOWN

Subclasses

class UserSessionType (*args, **kwds)

Enum representing the kind of client behind a user session.

Expand source code
class UserSessionType(UnknownEnumMixin, Enum):
    """ Enum representing the kind of client behind a user session.
    """

    GRAPHICAL_CLIENT = "GraphicalClient"
    """The full Resonite client."""
    CHAT_CLIENT = "ChatClient"
    """A chat-only client."""
    HEADLESS = "Headless"
    """A headless server."""
    BOT = "Bot"
    """A bot."""
    UNKNOWN = "__unknown__"
    """Fallback for session types this module doesn't know yet."""

Ancestors

Class variables

var BOT

A bot.

var CHAT_CLIENT

A chat-only client.

var GRAPHICAL_CLIENT

The full Resonite client.

var HEADLESS

A headless server.

var UNKNOWN

Fallback for session types this module doesn't know yet.

class UserStatusData (*args: Any, **kwargs: Any)

Data class representing an user status data.

Expand source code
@resonite_class
class UserStatusData:
    """ Data class representing an user status data.
    """

    activeSessions: Optional[List[ResoniteSession]] = None
    """The list of active sessions."""
    currentSession: Optional[ResoniteSession] = None
    """The current session."""
    compatibilityHash: Optional[str] = None
    """The compatibility hash."""
    currentHosting: bool
    """Whether the user is currently hosting a session."""
    currentSessionAccessLevel: CurrentResoniteSessionAccessLevel
    """The access level of the current session."""
    currentSessionHidden: bool
    """Whether the current session is hidden."""
    currentSessionId: Optional[str] = None
    """The ID of the current session."""
    isMobile: bool
    """Whether the user is on a mobile device."""
    lastStatusChange: datetime
    """The timestamp of the last status change."""
    neosVersion: Optional[str] = None
    """The version of Neos."""
    onlineStatus: OnlineStatus
    """The online status of the user."""
    OutputDevice: Optional[str] = None
    """The output device of the user."""
    publicRSAKey: Optional[PublicRSAKey] = None
    """The public RSA key of the user."""

Class variables

var OutputDevice : Optional[str]

The output device of the user.

var activeSessions : Optional[List[ResoniteSession]]

The list of active sessions.

var compatibilityHash : Optional[str]

The compatibility hash.

var currentHosting : bool

Whether the user is currently hosting a session.

var currentSession : Optional[ResoniteSession]

The current session.

var currentSessionAccessLevelCurrentResoniteSessionAccessLevel

The access level of the current session.

var currentSessionHidden : bool

Whether the current session is hidden.

var currentSessionId : Optional[str]

The ID of the current session.

var isMobile : bool

Whether the user is on a mobile device.

var lastStatusChange : datetime.datetime

The timestamp of the last status change.

var neosVersion : Optional[str]

The version of Neos.

var onlineStatusOnlineStatus

The online status of the user.

var publicRSAKey : Optional[PublicRSAKey]

The public RSA key of the user.

class WorldId (*args: Any, **kwargs: Any)

Data class representing a World ID.

Expand source code
@resonite_class
class WorldId:
    """ Data class representing a World ID.
    """

    ownerId: str
    """The owner ID of the world. Start with `U-`"""
    recordId: str
    """The record ID of the world."""

Class variables

var ownerId : str

The owner ID of the world. Start with U-

var recordId : str

The record ID of the world.

class supporterMetadataPatreon (*args: Any, **kwargs: Any)

Data class representing the Patreon supporter metadata.

Expand source code
@resonite_class
class supporterMetadataPatreon:
    """ Data class representing the Patreon supporter metadata.
    """

    type_: Literal['patreon'] = Field(alias='$type', default='patreon')
    """The $type tag sent by the API for this supporter metadata."""
    isActiveSupporter: bool
    """Whether the user is an active supporter."""
    isActive: bool
    """Whether the user is an active."""
    totalSupportMonths: int
    """The total number of months of support."""
    totalSupportCents: int
    """The total amount of support in cents."""
    lastTierCents: int
    """The amount of the last tier in cents."""
    highestTierCents: int
    """The amount of the highest tier in cents."""
    lowestTierCents: int
    """The amount of the lowest tier in cents."""
    firstSupportTimestamp: datetime
    """The timestamp of the first support."""
    lastSupportTimestamp: datetime
    """The timestamp of the last support."""

Class variables

var firstSupportTimestamp : datetime.datetime

The timestamp of the first support.

var highestTierCents : int

The amount of the highest tier in cents.

var isActive : bool

Whether the user is an active.

var isActiveSupporter : bool

Whether the user is an active supporter.

var lastSupportTimestamp : datetime.datetime

The timestamp of the last support.

var lastTierCents : int

The amount of the last tier in cents.

var lowestTierCents : int

The amount of the lowest tier in cents.

var totalSupportCents : int

The total amount of support in cents.

var totalSupportMonths : int

The total number of months of support.

var type_ : Literal['patreon']

The $type tag sent by the API for this supporter metadata.

class supporterMetadataPromo (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class supporterMetadataPromo:
    type_: Literal['promo'] = Field(alias='$type', default='promo')
    isActiveSupporter: bool
    isActive: bool
    totalSupportMonths: int
    totalSupportCents: int
    lastTierCents: int
    highestTierCents: int
    lowestTierCents: int
    firstSupportTimestamp: datetime
    lastSupportTimestamp: datetime

Class variables

var firstSupportTimestamp : datetime.datetime
var highestTierCents : int
var isActive : bool
var isActiveSupporter : bool
var lastSupportTimestamp : datetime.datetime
var lastTierCents : int
var lowestTierCents : int
var totalSupportCents : int
var totalSupportMonths : int
var type_ : Literal['promo']
class supporterMetadataStripe (*args: Any, **kwargs: Any)
Expand source code
@resonite_class
class supporterMetadataStripe:
    type_: Literal['stripe'] = Field(alias='$type', default='stripe')
    totalSupportCents: int
    firstSupportTimestamp: str
    lowestTierCents: int
    lastTierCents: int
    isActive: bool
    isActiveSupporter: bool
    highestTierCents: int
    lastSupportTimestamp: str
    totalSupportMonths: int

Class variables

var firstSupportTimestamp : str
var highestTierCents : int
var isActive : bool
var isActiveSupporter : bool
var lastSupportTimestamp : str
var lastTierCents : int
var lowestTierCents : int
var totalSupportCents : int
var totalSupportMonths : int
var type_ : Literal['stripe']
class supporterMetadataUnknown (*args: Any, **kwargs: Any)

Fallback for supporter metadata types this module doesn't know yet.

Expand source code
@resonite_class
class supporterMetadataUnknown:
    """ Fallback for supporter metadata types this module doesn't know yet.
    """