Jellyfin Qt
QML Library for interacting with the Jellyfin multimedia server
Loading...
Searching...
No Matches
userdto.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_USERDTO_H
31#define JELLYFIN_DTO_USERDTO_H
32
33#include <QDateTime>
34#include <QJsonObject>
35#include <QJsonValue>
36#include <QSharedPointer>
37#include <QString>
38#include <optional>
39
43
44namespace Jellyfin {
45// Forward declaration
46class ApiClient;
47}
48namespace Jellyfin {
49namespace DTO {
50
51
52class UserDto {
53public:
54 UserDto(
55 QString jellyfinId,
56 bool hasPassword,
59 QSharedPointer<UserConfiguration> configuration,
60 QSharedPointer<UserPolicy> policy
61 );
62
63 UserDto(const UserDto &other);
64
68 void replaceData(UserDto &other);
69
70 static UserDto fromJson(QJsonObject source);
71 void setFromJson(QJsonObject source);
72 QJsonObject toJson() const;
73
74 // Properties
78 QString name() const;
82 void setName(QString newName);
83 bool nameNull() const;
84 void setNameNull();
85
89 QString serverId() const;
93 void setServerId(QString newServerId);
94 bool serverIdNull() const;
95 void setServerIdNull();
96
101 QString serverName() const;
106 void setServerName(QString newServerName);
107 bool serverNameNull() const;
108 void setServerNameNull();
109
113 QString jellyfinId() const;
117 void setJellyfinId(QString newJellyfinId);
118
122 QString primaryImageTag() const;
126 void setPrimaryImageTag(QString newPrimaryImageTag);
127 bool primaryImageTagNull() const;
129
133 bool hasPassword() const;
137 void setHasPassword(bool newHasPassword);
138
142 bool hasConfiguredPassword() const;
146 void setHasConfiguredPassword(bool newHasConfiguredPassword);
147
151 bool hasConfiguredEasyPassword() const;
155 void setHasConfiguredEasyPassword(bool newHasConfiguredEasyPassword);
156
160 std::optional<bool> enableAutoLogin() const;
164 void setEnableAutoLogin(std::optional<bool> newEnableAutoLogin);
165 bool enableAutoLoginNull() const;
167
171 QDateTime lastLoginDate() const;
175 void setLastLoginDate(QDateTime newLastLoginDate);
176 bool lastLoginDateNull() const;
178
182 QDateTime lastActivityDate() const;
186 void setLastActivityDate(QDateTime newLastActivityDate);
187 bool lastActivityDateNull() const;
189
190
191 QSharedPointer<UserConfiguration> configuration() const;
192
193 void setConfiguration(QSharedPointer<UserConfiguration> newConfiguration);
194
195
196 QSharedPointer<UserPolicy> policy() const;
197
198 void setPolicy(QSharedPointer<UserPolicy> newPolicy);
199
203 std::optional<double> primaryImageAspectRatio() const;
207 void setPrimaryImageAspectRatio(std::optional<double> newPrimaryImageAspectRatio);
208 bool primaryImageAspectRatioNull() const;
210
211
212protected:
213 QString m_name;
214 QString m_serverId;
221 std::optional<bool> m_enableAutoLogin = std::nullopt;
224 QSharedPointer<UserConfiguration> m_configuration = QSharedPointer<UserConfiguration>();
225 QSharedPointer<UserPolicy> m_policy = QSharedPointer<UserPolicy>();
226 std::optional<double> m_primaryImageAspectRatio = std::nullopt;
227
228private:
229 // Private constructor which generates an invalid object, for use withing UserDto::fromJson();
230 UserDto();
231};
232
233
234} // NS DTO
235
236namespace Support {
237
239
240template <>
241UserDto fromJsonValue(const QJsonValue &source, convertType<UserDto>);
242
243template<>
244QJsonValue toJsonValue(const UserDto &source, convertType<UserDto>);
245
246} // NS DTO
247} // NS Jellyfin
248
249#endif // JELLYFIN_DTO_USERDTO_H
Definition userdto.h:52
QString serverId() const
Gets or sets the server identifier.
Definition userdto.cpp:178
void setServerId(QString newServerId)
Gets or sets the server identifier.
Definition userdto.cpp:180
bool hasPassword() const
Gets or sets a value indicating whether this instance has password.
Definition userdto.cpp:223
void setLastActivityDateNull()
Definition userdto.cpp:276
bool m_hasConfiguredPassword
Definition userdto.h:219
void setPolicy(QSharedPointer< UserPolicy > newPolicy)
Definition userdto.cpp:288
bool lastLoginDateNull() const
Definition userdto.cpp:259
bool hasConfiguredEasyPassword() const
Gets or sets a value indicating whether this instance has configured easy password.
Definition userdto.cpp:235
bool serverNameNull() const
Definition userdto.cpp:196
bool m_hasPassword
Definition userdto.h:218
QString m_serverName
Definition userdto.h:215
QString jellyfinId() const
Gets or sets the id.
Definition userdto.cpp:204
void setLastLoginDate(QDateTime newLastLoginDate)
Gets or sets the last login date.
Definition userdto.cpp:256
QString m_primaryImageTag
Definition userdto.h:217
QString m_serverId
Definition userdto.h:214
std::optional< double > m_primaryImageAspectRatio
Definition userdto.h:226
void setName(QString newName)
Gets or sets the name.
Definition userdto.cpp:167
static UserDto fromJson(QJsonObject source)
Definition userdto.cpp:88
bool m_hasConfiguredEasyPassword
Definition userdto.h:220
void setFromJson(QJsonObject source)
Definition userdto.cpp:95
bool enableAutoLoginNull() const
Definition userdto.cpp:246
void setEnableAutoLogin(std::optional< bool > newEnableAutoLogin)
Gets or sets whether async login is enabled or not.
Definition userdto.cpp:243
QString serverName() const
Definition userdto.cpp:191
void setPrimaryImageTagNull()
Definition userdto.cpp:219
bool serverIdNull() const
Definition userdto.cpp:183
QString m_name
Definition userdto.h:213
void setLastActivityDate(QDateTime newLastActivityDate)
Gets or sets the last activity date.
Definition userdto.cpp:269
void setHasPassword(bool newHasPassword)
Gets or sets a value indicating whether this instance has password.
Definition userdto.cpp:225
bool nameNull() const
Definition userdto.cpp:170
void setEnableAutoLoginNull()
Definition userdto.cpp:250
void replaceData(UserDto &other)
Definition userdto.cpp:71
QDateTime lastActivityDate() const
Gets or sets the last activity date.
Definition userdto.cpp:267
void setPrimaryImageTag(QString newPrimaryImageTag)
Gets or sets the primary image tag.
Definition userdto.cpp:212
void setPrimaryImageAspectRatioNull()
Definition userdto.cpp:301
QDateTime m_lastLoginDate
Definition userdto.h:222
QDateTime lastLoginDate() const
Gets or sets the last login date.
Definition userdto.cpp:254
bool primaryImageAspectRatioNull() const
Definition userdto.cpp:297
void setJellyfinId(QString newJellyfinId)
Gets or sets the id.
Definition userdto.cpp:206
void setServerNameNull()
Definition userdto.cpp:200
QSharedPointer< UserConfiguration > configuration() const
Definition userdto.cpp:280
std::optional< double > primaryImageAspectRatio() const
Gets or sets the primary image aspect ratio.
Definition userdto.cpp:292
void setServerIdNull()
Definition userdto.cpp:187
bool hasConfiguredPassword() const
Gets or sets a value indicating whether this instance has configured password.
Definition userdto.cpp:229
void setConfiguration(QSharedPointer< UserConfiguration > newConfiguration)
Definition userdto.cpp:282
std::optional< bool > m_enableAutoLogin
Definition userdto.h:221
QJsonObject toJson() const
Definition userdto.cpp:113
void setHasConfiguredEasyPassword(bool newHasConfiguredEasyPassword)
Gets or sets a value indicating whether this instance has configured easy password.
Definition userdto.cpp:237
void setPrimaryImageAspectRatio(std::optional< double > newPrimaryImageAspectRatio)
Gets or sets the primary image aspect ratio.
Definition userdto.cpp:294
QString m_jellyfinId
Definition userdto.h:216
QString name() const
Gets or sets the name.
Definition userdto.cpp:165
bool primaryImageTagNull() const
Definition userdto.cpp:215
void setServerName(QString newServerName)
Definition userdto.cpp:193
void setNameNull()
Definition userdto.cpp:174
std::optional< bool > enableAutoLogin() const
Gets or sets whether async login is enabled or not.
Definition userdto.cpp:241
QSharedPointer< UserPolicy > m_policy
Definition userdto.h:225
bool lastActivityDateNull() const
Definition userdto.cpp:272
QString primaryImageTag() const
Gets or sets the primary image tag.
Definition userdto.cpp:210
QDateTime m_lastActivityDate
Definition userdto.h:223
void setLastLoginDateNull()
Definition userdto.cpp:263
QSharedPointer< UserConfiguration > m_configuration
Definition userdto.h:224
QSharedPointer< UserPolicy > policy() const
Definition userdto.cpp:286
void setHasConfiguredPassword(bool newHasConfiguredPassword)
Gets or sets a value indicating whether this instance has configured password.
Definition userdto.cpp:231
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