compute  v1
commitment.h
1 // Copyright 2010 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 
15 // This code was generated by google-apis-code-generator 1.5.1
16 // Build date: 2018-10-08 17:45:39 UTC
17 // on: 2019-04-20, 05:56:52 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Compute Engine API (compute/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 213
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_COMPUTE_API_COMMITMENT_H_
31 #define GOOGLE_COMPUTE_API_COMMITMENT_H_
32 
33 #include <string>
34 #include "googleapis/base/integral_types.h"
35 #include "googleapis/base/macros.h"
36 #include "googleapis/client/data/jsoncpp_data.h"
37 #include "googleapis/strings/stringpiece.h"
38 
39 #include "google/compute_api/resource_commitment.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_compute_api {
46 using namespace googleapis;
47 
63 class Commitment : public client::JsonCppData {
64  public:
70  static Commitment* New();
71 
77  explicit Commitment(const Json::Value& storage);
78 
84  explicit Commitment(Json::Value* storage);
85 
89  virtual ~Commitment();
90 
96  const StringPiece GetTypeName() const {
97  return StringPiece("google_compute_api::Commitment");
98  }
99 
105  bool has_creation_timestamp() const {
106  return Storage().isMember("creationTimestamp");
107  }
108 
113  MutableStorage()->removeMember("creationTimestamp");
114  }
115 
116 
120  const StringPiece get_creation_timestamp() const {
121  const Json::Value& v = Storage("creationTimestamp");
122  if (v == Json::Value::null) return StringPiece("");
123  return StringPiece(v.asCString());
124  }
125 
133  void set_creation_timestamp(const StringPiece& value) {
134  *MutableStorage("creationTimestamp") = value.data();
135  }
136 
142  bool has_description() const {
143  return Storage().isMember("description");
144  }
145 
150  MutableStorage()->removeMember("description");
151  }
152 
153 
157  const StringPiece get_description() const {
158  const Json::Value& v = Storage("description");
159  if (v == Json::Value::null) return StringPiece("");
160  return StringPiece(v.asCString());
161  }
162 
171  void set_description(const StringPiece& value) {
172  *MutableStorage("description") = value.data();
173  }
174 
180  bool has_end_timestamp() const {
181  return Storage().isMember("endTimestamp");
182  }
183 
188  MutableStorage()->removeMember("endTimestamp");
189  }
190 
191 
195  const StringPiece get_end_timestamp() const {
196  const Json::Value& v = Storage("endTimestamp");
197  if (v == Json::Value::null) return StringPiece("");
198  return StringPiece(v.asCString());
199  }
200 
208  void set_end_timestamp(const StringPiece& value) {
209  *MutableStorage("endTimestamp") = value.data();
210  }
211 
217  bool has_id() const {
218  return Storage().isMember("id");
219  }
220 
224  void clear_id() {
225  MutableStorage()->removeMember("id");
226  }
227 
228 
232  uint64 get_id() const {
233  const Json::Value& storage = Storage("id");
234  return client::JsonValueToCppValueHelper<uint64 >(storage);
235  }
236 
245  void set_id(uint64 value) {
246  client::SetJsonValueFromCppValueHelper<uint64 >(
247  value, MutableStorage("id"));
248  }
249 
255  bool has_kind() const {
256  return Storage().isMember("kind");
257  }
258 
262  void clear_kind() {
263  MutableStorage()->removeMember("kind");
264  }
265 
266 
270  const StringPiece get_kind() const {
271  const Json::Value& v = Storage("kind");
272  if (v == Json::Value::null) return StringPiece("");
273  return StringPiece(v.asCString());
274  }
275 
284  void set_kind(const StringPiece& value) {
285  *MutableStorage("kind") = value.data();
286  }
287 
293  bool has_name() const {
294  return Storage().isMember("name");
295  }
296 
300  void clear_name() {
301  MutableStorage()->removeMember("name");
302  }
303 
304 
308  const StringPiece get_name() const {
309  const Json::Value& v = Storage("name");
310  if (v == Json::Value::null) return StringPiece("");
311  return StringPiece(v.asCString());
312  }
313 
327  void set_name(const StringPiece& value) {
328  *MutableStorage("name") = value.data();
329  }
330 
336  bool has_plan() const {
337  return Storage().isMember("plan");
338  }
339 
343  void clear_plan() {
344  MutableStorage()->removeMember("plan");
345  }
346 
347 
351  const StringPiece get_plan() const {
352  const Json::Value& v = Storage("plan");
353  if (v == Json::Value::null) return StringPiece("");
354  return StringPiece(v.asCString());
355  }
356 
366  void set_plan(const StringPiece& value) {
367  *MutableStorage("plan") = value.data();
368  }
369 
375  bool has_region() const {
376  return Storage().isMember("region");
377  }
378 
382  void clear_region() {
383  MutableStorage()->removeMember("region");
384  }
385 
386 
390  const StringPiece get_region() const {
391  const Json::Value& v = Storage("region");
392  if (v == Json::Value::null) return StringPiece("");
393  return StringPiece(v.asCString());
394  }
395 
403  void set_region(const StringPiece& value) {
404  *MutableStorage("region") = value.data();
405  }
406 
412  bool has_resources() const {
413  return Storage().isMember("resources");
414  }
415 
420  MutableStorage()->removeMember("resources");
421  }
422 
423 
427  const client::JsonCppArray<ResourceCommitment > get_resources() const;
428 
438  client::JsonCppArray<ResourceCommitment > mutable_resources();
439 
445  bool has_self_link() const {
446  return Storage().isMember("selfLink");
447  }
448 
453  MutableStorage()->removeMember("selfLink");
454  }
455 
456 
460  const StringPiece get_self_link() const {
461  const Json::Value& v = Storage("selfLink");
462  if (v == Json::Value::null) return StringPiece("");
463  return StringPiece(v.asCString());
464  }
465 
473  void set_self_link(const StringPiece& value) {
474  *MutableStorage("selfLink") = value.data();
475  }
476 
482  bool has_start_timestamp() const {
483  return Storage().isMember("startTimestamp");
484  }
485 
490  MutableStorage()->removeMember("startTimestamp");
491  }
492 
493 
497  const StringPiece get_start_timestamp() const {
498  const Json::Value& v = Storage("startTimestamp");
499  if (v == Json::Value::null) return StringPiece("");
500  return StringPiece(v.asCString());
501  }
502 
510  void set_start_timestamp(const StringPiece& value) {
511  *MutableStorage("startTimestamp") = value.data();
512  }
513 
519  bool has_status() const {
520  return Storage().isMember("status");
521  }
522 
526  void clear_status() {
527  MutableStorage()->removeMember("status");
528  }
529 
530 
534  const StringPiece get_status() const {
535  const Json::Value& v = Storage("status");
536  if (v == Json::Value::null) return StringPiece("");
537  return StringPiece(v.asCString());
538  }
539 
549  void set_status(const StringPiece& value) {
550  *MutableStorage("status") = value.data();
551  }
552 
558  bool has_status_message() const {
559  return Storage().isMember("statusMessage");
560  }
561 
566  MutableStorage()->removeMember("statusMessage");
567  }
568 
569 
573  const StringPiece get_status_message() const {
574  const Json::Value& v = Storage("statusMessage");
575  if (v == Json::Value::null) return StringPiece("");
576  return StringPiece(v.asCString());
577  }
578 
586  void set_status_message(const StringPiece& value) {
587  *MutableStorage("statusMessage") = value.data();
588  }
589 
590  private:
591  void operator=(const Commitment&);
592 }; // Commitment
593 } // namespace google_compute_api
594 #endif // GOOGLE_COMPUTE_API_COMMITMENT_H_
void set_start_timestamp(const StringPiece &value)
Definition: commitment.h:510
void clear_name()
Definition: commitment.h:300
const StringPiece get_self_link() const
Definition: commitment.h:460
const StringPiece get_name() const
Definition: commitment.h:308
bool has_plan() const
Definition: commitment.h:336
bool has_resources() const
Definition: commitment.h:412
uint64 get_id() const
Definition: commitment.h:232
const StringPiece get_plan() const
Definition: commitment.h:351
const StringPiece get_kind() const
Definition: commitment.h:270
const StringPiece get_creation_timestamp() const
Definition: commitment.h:120
bool has_creation_timestamp() const
Definition: commitment.h:105
bool has_description() const
Definition: commitment.h:142
const StringPiece get_status() const
Definition: commitment.h:534
void clear_resources()
Definition: commitment.h:419
void clear_kind()
Definition: commitment.h:262
const StringPiece get_region() const
Definition: commitment.h:390
const StringPiece get_start_timestamp() const
Definition: commitment.h:497
void set_creation_timestamp(const StringPiece &value)
Definition: commitment.h:133
bool has_self_link() const
Definition: commitment.h:445
void clear_start_timestamp()
Definition: commitment.h:489
void set_region(const StringPiece &value)
Definition: commitment.h:403
bool has_status_message() const
Definition: commitment.h:558
const StringPiece get_end_timestamp() const
Definition: commitment.h:195
bool has_id() const
Definition: commitment.h:217
void clear_region()
Definition: commitment.h:382
void clear_description()
Definition: commitment.h:149
void clear_status_message()
Definition: commitment.h:565
void clear_end_timestamp()
Definition: commitment.h:187
void clear_id()
Definition: commitment.h:224
bool has_end_timestamp() const
Definition: commitment.h:180
bool has_region() const
Definition: commitment.h:375
void set_id(uint64 value)
Definition: commitment.h:245
Definition: accelerator_config.h:39
void clear_self_link()
Definition: commitment.h:452
bool has_status() const
Definition: commitment.h:519
const StringPiece GetTypeName() const
Definition: commitment.h:96
Definition: accelerator_config.cc:41
void set_kind(const StringPiece &value)
Definition: commitment.h:284
Definition: commitment.h:63
const StringPiece get_description() const
Definition: commitment.h:157
void set_description(const StringPiece &value)
Definition: commitment.h:171
void set_plan(const StringPiece &value)
Definition: commitment.h:366
void set_status_message(const StringPiece &value)
Definition: commitment.h:586
const StringPiece get_status_message() const
Definition: commitment.h:573
bool has_kind() const
Definition: commitment.h:255
void set_status(const StringPiece &value)
Definition: commitment.h:549
bool has_start_timestamp() const
Definition: commitment.h:482
bool has_name() const
Definition: commitment.h:293
void set_self_link(const StringPiece &value)
Definition: commitment.h:473
void clear_creation_timestamp()
Definition: commitment.h:112
void set_name(const StringPiece &value)
Definition: commitment.h:327
void clear_plan()
Definition: commitment.h:343
void set_end_timestamp(const StringPiece &value)
Definition: commitment.h:208
void clear_status()
Definition: commitment.h:526