30 #ifndef GOOGLE_COMPUTE_API_SNAPSHOT_H_ 31 #define GOOGLE_COMPUTE_API_SNAPSHOT_H_ 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" 39 #include "google/compute_api/customer_encryption_key.h" 68 explicit Snapshot(
const Json::Value& storage);
75 explicit Snapshot(Json::Value* storage);
88 return StringPiece(
"google_compute_api::Snapshot");
97 return Storage().isMember(
"creationTimestamp");
104 MutableStorage()->removeMember(
"creationTimestamp");
112 const Json::Value& v = Storage(
"creationTimestamp");
113 if (v == Json::Value::null)
return StringPiece(
"");
114 return StringPiece(v.asCString());
125 *MutableStorage(
"creationTimestamp") = value.data();
134 return Storage().isMember(
"description");
141 MutableStorage()->removeMember(
"description");
149 const Json::Value& v = Storage(
"description");
150 if (v == Json::Value::null)
return StringPiece(
"");
151 return StringPiece(v.asCString());
163 *MutableStorage(
"description") = value.data();
172 return Storage().isMember(
"diskSizeGb");
179 MutableStorage()->removeMember(
"diskSizeGb");
187 const Json::Value& storage = Storage(
"diskSizeGb");
188 return client::JsonValueToCppValueHelper<int64 >(storage);
199 client::SetJsonValueFromCppValueHelper<int64 >(
200 value, MutableStorage(
"diskSizeGb"));
209 return Storage().isMember(
"id");
216 MutableStorage()->removeMember(
"id");
224 const Json::Value& storage = Storage(
"id");
225 return client::JsonValueToCppValueHelper<uint64 >(storage);
237 client::SetJsonValueFromCppValueHelper<uint64 >(
238 value, MutableStorage(
"id"));
247 return Storage().isMember(
"kind");
254 MutableStorage()->removeMember(
"kind");
262 const Json::Value& v = Storage(
"kind");
263 if (v == Json::Value::null)
return StringPiece(
"");
264 return StringPiece(v.asCString());
276 *MutableStorage(
"kind") = value.data();
285 return Storage().isMember(
"labelFingerprint");
292 MutableStorage()->removeMember(
"labelFingerprint");
300 const Json::Value& v = Storage(
"labelFingerprint");
301 if (v == Json::Value::null)
return StringPiece(
"");
302 return StringPiece(v.asCString());
320 *MutableStorage(
"labelFingerprint") = value.data();
329 return Storage().isMember(
"labels");
336 MutableStorage()->removeMember(
"labels");
343 const client::JsonCppAssociativeArray<string >
get_labels()
const {
344 const Json::Value& storage = Storage(
"labels");
345 return client::JsonValueToCppValueHelper<client::JsonCppAssociativeArray<string > >(storage);
357 Json::Value* storage = MutableStorage(
"labels");
358 return client::JsonValueToMutableCppValueHelper<client::JsonCppAssociativeArray<string > >(storage);
367 return Storage().isMember(
"licenseCodes");
374 MutableStorage()->removeMember(
"licenseCodes");
382 const Json::Value& storage = Storage(
"licenseCodes");
383 return client::JsonValueToCppValueHelper<client::JsonCppArray<int64 > >(storage);
396 Json::Value* storage = MutableStorage(
"licenseCodes");
397 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<int64 > >(storage);
406 return Storage().isMember(
"licenses");
413 MutableStorage()->removeMember(
"licenses");
421 const Json::Value& storage = Storage(
"licenses");
422 return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
436 Json::Value* storage = MutableStorage(
"licenses");
437 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
446 return Storage().isMember(
"name");
453 MutableStorage()->removeMember(
"name");
461 const Json::Value& v = Storage(
"name");
462 if (v == Json::Value::null)
return StringPiece(
"");
463 return StringPiece(v.asCString());
480 *MutableStorage(
"name") = value.data();
489 return Storage().isMember(
"selfLink");
496 MutableStorage()->removeMember(
"selfLink");
504 const Json::Value& v = Storage(
"selfLink");
505 if (v == Json::Value::null)
return StringPiece(
"");
506 return StringPiece(v.asCString());
517 *MutableStorage(
"selfLink") = value.data();
526 return Storage().isMember(
"snapshotEncryptionKey");
533 MutableStorage()->removeMember(
"snapshotEncryptionKey");
571 return Storage().isMember(
"sourceDisk");
578 MutableStorage()->removeMember(
"sourceDisk");
586 const Json::Value& v = Storage(
"sourceDisk");
587 if (v == Json::Value::null)
return StringPiece(
"");
588 return StringPiece(v.asCString());
599 *MutableStorage(
"sourceDisk") = value.data();
609 return Storage().isMember(
"sourceDiskEncryptionKey");
616 MutableStorage()->removeMember(
"sourceDiskEncryptionKey");
643 return Storage().isMember(
"sourceDiskId");
650 MutableStorage()->removeMember(
"sourceDiskId");
658 const Json::Value& v = Storage(
"sourceDiskId");
659 if (v == Json::Value::null)
return StringPiece(
"");
660 return StringPiece(v.asCString());
673 *MutableStorage(
"sourceDiskId") = value.data();
682 return Storage().isMember(
"status");
689 MutableStorage()->removeMember(
"status");
697 const Json::Value& v = Storage(
"status");
698 if (v == Json::Value::null)
return StringPiece(
"");
699 return StringPiece(v.asCString());
711 *MutableStorage(
"status") = value.data();
720 return Storage().isMember(
"storageBytes");
727 MutableStorage()->removeMember(
"storageBytes");
735 const Json::Value& storage = Storage(
"storageBytes");
736 return client::JsonValueToCppValueHelper<int64 >(storage);
749 client::SetJsonValueFromCppValueHelper<int64 >(
750 value, MutableStorage(
"storageBytes"));
759 return Storage().isMember(
"storageBytesStatus");
766 MutableStorage()->removeMember(
"storageBytesStatus");
774 const Json::Value& v = Storage(
"storageBytesStatus");
775 if (v == Json::Value::null)
return StringPiece(
"");
776 return StringPiece(v.asCString());
790 *MutableStorage(
"storageBytesStatus") = value.data();
799 return Storage().isMember(
"storageLocations");
806 MutableStorage()->removeMember(
"storageLocations");
815 const Json::Value& storage = Storage(
"storageLocations");
816 return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
828 Json::Value* storage = MutableStorage(
"storageLocations");
829 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
836 #endif // GOOGLE_COMPUTE_API_SNAPSHOT_H_ const client::JsonCppArray< string > get_storage_locations() const
Definition: snapshot.h:814
const StringPiece get_label_fingerprint() const
Definition: snapshot.h:299
void clear_source_disk_id()
Definition: snapshot.h:649
const StringPiece get_storage_bytes_status() const
Definition: snapshot.h:773
client::JsonCppArray< string > mutable_licenses()
Definition: snapshot.h:435
const StringPiece get_kind() const
Definition: snapshot.h:261
void clear_license_codes()
Definition: snapshot.h:373
void clear_licenses()
Definition: snapshot.h:412
bool has_name() const
Definition: snapshot.h:445
client::JsonCppArray< int64 > mutable_licenseCodes()
Definition: snapshot.h:395
void set_label_fingerprint(const StringPiece &value)
Definition: snapshot.h:319
void set_kind(const StringPiece &value)
Definition: snapshot.h:275
void clear_description()
Definition: snapshot.h:140
void clear_creation_timestamp()
Definition: snapshot.h:103
void clear_status()
Definition: snapshot.h:688
bool has_storage_bytes_status() const
Definition: snapshot.h:758
const StringPiece GetTypeName() const
Definition: snapshot.h:87
void clear_labels()
Definition: snapshot.h:335
bool has_licenses() const
Definition: snapshot.h:405
Definition: snapshot.h:54
void clear_storage_bytes()
Definition: snapshot.h:726
bool has_labels() const
Definition: snapshot.h:328
bool has_license_codes() const
Definition: snapshot.h:366
void clear_source_disk_encryption_key()
Definition: snapshot.h:615
int64 get_disk_size_gb() const
Definition: snapshot.h:186
const StringPiece get_source_disk() const
Definition: snapshot.h:585
void clear_storage_bytes_status()
Definition: snapshot.h:765
void set_source_disk_id(const StringPiece &value)
Definition: snapshot.h:672
const client::JsonCppAssociativeArray< string > get_labels() const
Definition: snapshot.h:343
Definition: customer_encryption_key.h:50
void set_creation_timestamp(const StringPiece &value)
Definition: snapshot.h:124
void clear_name()
Definition: snapshot.h:452
const StringPiece get_name() const
Definition: snapshot.h:460
const client::JsonCppArray< int64 > get_license_codes() const
Definition: snapshot.h:381
bool has_description() const
Definition: snapshot.h:133
void set_source_disk(const StringPiece &value)
Definition: snapshot.h:598
const client::JsonCppArray< string > get_licenses() const
Definition: snapshot.h:420
bool has_disk_size_gb() const
Definition: snapshot.h:171
void clear_kind()
Definition: snapshot.h:253
const StringPiece get_description() const
Definition: snapshot.h:148
Definition: accelerator_config.h:39
uint64 get_id() const
Definition: snapshot.h:223
void set_status(const StringPiece &value)
Definition: snapshot.h:710
bool has_id() const
Definition: snapshot.h:208
void clear_source_disk()
Definition: snapshot.h:577
bool has_status() const
Definition: snapshot.h:681
const StringPiece get_creation_timestamp() const
Definition: snapshot.h:111
void set_disk_size_gb(int64 value)
Definition: snapshot.h:198
void set_storage_bytes(int64 value)
Definition: snapshot.h:748
void set_name(const StringPiece &value)
Definition: snapshot.h:479
Definition: accelerator_config.cc:41
bool has_creation_timestamp() const
Definition: snapshot.h:96
bool has_self_link() const
Definition: snapshot.h:488
const StringPiece get_source_disk_id() const
Definition: snapshot.h:657
client::JsonCppAssociativeArray< string > mutable_labels()
Definition: snapshot.h:356
int64 get_storage_bytes() const
Definition: snapshot.h:734
bool has_label_fingerprint() const
Definition: snapshot.h:284
bool has_source_disk_encryption_key() const
Definition: snapshot.h:608
void clear_self_link()
Definition: snapshot.h:495
void set_storage_bytes_status(const StringPiece &value)
Definition: snapshot.h:789
void clear_id()
Definition: snapshot.h:215
void set_self_link(const StringPiece &value)
Definition: snapshot.h:516
bool has_source_disk() const
Definition: snapshot.h:570
client::JsonCppArray< string > mutable_storageLocations()
Definition: snapshot.h:827
const StringPiece get_status() const
Definition: snapshot.h:696
void clear_disk_size_gb()
Definition: snapshot.h:178
const StringPiece get_self_link() const
Definition: snapshot.h:503
bool has_kind() const
Definition: snapshot.h:246
bool has_source_disk_id() const
Definition: snapshot.h:642
void clear_storage_locations()
Definition: snapshot.h:805
bool has_snapshot_encryption_key() const
Definition: snapshot.h:525
bool has_storage_locations() const
Definition: snapshot.h:798
bool has_storage_bytes() const
Definition: snapshot.h:719
void set_description(const StringPiece &value)
Definition: snapshot.h:162
void set_id(uint64 value)
Definition: snapshot.h:236
void clear_label_fingerprint()
Definition: snapshot.h:291
void clear_snapshot_encryption_key()
Definition: snapshot.h:532