/* * 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){} 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() { QJsonObject result; result["ImageType"] = Jellyfin::Support::toJsonValue(m_imageType); result["ImageIndex"] = Jellyfin::Support::toJsonValue(m_imageIndex); result["ImageTag"] = Jellyfin::Support::toJsonValue(m_imageTag); result["Path"] = Jellyfin::Support::toJsonValue(m_path); result["BlurHash"] = Jellyfin::Support::toJsonValue(m_blurHash); result["Height"] = Jellyfin::Support::toJsonValue(m_height); 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; } qint32 ImageInfo::imageIndex() const { return m_imageIndex; } void ImageInfo::setImageIndex(qint32 newImageIndex) { m_imageIndex = newImageIndex; } QString ImageInfo::imageTag() const { return m_imageTag; } void ImageInfo::setImageTag(QString newImageTag) { m_imageTag = newImageTag; } QString ImageInfo::path() const { return m_path; } void ImageInfo::setPath(QString newPath) { m_path = newPath; } QString ImageInfo::blurHash() const { return m_blurHash; } void ImageInfo::setBlurHash(QString newBlurHash) { m_blurHash = newBlurHash; } qint32 ImageInfo::height() const { return m_height; } void ImageInfo::setHeight(qint32 newHeight) { m_height = newHeight; } qint32 ImageInfo::width() const { return m_width; } void ImageInfo::setWidth(qint32 newWidth) { m_width = newWidth; } 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) { if (!source.isObject()) throw new ParseException("Expected JSON Object"); return ImageInfo::fromJson(source.toObject()); } } // NS Jellyfin } // NS DTO