compute  v1
security_policy_rule.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_SECURITY_POLICY_RULE_H_
31 #define GOOGLE_COMPUTE_API_SECURITY_POLICY_RULE_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 #include "google/compute_api/security_policy_rule_matcher.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_compute_api {
46 using namespace googleapis;
47 
54 class SecurityPolicyRule : public client::JsonCppData {
55  public:
61  static SecurityPolicyRule* New();
62 
68  explicit SecurityPolicyRule(const Json::Value& storage);
69 
75  explicit SecurityPolicyRule(Json::Value* storage);
76 
80  virtual ~SecurityPolicyRule();
81 
87  const StringPiece GetTypeName() const {
88  return StringPiece("google_compute_api::SecurityPolicyRule");
89  }
90 
96  bool has_action() const {
97  return Storage().isMember("action");
98  }
99 
103  void clear_action() {
104  MutableStorage()->removeMember("action");
105  }
106 
107 
111  const StringPiece get_action() const {
112  const Json::Value& v = Storage("action");
113  if (v == Json::Value::null) return StringPiece("");
114  return StringPiece(v.asCString());
115  }
116 
126  void set_action(const StringPiece& value) {
127  *MutableStorage("action") = value.data();
128  }
129 
135  bool has_description() const {
136  return Storage().isMember("description");
137  }
138 
143  MutableStorage()->removeMember("description");
144  }
145 
146 
150  const StringPiece get_description() const {
151  const Json::Value& v = Storage("description");
152  if (v == Json::Value::null) return StringPiece("");
153  return StringPiece(v.asCString());
154  }
155 
164  void set_description(const StringPiece& value) {
165  *MutableStorage("description") = value.data();
166  }
167 
173  bool has_kind() const {
174  return Storage().isMember("kind");
175  }
176 
180  void clear_kind() {
181  MutableStorage()->removeMember("kind");
182  }
183 
184 
188  const StringPiece get_kind() const {
189  const Json::Value& v = Storage("kind");
190  if (v == Json::Value::null) return StringPiece("");
191  return StringPiece(v.asCString());
192  }
193 
202  void set_kind(const StringPiece& value) {
203  *MutableStorage("kind") = value.data();
204  }
205 
211  bool has_match() const {
212  return Storage().isMember("match");
213  }
214 
218  void clear_match() {
219  MutableStorage()->removeMember("match");
220  }
221 
222 
226  const SecurityPolicyRuleMatcher get_match() const;
227 
236  SecurityPolicyRuleMatcher mutable_match();
237 
243  bool has_preview() const {
244  return Storage().isMember("preview");
245  }
246 
250  void clear_preview() {
251  MutableStorage()->removeMember("preview");
252  }
253 
254 
258  bool get_preview() const {
259  const Json::Value& storage = Storage("preview");
260  return client::JsonValueToCppValueHelper<bool >(storage);
261  }
262 
270  void set_preview(bool value) {
271  client::SetJsonValueFromCppValueHelper<bool >(
272  value, MutableStorage("preview"));
273  }
274 
280  bool has_priority() const {
281  return Storage().isMember("priority");
282  }
283 
287  void clear_priority() {
288  MutableStorage()->removeMember("priority");
289  }
290 
291 
295  int32 get_priority() const {
296  const Json::Value& storage = Storage("priority");
297  return client::JsonValueToCppValueHelper<int32 >(storage);
298  }
299 
310  void set_priority(int32 value) {
311  client::SetJsonValueFromCppValueHelper<int32 >(
312  value, MutableStorage("priority"));
313  }
314 
315  private:
316  void operator=(const SecurityPolicyRule&);
317 }; // SecurityPolicyRule
318 } // namespace google_compute_api
319 #endif // GOOGLE_COMPUTE_API_SECURITY_POLICY_RULE_H_
void set_preview(bool value)
Definition: security_policy_rule.h:270
bool has_preview() const
Definition: security_policy_rule.h:243
void clear_preview()
Definition: security_policy_rule.h:250
void set_action(const StringPiece &value)
Definition: security_policy_rule.h:126
Definition: security_policy_rule.h:54
int32 get_priority() const
Definition: security_policy_rule.h:295
void clear_description()
Definition: security_policy_rule.h:142
void clear_kind()
Definition: security_policy_rule.h:180
void clear_match()
Definition: security_policy_rule.h:218
bool get_preview() const
Definition: security_policy_rule.h:258
void clear_action()
Definition: security_policy_rule.h:103
void set_description(const StringPiece &value)
Definition: security_policy_rule.h:164
bool has_action() const
Definition: security_policy_rule.h:96
const StringPiece get_description() const
Definition: security_policy_rule.h:150
const StringPiece GetTypeName() const
Definition: security_policy_rule.h:87
Definition: accelerator_config.h:39
void clear_priority()
Definition: security_policy_rule.h:287
void set_kind(const StringPiece &value)
Definition: security_policy_rule.h:202
const StringPiece get_action() const
Definition: security_policy_rule.h:111
bool has_priority() const
Definition: security_policy_rule.h:280
Definition: accelerator_config.cc:41
Definition: security_policy_rule_matcher.h:53
bool has_match() const
Definition: security_policy_rule.h:211
bool has_kind() const
Definition: security_policy_rule.h:173
void set_priority(int32 value)
Definition: security_policy_rule.h:310
const StringPiece get_kind() const
Definition: security_policy_rule.h:188
bool has_description() const
Definition: security_policy_rule.h:135