container  v1
reservation_affinity.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: 2020-03-07, 01:20:42 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Kubernetes Engine API (container/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 93
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_CONTAINER_API_RESERVATION_AFFINITY_H_
31 #define GOOGLE_CONTAINER_API_RESERVATION_AFFINITY_H_
32 
33 #include <string>
34 #include "googleapis/base/macros.h"
35 #include "googleapis/client/data/jsoncpp_data.h"
36 #include "googleapis/strings/stringpiece.h"
37 
38 namespace Json {
39 class Value;
40 } // namespace Json
41 
42 namespace google_container_api {
43 using namespace googleapis;
44 
52 class ReservationAffinity : public client::JsonCppData {
53  public:
59  static ReservationAffinity* New();
60 
66  explicit ReservationAffinity(const Json::Value& storage);
67 
73  explicit ReservationAffinity(Json::Value* storage);
74 
78  virtual ~ReservationAffinity();
79 
85  const StringPiece GetTypeName() const {
86  return StringPiece("google_container_api::ReservationAffinity");
87  }
88 
96  return Storage().isMember("consumeReservationType");
97  }
98 
103  MutableStorage()->removeMember("consumeReservationType");
104  }
105 
106 
110  const StringPiece get_consume_reservation_type() const {
111  const Json::Value& v = Storage("consumeReservationType");
112  if (v == Json::Value::null) return StringPiece("");
113  return StringPiece(v.asCString());
114  }
115 
123  void set_consume_reservation_type(const StringPiece& value) {
124  *MutableStorage("consumeReservationType") = value.data();
125  }
126 
132  bool has_key() const {
133  return Storage().isMember("key");
134  }
135 
139  void clear_key() {
140  MutableStorage()->removeMember("key");
141  }
142 
143 
147  const StringPiece get_key() const {
148  const Json::Value& v = Storage("key");
149  if (v == Json::Value::null) return StringPiece("");
150  return StringPiece(v.asCString());
151  }
152 
162  void set_key(const StringPiece& value) {
163  *MutableStorage("key") = value.data();
164  }
165 
171  bool has_values() const {
172  return Storage().isMember("values");
173  }
174 
178  void clear_values() {
179  MutableStorage()->removeMember("values");
180  }
181 
182 
186  const client::JsonCppArray<string > get_values() const {
187  const Json::Value& storage = Storage("values");
188  return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
189  }
190 
198  client::JsonCppArray<string > mutable_values() {
199  Json::Value* storage = MutableStorage("values");
200  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
201  }
202 
203  private:
204  void operator=(const ReservationAffinity&);
205 }; // ReservationAffinity
206 } // namespace google_container_api
207 #endif // GOOGLE_CONTAINER_API_RESERVATION_AFFINITY_H_
Definition: reservation_affinity.h:52
void clear_values()
Definition: reservation_affinity.h:178
bool has_key() const
Definition: reservation_affinity.h:132
void set_consume_reservation_type(const StringPiece &value)
Definition: reservation_affinity.h:123
const StringPiece get_consume_reservation_type() const
Definition: reservation_affinity.h:110
bool has_values() const
Definition: reservation_affinity.h:171
const client::JsonCppArray< string > get_values() const
Definition: reservation_affinity.h:186
client::JsonCppArray< string > mutable_values()
Definition: reservation_affinity.h:198
Definition: accelerator_config.h:39
Definition: accelerator_config.cc:41
void set_key(const StringPiece &value)
Definition: reservation_affinity.h:162
void clear_key()
Definition: reservation_affinity.h:139
bool has_consume_reservation_type() const
Definition: reservation_affinity.h:95
const StringPiece GetTypeName() const
Definition: reservation_affinity.h:85
const StringPiece get_key() const
Definition: reservation_affinity.h:147
void clear_consume_reservation_type()
Definition: reservation_affinity.h:102