Skip to content

Commit 0330a3c

Browse files
committed
Merge pull request #61 from owncloud/clean-up-drives
clean up unused props and add examples for drives
1 parent d7667fd commit 0330a3c

15 files changed

+246
-631
lines changed

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ client/OAICollection_of_driveItems.cpp
1010
client/OAICollection_of_driveItems.h
1111
client/OAICollection_of_drives.cpp
1212
client/OAICollection_of_drives.h
13+
client/OAICollection_of_drives_1.cpp
14+
client/OAICollection_of_drives_1.h
1315
client/OAICollection_of_educationUser.cpp
1416
client/OAICollection_of_educationUser.h
1517
client/OAICollection_of_group.cpp

client/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ add_library(client STATIC
2323
OAICollection_of_class.cpp
2424
OAICollection_of_driveItems.cpp
2525
OAICollection_of_drives.cpp
26+
OAICollection_of_drives_1.cpp
2627
OAICollection_of_educationUser.cpp
2728
OAICollection_of_group.cpp
2829
OAICollection_of_schools.cpp
@@ -109,6 +110,7 @@ set(HEADER
109110
OAICollection_of_class.h
110111
OAICollection_of_driveItems.h
111112
OAICollection_of_drives.h
113+
OAICollection_of_drives_1.h
112114
OAICollection_of_educationUser.h
113115
OAICollection_of_group.h
114116
OAICollection_of_schools.h

client/OAICollection_of_drives_1.cpp

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
// model-body.mustache
2+
3+
// licenseInfo.mustache
4+
5+
/**
6+
* Libre Graph API
7+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
8+
*
9+
* The version of the OpenAPI document: v1.0.0
10+
*
11+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12+
* https://openapi-generator.tech
13+
* Do not edit the class manually.
14+
*/
15+
16+
#include "OAICollection_of_drives_1.h"
17+
18+
#include <QDebug>
19+
#include <QJsonArray>
20+
#include <QJsonDocument>
21+
#include <QObject>
22+
23+
#include "OAIHelpers.h"
24+
25+
namespace OpenAPI {
26+
27+
class OAICollection_of_drives_1Private {
28+
friend class OAICollection_of_drives_1;
29+
30+
QList<OAIDrive> value;
31+
bool value_isSet;
32+
bool value_isValid;
33+
};
34+
35+
OAICollection_of_drives_1::OAICollection_of_drives_1()
36+
: d_ptr()
37+
{
38+
}
39+
40+
OAICollection_of_drives_1::OAICollection_of_drives_1(const OAICollection_of_drives_1& other)
41+
: d_ptr(other.d_ptr)
42+
{
43+
}
44+
45+
OAICollection_of_drives_1::OAICollection_of_drives_1(QString json)
46+
: d_ptr(nullptr)
47+
{
48+
this->fromJson(json);
49+
}
50+
51+
OAICollection_of_drives_1::~OAICollection_of_drives_1() = default;
52+
53+
void OAICollection_of_drives_1::initializeModel() {
54+
if (d_ptr == nullptr) {
55+
d_ptr.reset(new OAICollection_of_drives_1Private{});
56+
57+
Q_D(OAICollection_of_drives_1);
58+
59+
60+
d->value_isSet = false;
61+
d->value_isValid = false;
62+
}
63+
}
64+
65+
void OAICollection_of_drives_1::fromJson(QString jsonString) {
66+
QByteArray array(jsonString.toUtf8());
67+
QJsonDocument doc = QJsonDocument::fromJson(array);
68+
QJsonObject jsonObject = doc.object();
69+
this->fromJsonObject(jsonObject);
70+
}
71+
72+
void OAICollection_of_drives_1::fromJsonObject(QJsonObject json) {
73+
initializeModel();
74+
75+
Q_D(OAICollection_of_drives_1);
76+
77+
d->value_isValid = ::OpenAPI::fromJsonValue(d->value, json[QString("value")]);
78+
d->value_isSet = !json[QString("value")].isNull() && d->value_isValid;
79+
}
80+
81+
QString OAICollection_of_drives_1::asJson() const {
82+
QJsonObject obj = this->asJsonObject();
83+
QJsonDocument doc(obj);
84+
QByteArray bytes = doc.toJson();
85+
return QString(bytes);
86+
}
87+
88+
QJsonObject OAICollection_of_drives_1::asJsonObject() const {
89+
Q_D(const OAICollection_of_drives_1);
90+
if(!d){
91+
return {};
92+
}
93+
QJsonObject obj;
94+
if (d->value.size() > 0) {
95+
obj.insert(QString("value"), ::OpenAPI::toJsonValue(d->value));
96+
}
97+
return obj;
98+
}
99+
100+
QList<OAIDrive> OAICollection_of_drives_1::getValue() const {
101+
Q_D(const OAICollection_of_drives_1);
102+
if(!d){
103+
return {};
104+
}
105+
return d->value;
106+
}
107+
void OAICollection_of_drives_1::setValue(const QList<OAIDrive> &value) {
108+
Q_D(OAICollection_of_drives_1);
109+
Q_ASSERT(d);
110+
111+
d->value = value;
112+
d->value_isSet = true;
113+
}
114+
115+
bool OAICollection_of_drives_1::is_value_Set() const{
116+
Q_D(const OAICollection_of_drives_1);
117+
if(!d){
118+
return false;
119+
}
120+
121+
return d->value_isSet;
122+
}
123+
124+
bool OAICollection_of_drives_1::is_value_Valid() const{
125+
Q_D(const OAICollection_of_drives_1);
126+
if(!d){
127+
return false;
128+
}
129+
return d->value_isValid;
130+
}
131+
132+
bool OAICollection_of_drives_1::isSet() const {
133+
Q_D(const OAICollection_of_drives_1);
134+
if(!d){
135+
return false;
136+
}
137+
bool isObjectUpdated = false;
138+
do {
139+
if (d->value.size() > 0) {
140+
isObjectUpdated = true;
141+
break;
142+
}
143+
} while (false);
144+
return isObjectUpdated;
145+
}
146+
147+
bool OAICollection_of_drives_1::isValid() const {
148+
Q_D(const OAICollection_of_drives_1);
149+
if(!d){
150+
return false;
151+
}
152+
// only required properties are required for the object to be considered valid
153+
return true;
154+
}
155+
156+
} // namespace OpenAPI

client/OAICollection_of_drives_1.h

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// model-header.mustache
2+
3+
// licenseInfo.mustache
4+
5+
/**
6+
* Libre Graph API
7+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
8+
*
9+
* The version of the OpenAPI document: v1.0.0
10+
*
11+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12+
* https://openapi-generator.tech
13+
* Do not edit the class manually.
14+
*/
15+
16+
/*
17+
* OAICollection_of_drives_1.h
18+
*
19+
*
20+
*/
21+
22+
#ifndef OAICollection_of_drives_1_H
23+
#define OAICollection_of_drives_1_H
24+
25+
#include <QJsonObject>
26+
27+
#include "OAIDrive.h"
28+
#include <QList>
29+
30+
#include "OAIEnum.h"
31+
#include "OAIObject.h"
32+
33+
namespace OpenAPI {
34+
class OAIDrive;
35+
36+
37+
class OAICollection_of_drives_1Private;
38+
39+
class OAICollection_of_drives_1 : public OAIObject {
40+
public:
41+
OAICollection_of_drives_1();
42+
OAICollection_of_drives_1(const OAICollection_of_drives_1 &other);
43+
OAICollection_of_drives_1(QString json);
44+
~OAICollection_of_drives_1() override;
45+
46+
QString asJson() const override;
47+
QJsonObject asJsonObject() const override;
48+
void fromJsonObject(QJsonObject json) override;
49+
void fromJson(QString jsonString) override;
50+
51+
QList<OAIDrive> getValue() const;
52+
void setValue(const QList<OAIDrive> &value);
53+
bool is_value_Set() const;
54+
bool is_value_Valid() const;
55+
56+
virtual bool isSet() const override;
57+
virtual bool isValid() const override;
58+
59+
private:
60+
void initializeModel();
61+
Q_DECLARE_PRIVATE(OAICollection_of_drives_1)
62+
QSharedPointer<OAICollection_of_drives_1Private> d_ptr;
63+
};
64+
65+
} // namespace OpenAPI
66+
67+
Q_DECLARE_METATYPE(OpenAPI::OAICollection_of_drives_1)
68+
69+
#endif // OAICollection_of_drives_1_H

client/OAIDrive.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ bool OAIDrive::isValid() const {
10501050
return false;
10511051
}
10521052
// only required properties are required for the object to be considered valid
1053-
return true;
1053+
return d->name_isValid && true;
10541054
}
10551055

10561056
} // namespace OpenAPI

client/OAIDrive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/*
1717
* OAIDrive.h
1818
*
19-
* Storage Space. Read-only.
19+
* The drive represents a space on the storage.
2020
*/
2121

2222
#ifndef OAIDrive_H

0 commit comments

Comments
 (0)