/* * 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 { ImageInfo::ImageInfo() {} ImageInfo::ImageInfo(const ImageInfo &other) : m_imageType(other.m_imageType), m_imageIndex(other.m_imageIndex), m_imageTag(other.m_imageTag), m_path(other.m_path), m_blurHash(other.m_blurHash), m_height(other.m_height), m_width(other.m_width), m_size(other.m_size){} void ImageInfo::replaceData(ImageInfo &other) { m_imageType = other.m_imageType; m_imageIndex = other.m_imageIndex; m_imageTag = other.m_imageTag; m_path = other.m_path; m_blurHash = other.m_blurHash; m_height = other.m_height; m_width = other.m_width; m_size = other.m_size; } ImageInfo ImageInfo::fromJson(QJsonObject source) { ImageInfo instance; instance.setFromJson(source); return instance; } void ImageInfo::setFromJson(QJsonObject source) { m_imageType = Jellyfin::Support::fromJsonValue(source["ImageType"]); m_imageIndex = Jellyfin::Support::fromJsonValue>(source["ImageIndex"]); m_imageTag = Jellyfin::Support::fromJsonValue(source["ImageTag"]); m_path = Jellyfin::Support::fromJsonValue(source["Path"]); m_blurHash = Jellyfin::Support::fromJsonValue(source["BlurHash"]); m_height = Jellyfin::Support::fromJsonValue>(source["Height"]); m_width = Jellyfin::Support::fromJsonValue>(source["Width"]); m_size = Jellyfin::Support::fromJsonValue(source["Size"]); } QJsonObject ImageInfo::toJson() const { QJsonObject result; result["ImageType"] = Jellyfin::Support::toJsonValue(m_imageType); if (!(!m_imageIndex.has_value())) { result["ImageIndex"] = Jellyfin::Support::toJsonValue>(m_imageIndex); } if (!(m_imageTag.isNull())) { result["ImageTag"] = Jellyfin::Support::toJsonValue(m_imageTag); } if (!(m_path.isNull())) { result["Path"] = Jellyfin::Support::toJsonValue(m_path); } if (!(m_blurHash.isNull())) { result["BlurHash"] = Jellyfin::Support::toJsonValue(m_blurHash); } if (!(!m_height.has_value())) { result["Height"] = Jellyfin::Support::toJsonValue>(m_height); } if (!(!m_width.has_value())) { result["Width"] = Jellyfin::Support::toJsonValue>(m_width); } result["Size"] = Jellyfin::Support::toJsonValue(m_size); return result; } ImageType ImageInfo::imageType() const { return m_imageType; } void ImageInfo::setImageType(ImageType newImageType) { m_imageType = newImageType; } std::optional ImageInfo::imageIndex() const { return m_imageIndex; } void ImageInfo::setImageIndex(std::optional newImageIndex) { m_imageIndex = newImageIndex; } bool ImageInfo::imageIndexNull() const { return !m_imageIndex.has_value(); } void ImageInfo::setImageIndexNull() { m_imageIndex = std::nullopt; } QString ImageInfo::imageTag() const { return m_imageTag; } void ImageInfo::setImageTag(QString newImageTag) { m_imageTag = newImageTag; } bool ImageInfo::imageTagNull() const { return m_imageTag.isNull(); } void ImageInfo::setImageTagNull() { m_imageTag.clear(); } QString ImageInfo::path() const { return m_path; } void ImageInfo::setPath(QString newPath) { m_path = newPath; } bool ImageInfo::pathNull() const { return m_path.isNull(); } void ImageInfo::setPathNull() { m_path.clear(); } QString ImageInfo::blurHash() const { return m_blurHash; } void ImageInfo::setBlurHash(QString newBlurHash) { m_blurHash = newBlurHash; } bool ImageInfo::blurHashNull() const { return m_blurHash.isNull(); } void ImageInfo::setBlurHashNull() { m_blurHash.clear(); } std::optional ImageInfo::height() const { return m_height; } void ImageInfo::setHeight(std::optional newHeight) { m_height = newHeight; } bool ImageInfo::heightNull() const { return !m_height.has_value(); } void ImageInfo::setHeightNull() { m_height = std::nullopt; } std::optional ImageInfo::width() const { return m_width; } void ImageInfo::setWidth(std::optional newWidth) { m_width = newWidth; } bool ImageInfo::widthNull() const { return !m_width.has_value(); } void ImageInfo::setWidthNull() { m_width = std::nullopt; } qint64 ImageInfo::size() const { return m_size; } void ImageInfo::setSize(qint64 newSize) { m_size = newSize; } } // NS DTO namespace Support { using ImageInfo = Jellyfin::DTO::ImageInfo; template <> ImageInfo fromJsonValue(const QJsonValue &source, convertType) { if (!source.isObject()) throw ParseException("Expected JSON Object"); return ImageInfo::fromJson(source.toObject()); } template<> QJsonValue toJsonValue(const ImageInfo &source, convertType) { return source.toJson(); } } // NS DTO } // NS Jellyfin