dns  v1
dns_key.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_DNS_KEY_H_
31 #define GOOGLE_DNS_API_DNS_KEY_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/dns_key_digest.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_dns_api {
46 using namespace googleapis;
47 
53 class DnsKey : public client::JsonCppData {
54  public:
60  static DnsKey* New();
61 
67  explicit DnsKey(const Json::Value& storage);
68 
74  explicit DnsKey(Json::Value* storage);
75 
79  virtual ~DnsKey();
80 
86  const StringPiece GetTypeName() const {
87  return StringPiece("google_dns_api::DnsKey");
88  }
89 
95  bool has_algorithm() const {
96  return Storage().isMember("algorithm");
97  }
98 
103  MutableStorage()->removeMember("algorithm");
104  }
105 
106 
110  const StringPiece get_algorithm() const {
111  const Json::Value& v = Storage("algorithm");
112  if (v == Json::Value::null) return StringPiece("");
113  return StringPiece(v.asCString());
114  }
115 
124  void set_algorithm(const StringPiece& value) {
125  *MutableStorage("algorithm") = value.data();
126  }
127 
133  bool has_creation_time() const {
134  return Storage().isMember("creationTime");
135  }
136 
141  MutableStorage()->removeMember("creationTime");
142  }
143 
144 
148  const StringPiece get_creation_time() const {
149  const Json::Value& v = Storage("creationTime");
150  if (v == Json::Value::null) return StringPiece("");
151  return StringPiece(v.asCString());
152  }
153 
162  void set_creation_time(const StringPiece& value) {
163  *MutableStorage("creationTime") = value.data();
164  }
165 
171  bool has_description() const {
172  return Storage().isMember("description");
173  }
174 
179  MutableStorage()->removeMember("description");
180  }
181 
182 
186  const StringPiece get_description() const {
187  const Json::Value& v = Storage("description");
188  if (v == Json::Value::null) return StringPiece("");
189  return StringPiece(v.asCString());
190  }
191 
200  void set_description(const StringPiece& value) {
201  *MutableStorage("description") = value.data();
202  }
203 
209  bool has_digests() const {
210  return Storage().isMember("digests");
211  }
212 
216  void clear_digests() {
217  MutableStorage()->removeMember("digests");
218  }
219 
220 
224  const client::JsonCppArray<DnsKeyDigest > get_digests() const;
225 
235  client::JsonCppArray<DnsKeyDigest > mutable_digests();
236 
242  bool has_id() const {
243  return Storage().isMember("id");
244  }
245 
249  void clear_id() {
250  MutableStorage()->removeMember("id");
251  }
252 
253 
257  const StringPiece get_id() const {
258  const Json::Value& v = Storage("id");
259  if (v == Json::Value::null) return StringPiece("");
260  return StringPiece(v.asCString());
261  }
262 
270  void set_id(const StringPiece& value) {
271  *MutableStorage("id") = value.data();
272  }
273 
279  bool has_is_active() const {
280  return Storage().isMember("isActive");
281  }
282 
287  MutableStorage()->removeMember("isActive");
288  }
289 
290 
294  bool get_is_active() const {
295  const Json::Value& storage = Storage("isActive");
296  return client::JsonValueToCppValueHelper<bool >(storage);
297  }
298 
308  void set_is_active(bool value) {
309  client::SetJsonValueFromCppValueHelper<bool >(
310  value, MutableStorage("isActive"));
311  }
312 
318  bool has_key_length() const {
319  return Storage().isMember("keyLength");
320  }
321 
326  MutableStorage()->removeMember("keyLength");
327  }
328 
329 
333  uint32 get_key_length() const {
334  const Json::Value& storage = Storage("keyLength");
335  return client::JsonValueToCppValueHelper<uint32 >(storage);
336  }
337 
345  void set_key_length(uint32 value) {
346  client::SetJsonValueFromCppValueHelper<uint32 >(
347  value, MutableStorage("keyLength"));
348  }
349 
355  bool has_key_tag() const {
356  return Storage().isMember("keyTag");
357  }
358 
362  void clear_key_tag() {
363  MutableStorage()->removeMember("keyTag");
364  }
365 
366 
370  int32 get_key_tag() const {
371  const Json::Value& storage = Storage("keyTag");
372  return client::JsonValueToCppValueHelper<int32 >(storage);
373  }
374 
387  void set_key_tag(int32 value) {
388  client::SetJsonValueFromCppValueHelper<int32 >(
389  value, MutableStorage("keyTag"));
390  }
391 
397  bool has_kind() const {
398  return Storage().isMember("kind");
399  }
400 
404  void clear_kind() {
405  MutableStorage()->removeMember("kind");
406  }
407 
408 
412  const StringPiece get_kind() const {
413  const Json::Value& v = Storage("kind");
414  if (v == Json::Value::null) return StringPiece("");
415  return StringPiece(v.asCString());
416  }
417 
426  void set_kind(const StringPiece& value) {
427  *MutableStorage("kind") = value.data();
428  }
429 
435  bool has_public_key() const {
436  return Storage().isMember("publicKey");
437  }
438 
443  MutableStorage()->removeMember("publicKey");
444  }
445 
446 
450  const StringPiece get_public_key() const {
451  const Json::Value& v = Storage("publicKey");
452  if (v == Json::Value::null) return StringPiece("");
453  return StringPiece(v.asCString());
454  }
455 
463  void set_public_key(const StringPiece& value) {
464  *MutableStorage("publicKey") = value.data();
465  }
466 
472  bool has_type() const {
473  return Storage().isMember("type");
474  }
475 
479  void clear_type() {
480  MutableStorage()->removeMember("type");
481  }
482 
483 
487  const StringPiece get_type() const {
488  const Json::Value& v = Storage("type");
489  if (v == Json::Value::null) return StringPiece("");
490  return StringPiece(v.asCString());
491  }
492 
504  void set_type(const StringPiece& value) {
505  *MutableStorage("type") = value.data();
506  }
507 
508  private:
509  void operator=(const DnsKey&);
510 }; // DnsKey
511 } // namespace google_dns_api
512 #endif // GOOGLE_DNS_API_DNS_KEY_H_
bool has_key_tag() const
Definition: dns_key.h:355
void clear_key_tag()
Definition: dns_key.h:362
bool has_key_length() const
Definition: dns_key.h:318
const StringPiece get_public_key() const
Definition: dns_key.h:450
int32 get_key_tag() const
Definition: dns_key.h:370
bool has_description() const
Definition: dns_key.h:171
void set_description(const StringPiece &value)
Definition: dns_key.h:200
const StringPiece get_id() const
Definition: dns_key.h:257
void clear_description()
Definition: dns_key.h:178
bool has_creation_time() const
Definition: dns_key.h:133
bool has_is_active() const
Definition: dns_key.h:279
void set_key_tag(int32 value)
Definition: dns_key.h:387
bool has_type() const
Definition: dns_key.h:472
void clear_kind()
Definition: dns_key.h:404
bool has_digests() const
Definition: dns_key.h:209
void clear_creation_time()
Definition: dns_key.h:140
bool has_id() const
Definition: dns_key.h:242
void set_creation_time(const StringPiece &value)
Definition: dns_key.h:162
bool has_public_key() const
Definition: dns_key.h:435
void set_is_active(bool value)
Definition: dns_key.h:308
void set_public_key(const StringPiece &value)
Definition: dns_key.h:463
Definition: dns_key.h:53
bool has_kind() const
Definition: dns_key.h:397
void set_id(const StringPiece &value)
Definition: dns_key.h:270
bool has_algorithm() const
Definition: dns_key.h:95
void set_algorithm(const StringPiece &value)
Definition: dns_key.h:124
void set_kind(const StringPiece &value)
Definition: dns_key.h:426
void clear_digests()
Definition: dns_key.h:216
const StringPiece GetTypeName() const
Definition: dns_key.h:86
void clear_public_key()
Definition: dns_key.h:442
Definition: change.h:40
void set_key_length(uint32 value)
Definition: dns_key.h:345
void clear_id()
Definition: dns_key.h:249
void set_type(const StringPiece &value)
Definition: dns_key.h:504
bool get_is_active() const
Definition: dns_key.h:294
uint32 get_key_length() const
Definition: dns_key.h:333
const StringPiece get_algorithm() const
Definition: dns_key.h:110
void clear_algorithm()
Definition: dns_key.h:102
void clear_is_active()
Definition: dns_key.h:286
const StringPiece get_type() const
Definition: dns_key.h:487
const StringPiece get_description() const
Definition: dns_key.h:186
void clear_type()
Definition: dns_key.h:479
void clear_key_length()
Definition: dns_key.h:325
Definition: change.cc:42
const StringPiece get_kind() const
Definition: dns_key.h:412
const StringPiece get_creation_time() const
Definition: dns_key.h:148