books  v1
download_access_restriction.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-03-14, 18:51:48 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Books API (books/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 114
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_BOOKS_API_DOWNLOAD_ACCESS_RESTRICTION_H_
31 #define GOOGLE_BOOKS_API_DOWNLOAD_ACCESS_RESTRICTION_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 namespace Json {
40 class Value;
41 } // namespace Json
42 
43 namespace google_books_api {
44 using namespace googleapis;
45 
51 class DownloadAccessRestriction : public client::JsonCppData {
52  public:
58  static DownloadAccessRestriction* New();
59 
65  explicit DownloadAccessRestriction(const Json::Value& storage);
66 
72  explicit DownloadAccessRestriction(Json::Value* storage);
73 
77  virtual ~DownloadAccessRestriction();
78 
84  const StringPiece GetTypeName() const {
85  return StringPiece("google_books_api::DownloadAccessRestriction");
86  }
87 
93  bool has_device_allowed() const {
94  return Storage().isMember("deviceAllowed");
95  }
96 
101  MutableStorage()->removeMember("deviceAllowed");
102  }
103 
104 
108  bool get_device_allowed() const {
109  const Json::Value& storage = Storage("deviceAllowed");
110  return client::JsonValueToCppValueHelper<bool >(storage);
111  }
112 
120  void set_device_allowed(bool value) {
121  client::SetJsonValueFromCppValueHelper<bool >(
122  value, MutableStorage("deviceAllowed"));
123  }
124 
130  bool has_downloads_acquired() const {
131  return Storage().isMember("downloadsAcquired");
132  }
133 
138  MutableStorage()->removeMember("downloadsAcquired");
139  }
140 
141 
145  int32 get_downloads_acquired() const {
146  const Json::Value& storage = Storage("downloadsAcquired");
147  return client::JsonValueToCppValueHelper<int32 >(storage);
148  }
149 
158  void set_downloads_acquired(int32 value) {
159  client::SetJsonValueFromCppValueHelper<int32 >(
160  value, MutableStorage("downloadsAcquired"));
161  }
162 
168  bool has_just_acquired() const {
169  return Storage().isMember("justAcquired");
170  }
171 
176  MutableStorage()->removeMember("justAcquired");
177  }
178 
179 
183  bool get_just_acquired() const {
184  const Json::Value& storage = Storage("justAcquired");
185  return client::JsonValueToCppValueHelper<bool >(storage);
186  }
187 
195  void set_just_acquired(bool value) {
196  client::SetJsonValueFromCppValueHelper<bool >(
197  value, MutableStorage("justAcquired"));
198  }
199 
205  bool has_kind() const {
206  return Storage().isMember("kind");
207  }
208 
212  void clear_kind() {
213  MutableStorage()->removeMember("kind");
214  }
215 
216 
220  const StringPiece get_kind() const {
221  const Json::Value& v = Storage("kind");
222  if (v == Json::Value::null) return StringPiece("");
223  return StringPiece(v.asCString());
224  }
225 
233  void set_kind(const StringPiece& value) {
234  *MutableStorage("kind") = value.data();
235  }
236 
243  return Storage().isMember("maxDownloadDevices");
244  }
245 
250  MutableStorage()->removeMember("maxDownloadDevices");
251  }
252 
253 
257  int32 get_max_download_devices() const {
258  const Json::Value& storage = Storage("maxDownloadDevices");
259  return client::JsonValueToCppValueHelper<int32 >(storage);
260  }
261 
270  void set_max_download_devices(int32 value) {
271  client::SetJsonValueFromCppValueHelper<int32 >(
272  value, MutableStorage("maxDownloadDevices"));
273  }
274 
280  bool has_message() const {
281  return Storage().isMember("message");
282  }
283 
287  void clear_message() {
288  MutableStorage()->removeMember("message");
289  }
290 
291 
295  const StringPiece get_message() const {
296  const Json::Value& v = Storage("message");
297  if (v == Json::Value::null) return StringPiece("");
298  return StringPiece(v.asCString());
299  }
300 
308  void set_message(const StringPiece& value) {
309  *MutableStorage("message") = value.data();
310  }
311 
317  bool has_nonce() const {
318  return Storage().isMember("nonce");
319  }
320 
324  void clear_nonce() {
325  MutableStorage()->removeMember("nonce");
326  }
327 
328 
332  const StringPiece get_nonce() const {
333  const Json::Value& v = Storage("nonce");
334  if (v == Json::Value::null) return StringPiece("");
335  return StringPiece(v.asCString());
336  }
337 
345  void set_nonce(const StringPiece& value) {
346  *MutableStorage("nonce") = value.data();
347  }
348 
354  bool has_reason_code() const {
355  return Storage().isMember("reasonCode");
356  }
357 
362  MutableStorage()->removeMember("reasonCode");
363  }
364 
365 
369  const StringPiece get_reason_code() const {
370  const Json::Value& v = Storage("reasonCode");
371  if (v == Json::Value::null) return StringPiece("");
372  return StringPiece(v.asCString());
373  }
374 
384  void set_reason_code(const StringPiece& value) {
385  *MutableStorage("reasonCode") = value.data();
386  }
387 
393  bool has_restricted() const {
394  return Storage().isMember("restricted");
395  }
396 
401  MutableStorage()->removeMember("restricted");
402  }
403 
404 
408  bool get_restricted() const {
409  const Json::Value& storage = Storage("restricted");
410  return client::JsonValueToCppValueHelper<bool >(storage);
411  }
412 
420  void set_restricted(bool value) {
421  client::SetJsonValueFromCppValueHelper<bool >(
422  value, MutableStorage("restricted"));
423  }
424 
430  bool has_signature() const {
431  return Storage().isMember("signature");
432  }
433 
438  MutableStorage()->removeMember("signature");
439  }
440 
441 
445  const StringPiece get_signature() const {
446  const Json::Value& v = Storage("signature");
447  if (v == Json::Value::null) return StringPiece("");
448  return StringPiece(v.asCString());
449  }
450 
458  void set_signature(const StringPiece& value) {
459  *MutableStorage("signature") = value.data();
460  }
461 
467  bool has_source() const {
468  return Storage().isMember("source");
469  }
470 
474  void clear_source() {
475  MutableStorage()->removeMember("source");
476  }
477 
478 
482  const StringPiece get_source() const {
483  const Json::Value& v = Storage("source");
484  if (v == Json::Value::null) return StringPiece("");
485  return StringPiece(v.asCString());
486  }
487 
496  void set_source(const StringPiece& value) {
497  *MutableStorage("source") = value.data();
498  }
499 
505  bool has_volume_id() const {
506  return Storage().isMember("volumeId");
507  }
508 
513  MutableStorage()->removeMember("volumeId");
514  }
515 
516 
520  const StringPiece get_volume_id() const {
521  const Json::Value& v = Storage("volumeId");
522  if (v == Json::Value::null) return StringPiece("");
523  return StringPiece(v.asCString());
524  }
525 
533  void set_volume_id(const StringPiece& value) {
534  *MutableStorage("volumeId") = value.data();
535  }
536 
537  private:
538  void operator=(const DownloadAccessRestriction&);
539 }; // DownloadAccessRestriction
540 } // namespace google_books_api
541 #endif // GOOGLE_BOOKS_API_DOWNLOAD_ACCESS_RESTRICTION_H_
bool has_volume_id() const
Definition: download_access_restriction.h:505
void set_downloads_acquired(int32 value)
Definition: download_access_restriction.h:158
void set_max_download_devices(int32 value)
Definition: download_access_restriction.h:270
void clear_downloads_acquired()
Definition: download_access_restriction.h:137
void set_just_acquired(bool value)
Definition: download_access_restriction.h:195
const StringPiece get_kind() const
Definition: download_access_restriction.h:220
void set_message(const StringPiece &value)
Definition: download_access_restriction.h:308
const StringPiece get_reason_code() const
Definition: download_access_restriction.h:369
bool has_restricted() const
Definition: download_access_restriction.h:393
const StringPiece get_message() const
Definition: download_access_restriction.h:295
const StringPiece get_source() const
Definition: download_access_restriction.h:482
void clear_kind()
Definition: download_access_restriction.h:212
void set_restricted(bool value)
Definition: download_access_restriction.h:420
const StringPiece GetTypeName() const
Definition: download_access_restriction.h:84
void clear_volume_id()
Definition: download_access_restriction.h:512
void set_device_allowed(bool value)
Definition: download_access_restriction.h:120
void clear_device_allowed()
Definition: download_access_restriction.h:100
bool has_signature() const
Definition: download_access_restriction.h:430
void clear_just_acquired()
Definition: download_access_restriction.h:175
bool get_device_allowed() const
Definition: download_access_restriction.h:108
int32 get_max_download_devices() const
Definition: download_access_restriction.h:257
bool has_nonce() const
Definition: download_access_restriction.h:317
void clear_reason_code()
Definition: download_access_restriction.h:361
void clear_restricted()
Definition: download_access_restriction.h:400
bool has_source() const
Definition: download_access_restriction.h:467
void set_volume_id(const StringPiece &value)
Definition: download_access_restriction.h:533
bool has_reason_code() const
Definition: download_access_restriction.h:354
bool get_restricted() const
Definition: download_access_restriction.h:408
void clear_source()
Definition: download_access_restriction.h:474
bool has_downloads_acquired() const
Definition: download_access_restriction.h:130
const StringPiece get_nonce() const
Definition: download_access_restriction.h:332
const StringPiece get_volume_id() const
Definition: download_access_restriction.h:520
void clear_message()
Definition: download_access_restriction.h:287
Definition: annotation.h:42
bool has_just_acquired() const
Definition: download_access_restriction.h:168
bool has_device_allowed() const
Definition: download_access_restriction.h:93
bool has_message() const
Definition: download_access_restriction.h:280
const StringPiece get_signature() const
Definition: download_access_restriction.h:445
bool has_max_download_devices() const
Definition: download_access_restriction.h:242
int32 get_downloads_acquired() const
Definition: download_access_restriction.h:145
Definition: annotation.cc:44
Definition: download_access_restriction.h:51
void clear_nonce()
Definition: download_access_restriction.h:324
void set_kind(const StringPiece &value)
Definition: download_access_restriction.h:233
void set_nonce(const StringPiece &value)
Definition: download_access_restriction.h:345
void set_signature(const StringPiece &value)
Definition: download_access_restriction.h:458
void clear_signature()
Definition: download_access_restriction.h:437
void set_source(const StringPiece &value)
Definition: download_access_restriction.h:496
bool get_just_acquired() const
Definition: download_access_restriction.h:183
void set_reason_code(const StringPiece &value)
Definition: download_access_restriction.h:384
void clear_max_download_devices()
Definition: download_access_restriction.h:249
bool has_kind() const
Definition: download_access_restriction.h:205