dns  v1
policy.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-01-29, 22:13:38 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Google Cloud DNS API (dns/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 112
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_DNS_API_POLICY_H_
31 #define GOOGLE_DNS_API_POLICY_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/dns_api/policy_alternative_name_server_config.h"
40 #include "google/dns_api/policy_network.h"
41 
42 namespace Json {
43 class Value;
44 } // namespace Json
45 
46 namespace google_dns_api {
47 using namespace googleapis;
48 
55 class Policy : public client::JsonCppData {
56  public:
62  static Policy* New();
63 
69  explicit Policy(const Json::Value& storage);
70 
76  explicit Policy(Json::Value* storage);
77 
81  virtual ~Policy();
82 
88  const StringPiece GetTypeName() const {
89  return StringPiece("google_dns_api::Policy");
90  }
91 
100  return Storage().isMember("alternativeNameServerConfig");
101  }
102 
107  MutableStorage()->removeMember("alternativeNameServerConfig");
108  }
109 
110 
115  const PolicyAlternativeNameServerConfig get_alternative_name_server_config() const;
116 
128  PolicyAlternativeNameServerConfig mutable_alternativeNameServerConfig();
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 
175  return Storage().isMember("enableInboundForwarding");
176  }
177 
182  MutableStorage()->removeMember("enableInboundForwarding");
183  }
184 
185 
190  const Json::Value& storage = Storage("enableInboundForwarding");
191  return client::JsonValueToCppValueHelper<bool >(storage);
192  }
193 
203  void set_enable_inbound_forwarding(bool value) {
204  client::SetJsonValueFromCppValueHelper<bool >(
205  value, MutableStorage("enableInboundForwarding"));
206  }
207 
213  bool has_enable_logging() const {
214  return Storage().isMember("enableLogging");
215  }
216 
221  MutableStorage()->removeMember("enableLogging");
222  }
223 
224 
228  bool get_enable_logging() const {
229  const Json::Value& storage = Storage("enableLogging");
230  return client::JsonValueToCppValueHelper<bool >(storage);
231  }
232 
241  void set_enable_logging(bool value) {
242  client::SetJsonValueFromCppValueHelper<bool >(
243  value, MutableStorage("enableLogging"));
244  }
245 
251  bool has_id() const {
252  return Storage().isMember("id");
253  }
254 
258  void clear_id() {
259  MutableStorage()->removeMember("id");
260  }
261 
262 
266  uint64 get_id() const {
267  const Json::Value& storage = Storage("id");
268  return client::JsonValueToCppValueHelper<uint64 >(storage);
269  }
270 
278  void set_id(uint64 value) {
279  client::SetJsonValueFromCppValueHelper<uint64 >(
280  value, MutableStorage("id"));
281  }
282 
288  bool has_kind() const {
289  return Storage().isMember("kind");
290  }
291 
295  void clear_kind() {
296  MutableStorage()->removeMember("kind");
297  }
298 
299 
303  const StringPiece get_kind() const {
304  const Json::Value& v = Storage("kind");
305  if (v == Json::Value::null) return StringPiece("");
306  return StringPiece(v.asCString());
307  }
308 
317  void set_kind(const StringPiece& value) {
318  *MutableStorage("kind") = value.data();
319  }
320 
326  bool has_name() const {
327  return Storage().isMember("name");
328  }
329 
333  void clear_name() {
334  MutableStorage()->removeMember("name");
335  }
336 
337 
341  const StringPiece get_name() const {
342  const Json::Value& v = Storage("name");
343  if (v == Json::Value::null) return StringPiece("");
344  return StringPiece(v.asCString());
345  }
346 
354  void set_name(const StringPiece& value) {
355  *MutableStorage("name") = value.data();
356  }
357 
363  bool has_networks() const {
364  return Storage().isMember("networks");
365  }
366 
370  void clear_networks() {
371  MutableStorage()->removeMember("networks");
372  }
373 
374 
378  const client::JsonCppArray<PolicyNetwork > get_networks() const;
379 
388  client::JsonCppArray<PolicyNetwork > mutable_networks();
389 
390  private:
391  void operator=(const Policy&);
392 }; // Policy
393 } // namespace google_dns_api
394 #endif // GOOGLE_DNS_API_POLICY_H_
bool has_kind() const
Definition: policy.h:288
bool get_enable_inbound_forwarding() const
Definition: policy.h:189
bool has_id() const
Definition: policy.h:251
void clear_name()
Definition: policy.h:333
void clear_kind()
Definition: policy.h:295
void set_enable_logging(bool value)
Definition: policy.h:241
void set_description(const StringPiece &value)
Definition: policy.h:164
Definition: policy_alternative_name_server_config.h:52
void clear_alternative_name_server_config()
Definition: policy.h:106
bool has_description() const
Definition: policy.h:135
Definition: policy.h:55
Definition: change.h:40
const StringPiece get_description() const
Definition: policy.h:150
void clear_enable_logging()
Definition: policy.h:220
uint64 get_id() const
Definition: policy.h:266
bool has_enable_inbound_forwarding() const
Definition: policy.h:174
void set_kind(const StringPiece &value)
Definition: policy.h:317
void set_id(uint64 value)
Definition: policy.h:278
const StringPiece GetTypeName() const
Definition: policy.h:88
const StringPiece get_kind() const
Definition: policy.h:303
bool has_alternative_name_server_config() const
Definition: policy.h:99
bool has_enable_logging() const
Definition: policy.h:213
bool has_networks() const
Definition: policy.h:363
void set_name(const StringPiece &value)
Definition: policy.h:354
bool has_name() const
Definition: policy.h:326
Definition: change.cc:42
void set_enable_inbound_forwarding(bool value)
Definition: policy.h:203
void clear_enable_inbound_forwarding()
Definition: policy.h:181
void clear_description()
Definition: policy.h:142
bool get_enable_logging() const
Definition: policy.h:228
void clear_id()
Definition: policy.h:258
void clear_networks()
Definition: policy.h:370
const StringPiece get_name() const
Definition: policy.h:341