/* * 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 { OpenLiveStreamDto::OpenLiveStreamDto() {} OpenLiveStreamDto::OpenLiveStreamDto ( QSharedPointer deviceProfile ) : m_deviceProfile(deviceProfile) { } OpenLiveStreamDto::OpenLiveStreamDto(const OpenLiveStreamDto &other) : m_openToken(other.m_openToken), m_userId(other.m_userId), m_playSessionId(other.m_playSessionId), m_maxStreamingBitrate(other.m_maxStreamingBitrate), m_startTimeTicks(other.m_startTimeTicks), m_audioStreamIndex(other.m_audioStreamIndex), m_subtitleStreamIndex(other.m_subtitleStreamIndex), m_maxAudioChannels(other.m_maxAudioChannels), m_itemId(other.m_itemId), m_enableDirectPlay(other.m_enableDirectPlay), m_enableDirectStream(other.m_enableDirectStream), m_deviceProfile(other.m_deviceProfile), m_directPlayProtocols(other.m_directPlayProtocols){} void OpenLiveStreamDto::replaceData(OpenLiveStreamDto &other) { m_openToken = other.m_openToken; m_userId = other.m_userId; m_playSessionId = other.m_playSessionId; m_maxStreamingBitrate = other.m_maxStreamingBitrate; m_startTimeTicks = other.m_startTimeTicks; m_audioStreamIndex = other.m_audioStreamIndex; m_subtitleStreamIndex = other.m_subtitleStreamIndex; m_maxAudioChannels = other.m_maxAudioChannels; m_itemId = other.m_itemId; m_enableDirectPlay = other.m_enableDirectPlay; m_enableDirectStream = other.m_enableDirectStream; m_deviceProfile = other.m_deviceProfile; m_directPlayProtocols = other.m_directPlayProtocols; } OpenLiveStreamDto OpenLiveStreamDto::fromJson(QJsonObject source) { OpenLiveStreamDto instance; instance.setFromJson(source); return instance; } void OpenLiveStreamDto::setFromJson(QJsonObject source) { m_openToken = Jellyfin::Support::fromJsonValue(source["OpenToken"]); m_userId = Jellyfin::Support::fromJsonValue(source["UserId"]); m_playSessionId = Jellyfin::Support::fromJsonValue(source["PlaySessionId"]); m_maxStreamingBitrate = Jellyfin::Support::fromJsonValue>(source["MaxStreamingBitrate"]); m_startTimeTicks = Jellyfin::Support::fromJsonValue>(source["StartTimeTicks"]); m_audioStreamIndex = Jellyfin::Support::fromJsonValue>(source["AudioStreamIndex"]); m_subtitleStreamIndex = Jellyfin::Support::fromJsonValue>(source["SubtitleStreamIndex"]); m_maxAudioChannels = Jellyfin::Support::fromJsonValue>(source["MaxAudioChannels"]); m_itemId = Jellyfin::Support::fromJsonValue(source["ItemId"]); m_enableDirectPlay = Jellyfin::Support::fromJsonValue>(source["EnableDirectPlay"]); m_enableDirectStream = Jellyfin::Support::fromJsonValue>(source["EnableDirectStream"]); m_deviceProfile = Jellyfin::Support::fromJsonValue>(source["DeviceProfile"]); m_directPlayProtocols = Jellyfin::Support::fromJsonValue>(source["DirectPlayProtocols"]); } QJsonObject OpenLiveStreamDto::toJson() const { QJsonObject result; if (!(m_openToken.isNull())) { result["OpenToken"] = Jellyfin::Support::toJsonValue(m_openToken); } if (!(m_userId.isNull())) { result["UserId"] = Jellyfin::Support::toJsonValue(m_userId); } if (!(m_playSessionId.isNull())) { result["PlaySessionId"] = Jellyfin::Support::toJsonValue(m_playSessionId); } if (!(!m_maxStreamingBitrate.has_value())) { result["MaxStreamingBitrate"] = Jellyfin::Support::toJsonValue>(m_maxStreamingBitrate); } if (!(!m_startTimeTicks.has_value())) { result["StartTimeTicks"] = Jellyfin::Support::toJsonValue>(m_startTimeTicks); } if (!(!m_audioStreamIndex.has_value())) { result["AudioStreamIndex"] = Jellyfin::Support::toJsonValue>(m_audioStreamIndex); } if (!(!m_subtitleStreamIndex.has_value())) { result["SubtitleStreamIndex"] = Jellyfin::Support::toJsonValue>(m_subtitleStreamIndex); } if (!(!m_maxAudioChannels.has_value())) { result["MaxAudioChannels"] = Jellyfin::Support::toJsonValue>(m_maxAudioChannels); } if (!(m_itemId.isNull())) { result["ItemId"] = Jellyfin::Support::toJsonValue(m_itemId); } if (!(!m_enableDirectPlay.has_value())) { result["EnableDirectPlay"] = Jellyfin::Support::toJsonValue>(m_enableDirectPlay); } if (!(!m_enableDirectStream.has_value())) { result["EnableDirectStream"] = Jellyfin::Support::toJsonValue>(m_enableDirectStream); } result["DeviceProfile"] = Jellyfin::Support::toJsonValue>(m_deviceProfile); if (!(m_directPlayProtocols.size() == 0)) { result["DirectPlayProtocols"] = Jellyfin::Support::toJsonValue>(m_directPlayProtocols); } return result; } QString OpenLiveStreamDto::openToken() const { return m_openToken; } void OpenLiveStreamDto::setOpenToken(QString newOpenToken) { m_openToken = newOpenToken; } bool OpenLiveStreamDto::openTokenNull() const { return m_openToken.isNull(); } void OpenLiveStreamDto::setOpenTokenNull() { m_openToken.clear(); } QString OpenLiveStreamDto::userId() const { return m_userId; } void OpenLiveStreamDto::setUserId(QString newUserId) { m_userId = newUserId; } bool OpenLiveStreamDto::userIdNull() const { return m_userId.isNull(); } void OpenLiveStreamDto::setUserIdNull() { m_userId.clear(); } QString OpenLiveStreamDto::playSessionId() const { return m_playSessionId; } void OpenLiveStreamDto::setPlaySessionId(QString newPlaySessionId) { m_playSessionId = newPlaySessionId; } bool OpenLiveStreamDto::playSessionIdNull() const { return m_playSessionId.isNull(); } void OpenLiveStreamDto::setPlaySessionIdNull() { m_playSessionId.clear(); } std::optional OpenLiveStreamDto::maxStreamingBitrate() const { return m_maxStreamingBitrate; } void OpenLiveStreamDto::setMaxStreamingBitrate(std::optional newMaxStreamingBitrate) { m_maxStreamingBitrate = newMaxStreamingBitrate; } bool OpenLiveStreamDto::maxStreamingBitrateNull() const { return !m_maxStreamingBitrate.has_value(); } void OpenLiveStreamDto::setMaxStreamingBitrateNull() { m_maxStreamingBitrate = std::nullopt; } std::optional OpenLiveStreamDto::startTimeTicks() const { return m_startTimeTicks; } void OpenLiveStreamDto::setStartTimeTicks(std::optional newStartTimeTicks) { m_startTimeTicks = newStartTimeTicks; } bool OpenLiveStreamDto::startTimeTicksNull() const { return !m_startTimeTicks.has_value(); } void OpenLiveStreamDto::setStartTimeTicksNull() { m_startTimeTicks = std::nullopt; } std::optional OpenLiveStreamDto::audioStreamIndex() const { return m_audioStreamIndex; } void OpenLiveStreamDto::setAudioStreamIndex(std::optional newAudioStreamIndex) { m_audioStreamIndex = newAudioStreamIndex; } bool OpenLiveStreamDto::audioStreamIndexNull() const { return !m_audioStreamIndex.has_value(); } void OpenLiveStreamDto::setAudioStreamIndexNull() { m_audioStreamIndex = std::nullopt; } std::optional OpenLiveStreamDto::subtitleStreamIndex() const { return m_subtitleStreamIndex; } void OpenLiveStreamDto::setSubtitleStreamIndex(std::optional newSubtitleStreamIndex) { m_subtitleStreamIndex = newSubtitleStreamIndex; } bool OpenLiveStreamDto::subtitleStreamIndexNull() const { return !m_subtitleStreamIndex.has_value(); } void OpenLiveStreamDto::setSubtitleStreamIndexNull() { m_subtitleStreamIndex = std::nullopt; } std::optional OpenLiveStreamDto::maxAudioChannels() const { return m_maxAudioChannels; } void OpenLiveStreamDto::setMaxAudioChannels(std::optional newMaxAudioChannels) { m_maxAudioChannels = newMaxAudioChannels; } bool OpenLiveStreamDto::maxAudioChannelsNull() const { return !m_maxAudioChannels.has_value(); } void OpenLiveStreamDto::setMaxAudioChannelsNull() { m_maxAudioChannels = std::nullopt; } QString OpenLiveStreamDto::itemId() const { return m_itemId; } void OpenLiveStreamDto::setItemId(QString newItemId) { m_itemId = newItemId; } bool OpenLiveStreamDto::itemIdNull() const { return m_itemId.isNull(); } void OpenLiveStreamDto::setItemIdNull() { m_itemId.clear(); } std::optional OpenLiveStreamDto::enableDirectPlay() const { return m_enableDirectPlay; } void OpenLiveStreamDto::setEnableDirectPlay(std::optional newEnableDirectPlay) { m_enableDirectPlay = newEnableDirectPlay; } bool OpenLiveStreamDto::enableDirectPlayNull() const { return !m_enableDirectPlay.has_value(); } void OpenLiveStreamDto::setEnableDirectPlayNull() { m_enableDirectPlay = std::nullopt; } std::optional OpenLiveStreamDto::enableDirectStream() const { return m_enableDirectStream; } void OpenLiveStreamDto::setEnableDirectStream(std::optional newEnableDirectStream) { m_enableDirectStream = newEnableDirectStream; } bool OpenLiveStreamDto::enableDirectStreamNull() const { return !m_enableDirectStream.has_value(); } void OpenLiveStreamDto::setEnableDirectStreamNull() { m_enableDirectStream = std::nullopt; } QSharedPointer OpenLiveStreamDto::deviceProfile() const { return m_deviceProfile; } void OpenLiveStreamDto::setDeviceProfile(QSharedPointer newDeviceProfile) { m_deviceProfile = newDeviceProfile; } QList OpenLiveStreamDto::directPlayProtocols() const { return m_directPlayProtocols; } void OpenLiveStreamDto::setDirectPlayProtocols(QList newDirectPlayProtocols) { m_directPlayProtocols = newDirectPlayProtocols; } bool OpenLiveStreamDto::directPlayProtocolsNull() const { return m_directPlayProtocols.size() == 0; } void OpenLiveStreamDto::setDirectPlayProtocolsNull() { m_directPlayProtocols.clear(); } } // NS DTO namespace Support { using OpenLiveStreamDto = Jellyfin::DTO::OpenLiveStreamDto; template <> OpenLiveStreamDto fromJsonValue(const QJsonValue &source, convertType) { if (!source.isObject()) throw ParseException("Expected JSON Object"); return OpenLiveStreamDto::fromJson(source.toObject()); } template<> QJsonValue toJsonValue(const OpenLiveStreamDto &source, convertType) { return source.toJson(); } } // NS DTO } // NS Jellyfin