compute  v1
resource_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-05-15, 03:08:54 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: 214
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_COMPUTE_API_RESOURCE_COMMITMENT_H_
31 #define GOOGLE_COMPUTE_API_RESOURCE_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 namespace Json {
40 class Value;
41 } // namespace Json
42 
43 namespace google_compute_api {
44 using namespace googleapis;
45 
52 class ResourceCommitment : public client::JsonCppData {
53  public:
59  static ResourceCommitment* New();
60 
66  explicit ResourceCommitment(const Json::Value& storage);
67 
73  explicit ResourceCommitment(Json::Value* storage);
74 
78  virtual ~ResourceCommitment();
79 
85  const StringPiece GetTypeName() const {
86  return StringPiece("google_compute_api::ResourceCommitment");
87  }
88 
94  bool has_amount() const {
95  return Storage().isMember("amount");
96  }
97 
101  void clear_amount() {
102  MutableStorage()->removeMember("amount");
103  }
104 
105 
109  int64 get_amount() const {
110  const Json::Value& storage = Storage("amount");
111  return client::JsonValueToCppValueHelper<int64 >(storage);
112  }
113 
124  void set_amount(int64 value) {
125  client::SetJsonValueFromCppValueHelper<int64 >(
126  value, MutableStorage("amount"));
127  }
128 
134  bool has_type() const {
135  return Storage().isMember("type");
136  }
137 
141  void clear_type() {
142  MutableStorage()->removeMember("type");
143  }
144 
145 
149  const StringPiece get_type() const {
150  const Json::Value& v = Storage("type");
151  if (v == Json::Value::null) return StringPiece("");
152  return StringPiece(v.asCString());
153  }
154 
163  void set_type(const StringPiece& value) {
164  *MutableStorage("type") = value.data();
165  }
166 
167  private:
168  void operator=(const ResourceCommitment&);
169 }; // ResourceCommitment
170 } // namespace google_compute_api
171 #endif // GOOGLE_COMPUTE_API_RESOURCE_COMMITMENT_H_
int64 get_amount() const
Definition: resource_commitment.h:109
bool has_type() const
Definition: resource_commitment.h:134
void set_type(const StringPiece &value)
Definition: resource_commitment.h:163
bool has_amount() const
Definition: resource_commitment.h:94
Definition: resource_commitment.h:52
Definition: accelerator_config.h:39
void clear_type()
Definition: resource_commitment.h:141
Definition: accelerator_config.cc:41
void clear_amount()
Definition: resource_commitment.h:101
const StringPiece get_type() const
Definition: resource_commitment.h:149
const StringPiece GetTypeName() const
Definition: resource_commitment.h:85
void set_amount(int64 value)
Definition: resource_commitment.h:124