/* * 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 { ChannelFeatures::ChannelFeatures() {} ChannelFeatures::ChannelFeatures(const ChannelFeatures &other) : m_name(other.m_name), m_jellyfinId(other.m_jellyfinId), m_canSearch(other.m_canSearch), m_mediaTypes(other.m_mediaTypes), m_contentTypes(other.m_contentTypes), m_maxPageSize(other.m_maxPageSize), m_autoRefreshLevels(other.m_autoRefreshLevels), m_defaultSortFields(other.m_defaultSortFields), m_supportsSortOrderToggle(other.m_supportsSortOrderToggle), m_supportsLatestMedia(other.m_supportsLatestMedia), m_canFilter(other.m_canFilter), m_supportsContentDownloading(other.m_supportsContentDownloading){} void ChannelFeatures::replaceData(ChannelFeatures &other) { m_name = other.m_name; m_jellyfinId = other.m_jellyfinId; m_canSearch = other.m_canSearch; m_mediaTypes = other.m_mediaTypes; m_contentTypes = other.m_contentTypes; m_maxPageSize = other.m_maxPageSize; m_autoRefreshLevels = other.m_autoRefreshLevels; m_defaultSortFields = other.m_defaultSortFields; m_supportsSortOrderToggle = other.m_supportsSortOrderToggle; m_supportsLatestMedia = other.m_supportsLatestMedia; m_canFilter = other.m_canFilter; m_supportsContentDownloading = other.m_supportsContentDownloading; } ChannelFeatures ChannelFeatures::fromJson(QJsonObject source) { ChannelFeatures instance; instance.setFromJson(source); return instance; } void ChannelFeatures::setFromJson(QJsonObject source) { m_name = Jellyfin::Support::fromJsonValue(source["Name"]); m_jellyfinId = Jellyfin::Support::fromJsonValue(source["Id"]); m_canSearch = Jellyfin::Support::fromJsonValue(source["CanSearch"]); m_mediaTypes = Jellyfin::Support::fromJsonValue>(source["MediaTypes"]); m_contentTypes = Jellyfin::Support::fromJsonValue>(source["ContentTypes"]); m_maxPageSize = Jellyfin::Support::fromJsonValue>(source["MaxPageSize"]); m_autoRefreshLevels = Jellyfin::Support::fromJsonValue>(source["AutoRefreshLevels"]); m_defaultSortFields = Jellyfin::Support::fromJsonValue>(source["DefaultSortFields"]); m_supportsSortOrderToggle = Jellyfin::Support::fromJsonValue(source["SupportsSortOrderToggle"]); m_supportsLatestMedia = Jellyfin::Support::fromJsonValue(source["SupportsLatestMedia"]); m_canFilter = Jellyfin::Support::fromJsonValue(source["CanFilter"]); m_supportsContentDownloading = Jellyfin::Support::fromJsonValue(source["SupportsContentDownloading"]); } QJsonObject ChannelFeatures::toJson() const { QJsonObject result; if (!(m_name.isNull())) { result["Name"] = Jellyfin::Support::toJsonValue(m_name); } if (!(m_jellyfinId.isNull())) { result["Id"] = Jellyfin::Support::toJsonValue(m_jellyfinId); } result["CanSearch"] = Jellyfin::Support::toJsonValue(m_canSearch); if (!(m_mediaTypes.size() == 0)) { result["MediaTypes"] = Jellyfin::Support::toJsonValue>(m_mediaTypes); } if (!(m_contentTypes.size() == 0)) { result["ContentTypes"] = Jellyfin::Support::toJsonValue>(m_contentTypes); } if (!(!m_maxPageSize.has_value())) { result["MaxPageSize"] = Jellyfin::Support::toJsonValue>(m_maxPageSize); } if (!(!m_autoRefreshLevels.has_value())) { result["AutoRefreshLevels"] = Jellyfin::Support::toJsonValue>(m_autoRefreshLevels); } if (!(m_defaultSortFields.size() == 0)) { result["DefaultSortFields"] = Jellyfin::Support::toJsonValue>(m_defaultSortFields); } result["SupportsSortOrderToggle"] = Jellyfin::Support::toJsonValue(m_supportsSortOrderToggle); result["SupportsLatestMedia"] = Jellyfin::Support::toJsonValue(m_supportsLatestMedia); result["CanFilter"] = Jellyfin::Support::toJsonValue(m_canFilter); result["SupportsContentDownloading"] = Jellyfin::Support::toJsonValue(m_supportsContentDownloading); return result; } QString ChannelFeatures::name() const { return m_name; } void ChannelFeatures::setName(QString newName) { m_name = newName; } bool ChannelFeatures::nameNull() const { return m_name.isNull(); } void ChannelFeatures::setNameNull() { m_name.clear(); } QString ChannelFeatures::jellyfinId() const { return m_jellyfinId; } void ChannelFeatures::setJellyfinId(QString newJellyfinId) { m_jellyfinId = newJellyfinId; } bool ChannelFeatures::jellyfinIdNull() const { return m_jellyfinId.isNull(); } void ChannelFeatures::setJellyfinIdNull() { m_jellyfinId.clear(); } bool ChannelFeatures::canSearch() const { return m_canSearch; } void ChannelFeatures::setCanSearch(bool newCanSearch) { m_canSearch = newCanSearch; } QList ChannelFeatures::mediaTypes() const { return m_mediaTypes; } void ChannelFeatures::setMediaTypes(QList newMediaTypes) { m_mediaTypes = newMediaTypes; } bool ChannelFeatures::mediaTypesNull() const { return m_mediaTypes.size() == 0; } void ChannelFeatures::setMediaTypesNull() { m_mediaTypes.clear(); } QList ChannelFeatures::contentTypes() const { return m_contentTypes; } void ChannelFeatures::setContentTypes(QList newContentTypes) { m_contentTypes = newContentTypes; } bool ChannelFeatures::contentTypesNull() const { return m_contentTypes.size() == 0; } void ChannelFeatures::setContentTypesNull() { m_contentTypes.clear(); } std::optional ChannelFeatures::maxPageSize() const { return m_maxPageSize; } void ChannelFeatures::setMaxPageSize(std::optional newMaxPageSize) { m_maxPageSize = newMaxPageSize; } bool ChannelFeatures::maxPageSizeNull() const { return !m_maxPageSize.has_value(); } void ChannelFeatures::setMaxPageSizeNull() { m_maxPageSize = std::nullopt; } std::optional ChannelFeatures::autoRefreshLevels() const { return m_autoRefreshLevels; } void ChannelFeatures::setAutoRefreshLevels(std::optional newAutoRefreshLevels) { m_autoRefreshLevels = newAutoRefreshLevels; } bool ChannelFeatures::autoRefreshLevelsNull() const { return !m_autoRefreshLevels.has_value(); } void ChannelFeatures::setAutoRefreshLevelsNull() { m_autoRefreshLevels = std::nullopt; } QList ChannelFeatures::defaultSortFields() const { return m_defaultSortFields; } void ChannelFeatures::setDefaultSortFields(QList newDefaultSortFields) { m_defaultSortFields = newDefaultSortFields; } bool ChannelFeatures::defaultSortFieldsNull() const { return m_defaultSortFields.size() == 0; } void ChannelFeatures::setDefaultSortFieldsNull() { m_defaultSortFields.clear(); } bool ChannelFeatures::supportsSortOrderToggle() const { return m_supportsSortOrderToggle; } void ChannelFeatures::setSupportsSortOrderToggle(bool newSupportsSortOrderToggle) { m_supportsSortOrderToggle = newSupportsSortOrderToggle; } bool ChannelFeatures::supportsLatestMedia() const { return m_supportsLatestMedia; } void ChannelFeatures::setSupportsLatestMedia(bool newSupportsLatestMedia) { m_supportsLatestMedia = newSupportsLatestMedia; } bool ChannelFeatures::canFilter() const { return m_canFilter; } void ChannelFeatures::setCanFilter(bool newCanFilter) { m_canFilter = newCanFilter; } bool ChannelFeatures::supportsContentDownloading() const { return m_supportsContentDownloading; } void ChannelFeatures::setSupportsContentDownloading(bool newSupportsContentDownloading) { m_supportsContentDownloading = newSupportsContentDownloading; } } // NS DTO namespace Support { using ChannelFeatures = Jellyfin::DTO::ChannelFeatures; template <> ChannelFeatures fromJsonValue(const QJsonValue &source, convertType) { if (!source.isObject()) throw ParseException("Expected JSON Object"); return ChannelFeatures::fromJson(source.toObject()); } template<> QJsonValue toJsonValue(const ChannelFeatures &source, convertType) { return source.toJson(); } } // NS DTO } // NS Jellyfin