30 #ifndef GOOGLE_COMPUTE_API_BACKEND_H_ 31 #define GOOGLE_COMPUTE_API_BACKEND_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" 51 class Backend :
public client::JsonCppData {
65 explicit Backend(
const Json::Value& storage);
72 explicit Backend(Json::Value* storage);
85 return StringPiece(
"google_compute_api::Backend");
94 return Storage().isMember(
"balancingMode");
101 MutableStorage()->removeMember(
"balancingMode");
109 const Json::Value& v = Storage(
"balancingMode");
110 if (v == Json::Value::null)
return StringPiece(
"");
111 return StringPiece(v.asCString());
127 *MutableStorage(
"balancingMode") = value.data();
136 return Storage().isMember(
"capacityScaler");
143 MutableStorage()->removeMember(
"capacityScaler");
151 const Json::Value& storage = Storage(
"capacityScaler");
152 return client::JsonValueToCppValueHelper<float >(storage);
169 client::SetJsonValueFromCppValueHelper<float >(
170 value, MutableStorage(
"capacityScaler"));
179 return Storage().isMember(
"description");
186 MutableStorage()->removeMember(
"description");
194 const Json::Value& v = Storage(
"description");
195 if (v == Json::Value::null)
return StringPiece(
"");
196 return StringPiece(v.asCString());
208 *MutableStorage(
"description") = value.data();
217 return Storage().isMember(
"group");
224 MutableStorage()->removeMember(
"group");
232 const Json::Value& v = Storage(
"group");
233 if (v == Json::Value::null)
return StringPiece(
"");
234 return StringPiece(v.asCString());
263 *MutableStorage(
"group") = value.data();
272 return Storage().isMember(
"maxConnections");
279 MutableStorage()->removeMember(
"maxConnections");
287 const Json::Value& storage = Storage(
"maxConnections");
288 return client::JsonValueToCppValueHelper<int32 >(storage);
303 client::SetJsonValueFromCppValueHelper<int32 >(
304 value, MutableStorage(
"maxConnections"));
315 return Storage().isMember(
"maxConnectionsPerEndpoint");
322 MutableStorage()->removeMember(
"maxConnectionsPerEndpoint");
330 const Json::Value& storage = Storage(
"maxConnectionsPerEndpoint");
331 return client::JsonValueToCppValueHelper<int32 >(storage);
348 client::SetJsonValueFromCppValueHelper<int32 >(
349 value, MutableStorage(
"maxConnectionsPerEndpoint"));
360 return Storage().isMember(
"maxConnectionsPerInstance");
367 MutableStorage()->removeMember(
"maxConnectionsPerInstance");
375 const Json::Value& storage = Storage(
"maxConnectionsPerInstance");
376 return client::JsonValueToCppValueHelper<int32 >(storage);
392 client::SetJsonValueFromCppValueHelper<int32 >(
393 value, MutableStorage(
"maxConnectionsPerInstance"));
402 return Storage().isMember(
"maxRate");
409 MutableStorage()->removeMember(
"maxRate");
417 const Json::Value& storage = Storage(
"maxRate");
418 return client::JsonValueToCppValueHelper<int32 >(storage);
433 client::SetJsonValueFromCppValueHelper<int32 >(
434 value, MutableStorage(
"maxRate"));
443 return Storage().isMember(
"maxRatePerEndpoint");
450 MutableStorage()->removeMember(
"maxRatePerEndpoint");
458 const Json::Value& storage = Storage(
"maxRatePerEndpoint");
459 return client::JsonValueToCppValueHelper<float >(storage);
475 client::SetJsonValueFromCppValueHelper<float >(
476 value, MutableStorage(
"maxRatePerEndpoint"));
485 return Storage().isMember(
"maxRatePerInstance");
492 MutableStorage()->removeMember(
"maxRatePerInstance");
500 const Json::Value& storage = Storage(
"maxRatePerInstance");
501 return client::JsonValueToCppValueHelper<float >(storage);
517 client::SetJsonValueFromCppValueHelper<float >(
518 value, MutableStorage(
"maxRatePerInstance"));
527 return Storage().isMember(
"maxUtilization");
534 MutableStorage()->removeMember(
"maxUtilization");
542 const Json::Value& storage = Storage(
"maxUtilization");
543 return client::JsonValueToCppValueHelper<float >(storage);
558 client::SetJsonValueFromCppValueHelper<float >(
559 value, MutableStorage(
"maxUtilization"));
563 void operator=(
const Backend&);
566 #endif // GOOGLE_COMPUTE_API_BACKEND_H_ void set_max_rate_per_instance(float value)
Definition: backend.h:516
void clear_max_connections()
Definition: backend.h:278
void set_max_connections(int32 value)
Definition: backend.h:302
bool has_balancing_mode() const
Definition: backend.h:93
void set_max_connections_per_instance(int32 value)
Definition: backend.h:391
void set_max_rate_per_endpoint(float value)
Definition: backend.h:474
void set_max_utilization(float value)
Definition: backend.h:557
int32 get_max_rate() const
Definition: backend.h:416
const StringPiece get_balancing_mode() const
Definition: backend.h:108
void set_group(const StringPiece &value)
Definition: backend.h:262
bool has_description() const
Definition: backend.h:178
const StringPiece get_description() const
Definition: backend.h:193
void clear_group()
Definition: backend.h:223
int32 get_max_connections() const
Definition: backend.h:286
void clear_capacity_scaler()
Definition: backend.h:142
const StringPiece GetTypeName() const
Definition: backend.h:84
void set_capacity_scaler(float value)
Definition: backend.h:168
void clear_max_rate()
Definition: backend.h:408
bool has_max_connections_per_instance() const
Definition: backend.h:359
void set_max_rate(int32 value)
Definition: backend.h:432
bool has_max_rate_per_instance() const
Definition: backend.h:484
void set_max_connections_per_endpoint(int32 value)
Definition: backend.h:347
void clear_balancing_mode()
Definition: backend.h:100
void clear_max_connections_per_endpoint()
Definition: backend.h:321
bool has_max_utilization() const
Definition: backend.h:526
void clear_max_utilization()
Definition: backend.h:533
int32 get_max_connections_per_endpoint() const
Definition: backend.h:329
Definition: accelerator_config.h:39
const StringPiece get_group() const
Definition: backend.h:231
void clear_max_rate_per_instance()
Definition: backend.h:491
void clear_max_rate_per_endpoint()
Definition: backend.h:449
bool has_max_connections() const
Definition: backend.h:271
Definition: accelerator_config.cc:41
void clear_description()
Definition: backend.h:185
void set_balancing_mode(const StringPiece &value)
Definition: backend.h:126
bool has_max_rate_per_endpoint() const
Definition: backend.h:442
int32 get_max_connections_per_instance() const
Definition: backend.h:374
bool has_max_rate() const
Definition: backend.h:401
float get_max_rate_per_instance() const
Definition: backend.h:499
bool has_capacity_scaler() const
Definition: backend.h:135
bool has_max_connections_per_endpoint() const
Definition: backend.h:314
void clear_max_connections_per_instance()
Definition: backend.h:366
float get_max_utilization() const
Definition: backend.h:541
float get_capacity_scaler() const
Definition: backend.h:150
float get_max_rate_per_endpoint() const
Definition: backend.h:457
bool has_group() const
Definition: backend.h:216
void set_description(const StringPiece &value)
Definition: backend.h:207