30 #ifndef GOOGLE_COMPUTE_API_NAMED_PORT_H_ 31 #define GOOGLE_COMPUTE_API_NAMED_PORT_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" 65 explicit NamedPort(
const Json::Value& storage);
85 return StringPiece(
"google_compute_api::NamedPort");
94 return Storage().isMember(
"name");
101 MutableStorage()->removeMember(
"name");
109 const Json::Value& v = Storage(
"name");
110 if (v == Json::Value::null)
return StringPiece(
"");
111 return StringPiece(v.asCString());
123 *MutableStorage(
"name") = value.data();
132 return Storage().isMember(
"port");
139 MutableStorage()->removeMember(
"port");
147 const Json::Value& storage = Storage(
"port");
148 return client::JsonValueToCppValueHelper<int32 >(storage);
159 client::SetJsonValueFromCppValueHelper<int32 >(
160 value, MutableStorage(
"port"));
167 #endif // GOOGLE_COMPUTE_API_NAMED_PORT_H_ void set_name(const StringPiece &value)
Definition: named_port.h:122
void clear_port()
Definition: named_port.h:138
const StringPiece GetTypeName() const
Definition: named_port.h:84
bool has_name() const
Definition: named_port.h:93
void set_port(int32 value)
Definition: named_port.h:158
const StringPiece get_name() const
Definition: named_port.h:108
Definition: accelerator_config.h:39
Definition: named_port.h:51
Definition: accelerator_config.cc:41
void clear_name()
Definition: named_port.h:100
bool has_port() const
Definition: named_port.h:131
int32 get_port() const
Definition: named_port.h:146