Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
useritemdatadto.h
Go to the documentation of this file.
1/*
2 * Sailfin: a Jellyfin client written using Qt
3 * Copyright (C) 2021 Chris Josten and the Sailfin Contributors.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19/*
20 * WARNING: THIS IS AN AUTOMATICALLY GENERATED FILE! PLEASE DO NOT EDIT THIS, AS YOUR EDITS WILL GET
21 * OVERWRITTEN AT SOME POINT!
22 *
23 * If there is a bug in this file, please fix the code generator used to generate this file found in
24 * core/openapigenerator.d.
25 *
26 * This file is generated based on Jellyfin's OpenAPI description, "openapi.json". Please update that
27 * file with a newer file if needed instead of manually updating the files.
28 */
29
30#ifndef JELLYFIN_DTO_USERITEMDATADTO_H
31#define JELLYFIN_DTO_USERITEMDATADTO_H
32
33#include <QDateTime>
34#include <QJsonObject>
35#include <QJsonValue>
36#include <QString>
37#include <optional>
38
40
41namespace Jellyfin {
42// Forward declaration
43class ApiClient;
44}
45namespace Jellyfin {
46namespace DTO {
47
48
50public:
53 qint32 playCount,
54 bool isFavorite,
55 bool played
56 );
57
58 UserItemDataDto(const UserItemDataDto &other);
59
63 void replaceData(UserItemDataDto &other);
64
65 static UserItemDataDto fromJson(QJsonObject source);
66 void setFromJson(QJsonObject source);
67 QJsonObject toJson() const;
68
69 // Properties
73 std::optional<double> rating() const;
77 void setRating(std::optional<double> newRating);
78 bool ratingNull() const;
79 void setRatingNull();
80
84 std::optional<double> playedPercentage() const;
88 void setPlayedPercentage(std::optional<double> newPlayedPercentage);
89 bool playedPercentageNull() const;
91
95 std::optional<qint32> unplayedItemCount() const;
99 void setUnplayedItemCount(std::optional<qint32> newUnplayedItemCount);
100 bool unplayedItemCountNull() const;
102
106 qint64 playbackPositionTicks() const;
110 void setPlaybackPositionTicks(qint64 newPlaybackPositionTicks);
111
115 qint32 playCount() const;
119 void setPlayCount(qint32 newPlayCount);
120
124 bool isFavorite() const;
128 void setIsFavorite(bool newIsFavorite);
129
133 std::optional<bool> likes() const;
137 void setLikes(std::optional<bool> newLikes);
138 bool likesNull() const;
139 void setLikesNull();
140
144 QDateTime lastPlayedDate() const;
148 void setLastPlayedDate(QDateTime newLastPlayedDate);
149 bool lastPlayedDateNull() const;
151
155 bool played() const;
159 void setPlayed(bool newPlayed);
160
164 QString key() const;
168 void setKey(QString newKey);
169 bool keyNull() const;
170 void setKeyNull();
171
175 QString itemId() const;
179 void setItemId(QString newItemId);
180 bool itemIdNull() const;
181 void setItemIdNull();
182
183
184protected:
185 std::optional<double> m_rating = std::nullopt;
186 std::optional<double> m_playedPercentage = std::nullopt;
187 std::optional<qint32> m_unplayedItemCount = std::nullopt;
191 std::optional<bool> m_likes = std::nullopt;
194 QString m_key;
195 QString m_itemId;
196
197private:
198 // Private constructor which generates an invalid object, for use withing UserItemDataDto::fromJson();
200};
201
202
203} // NS DTO
204
205namespace Support {
206
208
209template <>
211
212template<>
214
215} // NS DTO
216} // NS Jellyfin
217
218#endif // JELLYFIN_DTO_USERITEMDATADTO_H
Definition useritemdatadto.h:49
void setPlayedPercentage(std::optional< double > newPlayedPercentage)
Gets or sets the played percentage.
Definition useritemdatadto.cpp:160
qint64 m_playbackPositionTicks
Definition useritemdatadto.h:188
void replaceData(UserItemDataDto &other)
Definition useritemdatadto.cpp:64
void setUnplayedItemCount(std::optional< qint32 > newUnplayedItemCount)
Gets or sets the unplayed item count.
Definition useritemdatadto.cpp:173
bool itemIdNull() const
Definition useritemdatadto.cpp:252
bool unplayedItemCountNull() const
Definition useritemdatadto.cpp:176
std::optional< bool > m_likes
Definition useritemdatadto.h:191
bool lastPlayedDateNull() const
Definition useritemdatadto.cpp:220
qint64 playbackPositionTicks() const
Gets or sets the playback position ticks.
Definition useritemdatadto.cpp:184
void setKey(QString newKey)
Gets or sets the key.
Definition useritemdatadto.cpp:236
std::optional< double > m_rating
Definition useritemdatadto.h:185
void setPlayed(bool newPlayed)
Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played.
Definition useritemdatadto.cpp:230
static UserItemDataDto fromJson(QJsonObject source)
Definition useritemdatadto.cpp:78
QString key() const
Gets or sets the key.
Definition useritemdatadto.cpp:234
bool playedPercentageNull() const
Definition useritemdatadto.cpp:163
std::optional< double > playedPercentage() const
Gets or sets the played percentage.
Definition useritemdatadto.cpp:158
bool ratingNull() const
Definition useritemdatadto.cpp:150
std::optional< double > rating() const
Gets or sets the rating.
Definition useritemdatadto.cpp:145
void setPlayCount(qint32 newPlayCount)
Gets or sets the play count.
Definition useritemdatadto.cpp:192
bool m_isFavorite
Definition useritemdatadto.h:190
void setLastPlayedDate(QDateTime newLastPlayedDate)
Gets or sets the last played date.
Definition useritemdatadto.cpp:217
void setLastPlayedDateNull()
Definition useritemdatadto.cpp:224
std::optional< qint32 > m_unplayedItemCount
Definition useritemdatadto.h:187
QDateTime lastPlayedDate() const
Gets or sets the last played date.
Definition useritemdatadto.cpp:215
bool isFavorite() const
Gets or sets a value indicating whether this instance is favorite.
Definition useritemdatadto.cpp:196
void setRatingNull()
Definition useritemdatadto.cpp:154
void setRating(std::optional< double > newRating)
Gets or sets the rating.
Definition useritemdatadto.cpp:147
void setItemIdNull()
Definition useritemdatadto.cpp:256
void setKeyNull()
Definition useritemdatadto.cpp:243
bool keyNull() const
Definition useritemdatadto.cpp:239
std::optional< qint32 > unplayedItemCount() const
Gets or sets the unplayed item count.
Definition useritemdatadto.cpp:171
std::optional< double > m_playedPercentage
Definition useritemdatadto.h:186
bool played() const
Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is played.
Definition useritemdatadto.cpp:228
bool likesNull() const
Definition useritemdatadto.cpp:207
void setPlayedPercentageNull()
Definition useritemdatadto.cpp:167
QJsonObject toJson() const
Definition useritemdatadto.cpp:100
void setIsFavorite(bool newIsFavorite)
Gets or sets a value indicating whether this instance is favorite.
Definition useritemdatadto.cpp:198
qint32 playCount() const
Gets or sets the play count.
Definition useritemdatadto.cpp:190
void setPlaybackPositionTicks(qint64 newPlaybackPositionTicks)
Gets or sets the playback position ticks.
Definition useritemdatadto.cpp:186
QString m_itemId
Definition useritemdatadto.h:195
QString itemId() const
Gets or sets the item identifier.
Definition useritemdatadto.cpp:247
QString m_key
Definition useritemdatadto.h:194
std::optional< bool > likes() const
Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes.
Definition useritemdatadto.cpp:202
qint32 m_playCount
Definition useritemdatadto.h:189
void setItemId(QString newItemId)
Gets or sets the item identifier.
Definition useritemdatadto.cpp:249
void setLikesNull()
Definition useritemdatadto.cpp:211
void setLikes(std::optional< bool > newLikes)
Gets or sets a value indicating whether this MediaBrowser.Model.Dto.UserItemDataDto is likes.
Definition useritemdatadto.cpp:204
void setFromJson(QJsonObject source)
Definition useritemdatadto.cpp:85
QDateTime m_lastPlayedDate
Definition useritemdatadto.h:192
void setUnplayedItemCountNull()
Definition useritemdatadto.cpp:180
bool m_played
Definition useritemdatadto.h:193
AccessSchedule fromJsonValue(const QJsonValue &source, convertType< AccessSchedule >)
Definition accessschedule.cpp:133
QJsonValue toJsonValue(const AccessSchedule &source, convertType< AccessSchedule >)
Definition accessschedule.cpp:139
Definition jsonconvimpl.h:45