/* * Sailfin: a Jellyfin client written using Qt * Copyright (C) 2021 Chris Josten and the Sailfin Contributors. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET * OVERWRITTEN AT SOME POINT! * * If there is a bug in this file, please fix the code generator used to generate this file found in * core/openapigenerator.d. * * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that * file with a newer file if needed instead of manually updating the files. */ #include namespace Jellyfin { namespace DTO { SessionInfo::SessionInfo() {} SessionInfo::SessionInfo ( QSharedPointer playState, QSharedPointer capabilities, QString userId, QDateTime lastActivityDate, QDateTime lastPlaybackCheckIn, QSharedPointer nowPlayingItem, QSharedPointer fullNowPlayingItem, QSharedPointer nowViewingItem, QSharedPointer transcodingInfo, bool isActive, bool supportsMediaControl, bool supportsRemoteControl, bool hasCustomDeviceName ) : m_playState(playState), m_capabilities(capabilities), m_userId(userId), m_lastActivityDate(lastActivityDate), m_lastPlaybackCheckIn(lastPlaybackCheckIn), m_nowPlayingItem(nowPlayingItem), m_fullNowPlayingItem(fullNowPlayingItem), m_nowViewingItem(nowViewingItem), m_transcodingInfo(transcodingInfo), m_isActive(isActive), m_supportsMediaControl(supportsMediaControl), m_supportsRemoteControl(supportsRemoteControl), m_hasCustomDeviceName(hasCustomDeviceName) { } SessionInfo::SessionInfo(const SessionInfo &other) : m_playState(other.m_playState), m_additionalUsers(other.m_additionalUsers), m_capabilities(other.m_capabilities), m_remoteEndPoint(other.m_remoteEndPoint), m_playableMediaTypes(other.m_playableMediaTypes), m_jellyfinId(other.m_jellyfinId), m_userId(other.m_userId), m_userName(other.m_userName), m_client(other.m_client), m_lastActivityDate(other.m_lastActivityDate), m_lastPlaybackCheckIn(other.m_lastPlaybackCheckIn), m_deviceName(other.m_deviceName), m_deviceType(other.m_deviceType), m_nowPlayingItem(other.m_nowPlayingItem), m_fullNowPlayingItem(other.m_fullNowPlayingItem), m_nowViewingItem(other.m_nowViewingItem), m_deviceId(other.m_deviceId), m_applicationVersion(other.m_applicationVersion), m_transcodingInfo(other.m_transcodingInfo), m_isActive(other.m_isActive), m_supportsMediaControl(other.m_supportsMediaControl), m_supportsRemoteControl(other.m_supportsRemoteControl), m_nowPlayingQueue(other.m_nowPlayingQueue), m_hasCustomDeviceName(other.m_hasCustomDeviceName), m_playlistItemId(other.m_playlistItemId), m_serverId(other.m_serverId), m_userPrimaryImageTag(other.m_userPrimaryImageTag), m_supportedCommands(other.m_supportedCommands){} void SessionInfo::replaceData(SessionInfo &other) { m_playState = other.m_playState; m_additionalUsers = other.m_additionalUsers; m_capabilities = other.m_capabilities; m_remoteEndPoint = other.m_remoteEndPoint; m_playableMediaTypes = other.m_playableMediaTypes; m_jellyfinId = other.m_jellyfinId; m_userId = other.m_userId; m_userName = other.m_userName; m_client = other.m_client; m_lastActivityDate = other.m_lastActivityDate; m_lastPlaybackCheckIn = other.m_lastPlaybackCheckIn; m_deviceName = other.m_deviceName; m_deviceType = other.m_deviceType; m_nowPlayingItem = other.m_nowPlayingItem; m_fullNowPlayingItem = other.m_fullNowPlayingItem; m_nowViewingItem = other.m_nowViewingItem; m_deviceId = other.m_deviceId; m_applicationVersion = other.m_applicationVersion; m_transcodingInfo = other.m_transcodingInfo; m_isActive = other.m_isActive; m_supportsMediaControl = other.m_supportsMediaControl; m_supportsRemoteControl = other.m_supportsRemoteControl; m_nowPlayingQueue = other.m_nowPlayingQueue; m_hasCustomDeviceName = other.m_hasCustomDeviceName; m_playlistItemId = other.m_playlistItemId; m_serverId = other.m_serverId; m_userPrimaryImageTag = other.m_userPrimaryImageTag; m_supportedCommands = other.m_supportedCommands; } SessionInfo SessionInfo::fromJson(QJsonObject source) { SessionInfo instance; instance.setFromJson(source); return instance; } void SessionInfo::setFromJson(QJsonObject source) { m_playState = Jellyfin::Support::fromJsonValue>(source["PlayState"]); m_additionalUsers = Jellyfin::Support::fromJsonValue>(source["AdditionalUsers"]); m_capabilities = Jellyfin::Support::fromJsonValue>(source["Capabilities"]); m_remoteEndPoint = Jellyfin::Support::fromJsonValue(source["RemoteEndPoint"]); m_playableMediaTypes = Jellyfin::Support::fromJsonValue(source["PlayableMediaTypes"]); m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); m_userName = Jellyfin::Support::fromJsonValue(source["UserName"]); m_client = Jellyfin::Support::fromJsonValue(source["Client"]); m_lastActivityDate = Jellyfin::Support::fromJsonValue(source["LastActivityDate"]); m_lastPlaybackCheckIn = Jellyfin::Support::fromJsonValue(source["LastPlaybackCheckIn"]); m_deviceName = Jellyfin::Support::fromJsonValue(source["DeviceName"]); m_deviceType = Jellyfin::Support::fromJsonValue(source["DeviceType"]); m_nowPlayingItem = Jellyfin::Support::fromJsonValue>(source["NowPlayingItem"]); m_fullNowPlayingItem = Jellyfin::Support::fromJsonValue>(source["FullNowPlayingItem"]); m_nowViewingItem = Jellyfin::Support::fromJsonValue>(source["NowViewingItem"]); m_deviceId = Jellyfin::Support::fromJsonValue(source["DeviceId"]); m_applicationVersion = Jellyfin::Support::fromJsonValue(source["ApplicationVersion"]); m_transcodingInfo = Jellyfin::Support::fromJsonValue>(source["TranscodingInfo"]); m_isActive = Jellyfin::Support::fromJsonValue(source["IsActive"]); m_supportsMediaControl = Jellyfin::Support::fromJsonValue(source["SupportsMediaControl"]); m_supportsRemoteControl = Jellyfin::Support::fromJsonValue(source["SupportsRemoteControl"]); m_nowPlayingQueue = Jellyfin::Support::fromJsonValue>(source["NowPlayingQueue"]); m_hasCustomDeviceName = Jellyfin::Support::fromJsonValue(source["HasCustomDeviceName"]); m_playlistItemId = Jellyfin::Support::fromJsonValue(source["PlaylistItemId"]); m_serverId = Jellyfin::Support::fromJsonValue(source["ServerId"]); m_userPrimaryImageTag = Jellyfin::Support::fromJsonValue(source["UserPrimaryImageTag"]); m_supportedCommands = Jellyfin::Support::fromJsonValue>(source["SupportedCommands"]); } QJsonObject SessionInfo::toJson() const { QJsonObject result; result["PlayState"] = Jellyfin::Support::toJsonValue>(m_playState); if (!(m_additionalUsers.size() == 0)) { result["AdditionalUsers"] = Jellyfin::Support::toJsonValue>(m_additionalUsers); } result["Capabilities"] = Jellyfin::Support::toJsonValue>(m_capabilities); if (!(m_remoteEndPoint.isNull())) { result["RemoteEndPoint"] = Jellyfin::Support::toJsonValue(m_remoteEndPoint); } if (!(m_playableMediaTypes.size() == 0)) { result["PlayableMediaTypes"] = Jellyfin::Support::toJsonValue(m_playableMediaTypes); } if (!(m_jellyfinId.isNull())) { result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); } result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); if (!(m_userName.isNull())) { result["UserName"] = Jellyfin::Support::toJsonValue(m_userName); } if (!(m_client.isNull())) { result["Client"] = Jellyfin::Support::toJsonValue(m_client); } result["LastActivityDate"] = Jellyfin::Support::toJsonValue(m_lastActivityDate); result["LastPlaybackCheckIn"] = Jellyfin::Support::toJsonValue(m_lastPlaybackCheckIn); if (!(m_deviceName.isNull())) { result["DeviceName"] = Jellyfin::Support::toJsonValue(m_deviceName); } if (!(m_deviceType.isNull())) { result["DeviceType"] = Jellyfin::Support::toJsonValue(m_deviceType); } result["NowPlayingItem"] = Jellyfin::Support::toJsonValue>(m_nowPlayingItem); result["FullNowPlayingItem"] = Jellyfin::Support::toJsonValue>(m_fullNowPlayingItem); result["NowViewingItem"] = Jellyfin::Support::toJsonValue>(m_nowViewingItem); if (!(m_deviceId.isNull())) { result["DeviceId"] = Jellyfin::Support::toJsonValue(m_deviceId); } if (!(m_applicationVersion.isNull())) { result["ApplicationVersion"] = Jellyfin::Support::toJsonValue(m_applicationVersion); } result["TranscodingInfo"] = Jellyfin::Support::toJsonValue>(m_transcodingInfo); result["IsActive"] = Jellyfin::Support::toJsonValue(m_isActive); result["SupportsMediaControl"] = Jellyfin::Support::toJsonValue(m_supportsMediaControl); result["SupportsRemoteControl"] = Jellyfin::Support::toJsonValue(m_supportsRemoteControl); if (!(m_nowPlayingQueue.size() == 0)) { result["NowPlayingQueue"] = Jellyfin::Support::toJsonValue>(m_nowPlayingQueue); } result["HasCustomDeviceName"] = Jellyfin::Support::toJsonValue(m_hasCustomDeviceName); if (!(m_playlistItemId.isNull())) { result["PlaylistItemId"] = Jellyfin::Support::toJsonValue(m_playlistItemId); } if (!(m_serverId.isNull())) { result["ServerId"] = Jellyfin::Support::toJsonValue(m_serverId); } if (!(m_userPrimaryImageTag.isNull())) { result["UserPrimaryImageTag"] = Jellyfin::Support::toJsonValue(m_userPrimaryImageTag); } if (!(m_supportedCommands.size() == 0)) { result["SupportedCommands"] = Jellyfin::Support::toJsonValue>(m_supportedCommands); } return result; } QSharedPointer SessionInfo::playState() const { return m_playState; } void SessionInfo::setPlayState(QSharedPointer newPlayState) { m_playState = newPlayState; } QList SessionInfo::additionalUsers() const { return m_additionalUsers; } void SessionInfo::setAdditionalUsers(QList newAdditionalUsers) { m_additionalUsers = newAdditionalUsers; } bool SessionInfo::additionalUsersNull() const { return m_additionalUsers.size() == 0; } void SessionInfo::setAdditionalUsersNull() { m_additionalUsers.clear(); } QSharedPointer SessionInfo::capabilities() const { return m_capabilities; } void SessionInfo::setCapabilities(QSharedPointer newCapabilities) { m_capabilities = newCapabilities; } QString SessionInfo::remoteEndPoint() const { return m_remoteEndPoint; } void SessionInfo::setRemoteEndPoint(QString newRemoteEndPoint) { m_remoteEndPoint = newRemoteEndPoint; } bool SessionInfo::remoteEndPointNull() const { return m_remoteEndPoint.isNull(); } void SessionInfo::setRemoteEndPointNull() { m_remoteEndPoint.clear(); } QStringList SessionInfo::playableMediaTypes() const { return m_playableMediaTypes; } void SessionInfo::setPlayableMediaTypes(QStringList newPlayableMediaTypes) { m_playableMediaTypes = newPlayableMediaTypes; } bool SessionInfo::playableMediaTypesNull() const { return m_playableMediaTypes.size() == 0; } void SessionInfo::setPlayableMediaTypesNull() { m_playableMediaTypes.clear(); } QString SessionInfo::jellyfinId() const { return m_jellyfinId; } void SessionInfo::setJellyfinId(QString newJellyfinId) { m_jellyfinId = newJellyfinId; } bool SessionInfo::jellyfinIdNull() const { return m_jellyfinId.isNull(); } void SessionInfo::setJellyfinIdNull() { m_jellyfinId.clear(); } QString SessionInfo::userId() const { return m_userId; } void SessionInfo::setUserId(QString newUserId) { m_userId = newUserId; } QString SessionInfo::userName() const { return m_userName; } void SessionInfo::setUserName(QString newUserName) { m_userName = newUserName; } bool SessionInfo::userNameNull() const { return m_userName.isNull(); } void SessionInfo::setUserNameNull() { m_userName.clear(); } QString SessionInfo::client() const { return m_client; } void SessionInfo::setClient(QString newClient) { m_client = newClient; } bool SessionInfo::clientNull() const { return m_client.isNull(); } void SessionInfo::setClientNull() { m_client.clear(); } QDateTime SessionInfo::lastActivityDate() const { return m_lastActivityDate; } void SessionInfo::setLastActivityDate(QDateTime newLastActivityDate) { m_lastActivityDate = newLastActivityDate; } QDateTime SessionInfo::lastPlaybackCheckIn() const { return m_lastPlaybackCheckIn; } void SessionInfo::setLastPlaybackCheckIn(QDateTime newLastPlaybackCheckIn) { m_lastPlaybackCheckIn = newLastPlaybackCheckIn; } QString SessionInfo::deviceName() const { return m_deviceName; } void SessionInfo::setDeviceName(QString newDeviceName) { m_deviceName = newDeviceName; } bool SessionInfo::deviceNameNull() const { return m_deviceName.isNull(); } void SessionInfo::setDeviceNameNull() { m_deviceName.clear(); } QString SessionInfo::deviceType() const { return m_deviceType; } void SessionInfo::setDeviceType(QString newDeviceType) { m_deviceType = newDeviceType; } bool SessionInfo::deviceTypeNull() const { return m_deviceType.isNull(); } void SessionInfo::setDeviceTypeNull() { m_deviceType.clear(); } QSharedPointer SessionInfo::nowPlayingItem() const { return m_nowPlayingItem; } void SessionInfo::setNowPlayingItem(QSharedPointer newNowPlayingItem) { m_nowPlayingItem = newNowPlayingItem; } QSharedPointer SessionInfo::fullNowPlayingItem() const { return m_fullNowPlayingItem; } void SessionInfo::setFullNowPlayingItem(QSharedPointer newFullNowPlayingItem) { m_fullNowPlayingItem = newFullNowPlayingItem; } QSharedPointer SessionInfo::nowViewingItem() const { return m_nowViewingItem; } void SessionInfo::setNowViewingItem(QSharedPointer newNowViewingItem) { m_nowViewingItem = newNowViewingItem; } QString SessionInfo::deviceId() const { return m_deviceId; } void SessionInfo::setDeviceId(QString newDeviceId) { m_deviceId = newDeviceId; } bool SessionInfo::deviceIdNull() const { return m_deviceId.isNull(); } void SessionInfo::setDeviceIdNull() { m_deviceId.clear(); } QString SessionInfo::applicationVersion() const { return m_applicationVersion; } void SessionInfo::setApplicationVersion(QString newApplicationVersion) { m_applicationVersion = newApplicationVersion; } bool SessionInfo::applicationVersionNull() const { return m_applicationVersion.isNull(); } void SessionInfo::setApplicationVersionNull() { m_applicationVersion.clear(); } QSharedPointer SessionInfo::transcodingInfo() const { return m_transcodingInfo; } void SessionInfo::setTranscodingInfo(QSharedPointer newTranscodingInfo) { m_transcodingInfo = newTranscodingInfo; } bool SessionInfo::isActive() const { return m_isActive; } void SessionInfo::setIsActive(bool newIsActive) { m_isActive = newIsActive; } bool SessionInfo::supportsMediaControl() const { return m_supportsMediaControl; } void SessionInfo::setSupportsMediaControl(bool newSupportsMediaControl) { m_supportsMediaControl = newSupportsMediaControl; } bool SessionInfo::supportsRemoteControl() const { return m_supportsRemoteControl; } void SessionInfo::setSupportsRemoteControl(bool newSupportsRemoteControl) { m_supportsRemoteControl = newSupportsRemoteControl; } QList SessionInfo::nowPlayingQueue() const { return m_nowPlayingQueue; } void SessionInfo::setNowPlayingQueue(QList newNowPlayingQueue) { m_nowPlayingQueue = newNowPlayingQueue; } bool SessionInfo::nowPlayingQueueNull() const { return m_nowPlayingQueue.size() == 0; } void SessionInfo::setNowPlayingQueueNull() { m_nowPlayingQueue.clear(); } bool SessionInfo::hasCustomDeviceName() const { return m_hasCustomDeviceName; } void SessionInfo::setHasCustomDeviceName(bool newHasCustomDeviceName) { m_hasCustomDeviceName = newHasCustomDeviceName; } QString SessionInfo::playlistItemId() const { return m_playlistItemId; } void SessionInfo::setPlaylistItemId(QString newPlaylistItemId) { m_playlistItemId = newPlaylistItemId; } bool SessionInfo::playlistItemIdNull() const { return m_playlistItemId.isNull(); } void SessionInfo::setPlaylistItemIdNull() { m_playlistItemId.clear(); } QString SessionInfo::serverId() const { return m_serverId; } void SessionInfo::setServerId(QString newServerId) { m_serverId = newServerId; } bool SessionInfo::serverIdNull() const { return m_serverId.isNull(); } void SessionInfo::setServerIdNull() { m_serverId.clear(); } QString SessionInfo::userPrimaryImageTag() const { return m_userPrimaryImageTag; } void SessionInfo::setUserPrimaryImageTag(QString newUserPrimaryImageTag) { m_userPrimaryImageTag = newUserPrimaryImageTag; } bool SessionInfo::userPrimaryImageTagNull() const { return m_userPrimaryImageTag.isNull(); } void SessionInfo::setUserPrimaryImageTagNull() { m_userPrimaryImageTag.clear(); } QList SessionInfo::supportedCommands() const { return m_supportedCommands; } void SessionInfo::setSupportedCommands(QList newSupportedCommands) { m_supportedCommands = newSupportedCommands; } bool SessionInfo::supportedCommandsNull() const { return m_supportedCommands.size() == 0; } void SessionInfo::setSupportedCommandsNull() { m_supportedCommands.clear(); } } // NS DTO namespace Support { using SessionInfo = Jellyfin::DTO::SessionInfo; template <> SessionInfo fromJsonValue(const QJsonValue &source, convertType) { if (!source.isObject()) throw ParseException("Expected JSON Object"); return SessionInfo::fromJson(source.toObject()); } template<> QJsonValue toJsonValue(const SessionInfo &source, convertType) { return source.toJson(); } } // NS DTO } // NS Jellyfin