-
Notifications
You must be signed in to change notification settings - Fork 5
/
OAIJob.cpp
640 lines (512 loc) · 16.9 KB
/
OAIJob.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
/**
* GAMS Engine
* With GAMS Engine you can register and solve GAMS models. It has a namespace management system, so you can restrict your users to certain models.
*
* The version of the OpenAPI document: latest
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "OAIJob.h"
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include "OAIHelpers.h"
namespace OpenAPI {
OAIJob::OAIJob(QString json) {
this->initializeModel();
this->fromJson(json);
}
OAIJob::OAIJob() {
this->initializeModel();
}
OAIJob::~OAIJob() {}
void OAIJob::initializeModel() {
m_access_groups_isSet = false;
m_access_groups_isValid = false;
m_arguments_isSet = false;
m_arguments_isValid = false;
m_dep_tokens_isSet = false;
m_dep_tokens_isValid = false;
m_finished_at_isSet = false;
m_finished_at_isValid = false;
m_is_data_provided_isSet = false;
m_is_data_provided_isValid = false;
m_is_temporary_model_isSet = false;
m_is_temporary_model_isValid = false;
m_labels_isSet = false;
m_labels_isValid = false;
m_model_isSet = false;
m_model_isValid = false;
m_r_namespace_isSet = false;
m_r_namespace_isValid = false;
m_process_status_isSet = false;
m_process_status_isValid = false;
m_result_exists_isSet = false;
m_result_exists_isValid = false;
m_status_isSet = false;
m_status_isValid = false;
m_stdout_filename_isSet = false;
m_stdout_filename_isValid = false;
m_stream_entries_isSet = false;
m_stream_entries_isValid = false;
m_submitted_at_isSet = false;
m_submitted_at_isValid = false;
m_tag_isSet = false;
m_tag_isValid = false;
m_text_entries_isSet = false;
m_text_entries_isValid = false;
m_token_isSet = false;
m_token_isValid = false;
m_user_isSet = false;
m_user_isValid = false;
}
void OAIJob::fromJson(QString jsonString) {
QByteArray array(jsonString.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
}
void OAIJob::fromJsonObject(QJsonObject json) {
m_access_groups_isValid = ::OpenAPI::fromJsonValue(access_groups, json[QString("access_groups")]);
m_access_groups_isSet = !json[QString("access_groups")].isNull() && m_access_groups_isValid;
m_arguments_isValid = ::OpenAPI::fromJsonValue(arguments, json[QString("arguments")]);
m_arguments_isSet = !json[QString("arguments")].isNull() && m_arguments_isValid;
m_dep_tokens_isValid = ::OpenAPI::fromJsonValue(dep_tokens, json[QString("dep_tokens")]);
m_dep_tokens_isSet = !json[QString("dep_tokens")].isNull() && m_dep_tokens_isValid;
m_finished_at_isValid = ::OpenAPI::fromJsonValue(finished_at, json[QString("finished_at")]);
m_finished_at_isSet = !json[QString("finished_at")].isNull() && m_finished_at_isValid;
m_is_data_provided_isValid = ::OpenAPI::fromJsonValue(is_data_provided, json[QString("is_data_provided")]);
m_is_data_provided_isSet = !json[QString("is_data_provided")].isNull() && m_is_data_provided_isValid;
m_is_temporary_model_isValid = ::OpenAPI::fromJsonValue(is_temporary_model, json[QString("is_temporary_model")]);
m_is_temporary_model_isSet = !json[QString("is_temporary_model")].isNull() && m_is_temporary_model_isValid;
m_labels_isValid = ::OpenAPI::fromJsonValue(labels, json[QString("labels")]);
m_labels_isSet = !json[QString("labels")].isNull() && m_labels_isValid;
m_model_isValid = ::OpenAPI::fromJsonValue(model, json[QString("model")]);
m_model_isSet = !json[QString("model")].isNull() && m_model_isValid;
m_r_namespace_isValid = ::OpenAPI::fromJsonValue(r_namespace, json[QString("namespace")]);
m_r_namespace_isSet = !json[QString("namespace")].isNull() && m_r_namespace_isValid;
m_process_status_isValid = ::OpenAPI::fromJsonValue(process_status, json[QString("process_status")]);
m_process_status_isSet = !json[QString("process_status")].isNull() && m_process_status_isValid;
m_result_exists_isValid = ::OpenAPI::fromJsonValue(result_exists, json[QString("result_exists")]);
m_result_exists_isSet = !json[QString("result_exists")].isNull() && m_result_exists_isValid;
m_status_isValid = ::OpenAPI::fromJsonValue(status, json[QString("status")]);
m_status_isSet = !json[QString("status")].isNull() && m_status_isValid;
m_stdout_filename_isValid = ::OpenAPI::fromJsonValue(stdout_filename, json[QString("stdout_filename")]);
m_stdout_filename_isSet = !json[QString("stdout_filename")].isNull() && m_stdout_filename_isValid;
m_stream_entries_isValid = ::OpenAPI::fromJsonValue(stream_entries, json[QString("stream_entries")]);
m_stream_entries_isSet = !json[QString("stream_entries")].isNull() && m_stream_entries_isValid;
m_submitted_at_isValid = ::OpenAPI::fromJsonValue(submitted_at, json[QString("submitted_at")]);
m_submitted_at_isSet = !json[QString("submitted_at")].isNull() && m_submitted_at_isValid;
m_tag_isValid = ::OpenAPI::fromJsonValue(tag, json[QString("tag")]);
m_tag_isSet = !json[QString("tag")].isNull() && m_tag_isValid;
m_text_entries_isValid = ::OpenAPI::fromJsonValue(text_entries, json[QString("text_entries")]);
m_text_entries_isSet = !json[QString("text_entries")].isNull() && m_text_entries_isValid;
m_token_isValid = ::OpenAPI::fromJsonValue(token, json[QString("token")]);
m_token_isSet = !json[QString("token")].isNull() && m_token_isValid;
m_user_isValid = ::OpenAPI::fromJsonValue(user, json[QString("user")]);
m_user_isSet = !json[QString("user")].isNull() && m_user_isValid;
}
QString OAIJob::asJson() const {
QJsonObject obj = this->asJsonObject();
QJsonDocument doc(obj);
QByteArray bytes = doc.toJson();
return QString(bytes);
}
QJsonObject OAIJob::asJsonObject() const {
QJsonObject obj;
if (access_groups.size() > 0) {
obj.insert(QString("access_groups"), ::OpenAPI::toJsonValue(access_groups));
}
if (arguments.size() > 0) {
obj.insert(QString("arguments"), ::OpenAPI::toJsonValue(arguments));
}
if (dep_tokens.size() > 0) {
obj.insert(QString("dep_tokens"), ::OpenAPI::toJsonValue(dep_tokens));
}
if (m_finished_at_isSet) {
obj.insert(QString("finished_at"), ::OpenAPI::toJsonValue(finished_at));
}
if (m_is_data_provided_isSet) {
obj.insert(QString("is_data_provided"), ::OpenAPI::toJsonValue(is_data_provided));
}
if (m_is_temporary_model_isSet) {
obj.insert(QString("is_temporary_model"), ::OpenAPI::toJsonValue(is_temporary_model));
}
if (labels.isSet()) {
obj.insert(QString("labels"), ::OpenAPI::toJsonValue(labels));
}
if (m_model_isSet) {
obj.insert(QString("model"), ::OpenAPI::toJsonValue(model));
}
if (m_r_namespace_isSet) {
obj.insert(QString("namespace"), ::OpenAPI::toJsonValue(r_namespace));
}
if (m_process_status_isSet) {
obj.insert(QString("process_status"), ::OpenAPI::toJsonValue(process_status));
}
if (m_result_exists_isSet) {
obj.insert(QString("result_exists"), ::OpenAPI::toJsonValue(result_exists));
}
if (m_status_isSet) {
obj.insert(QString("status"), ::OpenAPI::toJsonValue(status));
}
if (m_stdout_filename_isSet) {
obj.insert(QString("stdout_filename"), ::OpenAPI::toJsonValue(stdout_filename));
}
if (stream_entries.size() > 0) {
obj.insert(QString("stream_entries"), ::OpenAPI::toJsonValue(stream_entries));
}
if (m_submitted_at_isSet) {
obj.insert(QString("submitted_at"), ::OpenAPI::toJsonValue(submitted_at));
}
if (m_tag_isSet) {
obj.insert(QString("tag"), ::OpenAPI::toJsonValue(tag));
}
if (text_entries.size() > 0) {
obj.insert(QString("text_entries"), ::OpenAPI::toJsonValue(text_entries));
}
if (m_token_isSet) {
obj.insert(QString("token"), ::OpenAPI::toJsonValue(token));
}
if (user.isSet()) {
obj.insert(QString("user"), ::OpenAPI::toJsonValue(user));
}
return obj;
}
QList<QString> OAIJob::getAccessGroups() const {
return access_groups;
}
void OAIJob::setAccessGroups(const QList<QString> &access_groups) {
this->access_groups = access_groups;
this->m_access_groups_isSet = true;
}
bool OAIJob::is_access_groups_Set() const{
return m_access_groups_isSet;
}
bool OAIJob::is_access_groups_Valid() const{
return m_access_groups_isValid;
}
QList<QString> OAIJob::getArguments() const {
return arguments;
}
void OAIJob::setArguments(const QList<QString> &arguments) {
this->arguments = arguments;
this->m_arguments_isSet = true;
}
bool OAIJob::is_arguments_Set() const{
return m_arguments_isSet;
}
bool OAIJob::is_arguments_Valid() const{
return m_arguments_isValid;
}
QList<QString> OAIJob::getDepTokens() const {
return dep_tokens;
}
void OAIJob::setDepTokens(const QList<QString> &dep_tokens) {
this->dep_tokens = dep_tokens;
this->m_dep_tokens_isSet = true;
}
bool OAIJob::is_dep_tokens_Set() const{
return m_dep_tokens_isSet;
}
bool OAIJob::is_dep_tokens_Valid() const{
return m_dep_tokens_isValid;
}
QDateTime OAIJob::getFinishedAt() const {
return finished_at;
}
void OAIJob::setFinishedAt(const QDateTime &finished_at) {
this->finished_at = finished_at;
this->m_finished_at_isSet = true;
}
bool OAIJob::is_finished_at_Set() const{
return m_finished_at_isSet;
}
bool OAIJob::is_finished_at_Valid() const{
return m_finished_at_isValid;
}
bool OAIJob::isIsDataProvided() const {
return is_data_provided;
}
void OAIJob::setIsDataProvided(const bool &is_data_provided) {
this->is_data_provided = is_data_provided;
this->m_is_data_provided_isSet = true;
}
bool OAIJob::is_is_data_provided_Set() const{
return m_is_data_provided_isSet;
}
bool OAIJob::is_is_data_provided_Valid() const{
return m_is_data_provided_isValid;
}
bool OAIJob::isIsTemporaryModel() const {
return is_temporary_model;
}
void OAIJob::setIsTemporaryModel(const bool &is_temporary_model) {
this->is_temporary_model = is_temporary_model;
this->m_is_temporary_model_isSet = true;
}
bool OAIJob::is_is_temporary_model_Set() const{
return m_is_temporary_model_isSet;
}
bool OAIJob::is_is_temporary_model_Valid() const{
return m_is_temporary_model_isValid;
}
OAIModel_job_labels OAIJob::getLabels() const {
return labels;
}
void OAIJob::setLabels(const OAIModel_job_labels &labels) {
this->labels = labels;
this->m_labels_isSet = true;
}
bool OAIJob::is_labels_Set() const{
return m_labels_isSet;
}
bool OAIJob::is_labels_Valid() const{
return m_labels_isValid;
}
QString OAIJob::getModel() const {
return model;
}
void OAIJob::setModel(const QString &model) {
this->model = model;
this->m_model_isSet = true;
}
bool OAIJob::is_model_Set() const{
return m_model_isSet;
}
bool OAIJob::is_model_Valid() const{
return m_model_isValid;
}
QString OAIJob::getRNamespace() const {
return r_namespace;
}
void OAIJob::setRNamespace(const QString &r_namespace) {
this->r_namespace = r_namespace;
this->m_r_namespace_isSet = true;
}
bool OAIJob::is_r_namespace_Set() const{
return m_r_namespace_isSet;
}
bool OAIJob::is_r_namespace_Valid() const{
return m_r_namespace_isValid;
}
qint32 OAIJob::getProcessStatus() const {
return process_status;
}
void OAIJob::setProcessStatus(const qint32 &process_status) {
this->process_status = process_status;
this->m_process_status_isSet = true;
}
bool OAIJob::is_process_status_Set() const{
return m_process_status_isSet;
}
bool OAIJob::is_process_status_Valid() const{
return m_process_status_isValid;
}
bool OAIJob::isResultExists() const {
return result_exists;
}
void OAIJob::setResultExists(const bool &result_exists) {
this->result_exists = result_exists;
this->m_result_exists_isSet = true;
}
bool OAIJob::is_result_exists_Set() const{
return m_result_exists_isSet;
}
bool OAIJob::is_result_exists_Valid() const{
return m_result_exists_isValid;
}
qint32 OAIJob::getStatus() const {
return status;
}
void OAIJob::setStatus(const qint32 &status) {
this->status = status;
this->m_status_isSet = true;
}
bool OAIJob::is_status_Set() const{
return m_status_isSet;
}
bool OAIJob::is_status_Valid() const{
return m_status_isValid;
}
QString OAIJob::getStdoutFilename() const {
return stdout_filename;
}
void OAIJob::setStdoutFilename(const QString &stdout_filename) {
this->stdout_filename = stdout_filename;
this->m_stdout_filename_isSet = true;
}
bool OAIJob::is_stdout_filename_Set() const{
return m_stdout_filename_isSet;
}
bool OAIJob::is_stdout_filename_Valid() const{
return m_stdout_filename_isValid;
}
QList<QString> OAIJob::getStreamEntries() const {
return stream_entries;
}
void OAIJob::setStreamEntries(const QList<QString> &stream_entries) {
this->stream_entries = stream_entries;
this->m_stream_entries_isSet = true;
}
bool OAIJob::is_stream_entries_Set() const{
return m_stream_entries_isSet;
}
bool OAIJob::is_stream_entries_Valid() const{
return m_stream_entries_isValid;
}
QDateTime OAIJob::getSubmittedAt() const {
return submitted_at;
}
void OAIJob::setSubmittedAt(const QDateTime &submitted_at) {
this->submitted_at = submitted_at;
this->m_submitted_at_isSet = true;
}
bool OAIJob::is_submitted_at_Set() const{
return m_submitted_at_isSet;
}
bool OAIJob::is_submitted_at_Valid() const{
return m_submitted_at_isValid;
}
QString OAIJob::getTag() const {
return tag;
}
void OAIJob::setTag(const QString &tag) {
this->tag = tag;
this->m_tag_isSet = true;
}
bool OAIJob::is_tag_Set() const{
return m_tag_isSet;
}
bool OAIJob::is_tag_Valid() const{
return m_tag_isValid;
}
QList<OAIText_entry> OAIJob::getTextEntries() const {
return text_entries;
}
void OAIJob::setTextEntries(const QList<OAIText_entry> &text_entries) {
this->text_entries = text_entries;
this->m_text_entries_isSet = true;
}
bool OAIJob::is_text_entries_Set() const{
return m_text_entries_isSet;
}
bool OAIJob::is_text_entries_Valid() const{
return m_text_entries_isValid;
}
QString OAIJob::getToken() const {
return token;
}
void OAIJob::setToken(const QString &token) {
this->token = token;
this->m_token_isSet = true;
}
bool OAIJob::is_token_Set() const{
return m_token_isSet;
}
bool OAIJob::is_token_Valid() const{
return m_token_isValid;
}
OAIModel_user OAIJob::getUser() const {
return user;
}
void OAIJob::setUser(const OAIModel_user &user) {
this->user = user;
this->m_user_isSet = true;
}
bool OAIJob::is_user_Set() const{
return m_user_isSet;
}
bool OAIJob::is_user_Valid() const{
return m_user_isValid;
}
bool OAIJob::isSet() const {
bool isObjectUpdated = false;
do {
if (access_groups.size() > 0) {
isObjectUpdated = true;
break;
}
if (arguments.size() > 0) {
isObjectUpdated = true;
break;
}
if (dep_tokens.size() > 0) {
isObjectUpdated = true;
break;
}
if (m_finished_at_isSet) {
isObjectUpdated = true;
break;
}
if (m_is_data_provided_isSet) {
isObjectUpdated = true;
break;
}
if (m_is_temporary_model_isSet) {
isObjectUpdated = true;
break;
}
if (labels.isSet()) {
isObjectUpdated = true;
break;
}
if (m_model_isSet) {
isObjectUpdated = true;
break;
}
if (m_r_namespace_isSet) {
isObjectUpdated = true;
break;
}
if (m_process_status_isSet) {
isObjectUpdated = true;
break;
}
if (m_result_exists_isSet) {
isObjectUpdated = true;
break;
}
if (m_status_isSet) {
isObjectUpdated = true;
break;
}
if (m_stdout_filename_isSet) {
isObjectUpdated = true;
break;
}
if (stream_entries.size() > 0) {
isObjectUpdated = true;
break;
}
if (m_submitted_at_isSet) {
isObjectUpdated = true;
break;
}
if (m_tag_isSet) {
isObjectUpdated = true;
break;
}
if (text_entries.size() > 0) {
isObjectUpdated = true;
break;
}
if (m_token_isSet) {
isObjectUpdated = true;
break;
}
if (user.isSet()) {
isObjectUpdated = true;
break;
}
} while (false);
return isObjectUpdated;
}
bool OAIJob::isValid() const {
// only required properties are required for the object to be considered valid
return true;
}
} // namespace OpenAPI