Revision control

+ /**
+ * Client with 'QtOpenAPICommon' option Test
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * Do not edit the class manually.
+ */
+
+ #ifndef QtOAI_OBJECT_H
+ #define QtOAI_OBJECT_H
+
+ #include <QtCore/qjsondocument.h>
+ #include <QtCore/qjsonobject.h>
+ #include <QtCore/qstring.h>
+
+ namespace QtOpenAPI {
+
+ class QtOAIObject {
+ public:
+ QtOAIObject() {}
+
+ QtOAIObject(const QString &jsonString) {
+ fromJson(jsonString);
+ }
+
+ virtual ~QtOAIObject() {}
+
+ virtual QJsonObject asJsonObject() const {
+ return m_jObj;
+ }
+
+ virtual QString asJson() const {
+ QJsonDocument doc(m_jObj);
+ return doc.toJson(QJsonDocument::Compact);
+ }
+
+ virtual void fromJson(const QString &jsonString) {
+ QJsonDocument doc = QJsonDocument::fromJson(jsonString.toUtf8());
+ m_jObj = doc.object();
+ }
+
+ virtual void fromJsonObject(const QJsonObject &json) {
+ m_jObj = json;
+ }
+
+ virtual bool isSet() const {
+ return false;
+ }
+
+ virtual bool isValid() const {
+ return true;
+ }
+
+ private:
+ QJsonObject m_jObj;
+ };
+
+ inline bool operator==(const QtOAIObject& left, const QtOAIObject& right) {
+ return (left.asJsonObject() == right.asJsonObject());
+ }
+
+ inline size_t qHash(const QtOAIObject& obj, uint seed = 0) noexcept {
+ return qHash(obj.asJsonObject(), seed);
+ }
+
+ } // namespace QtOpenAPI
+
+ Q_DECLARE_METATYPE(QtOpenAPI::QtOAIObject)
+
+ #endif // QtOAI_OBJECT_H