books  v1
metadata.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_METADATA_H_
31 #define GOOGLE_BOOKS_API_METADATA_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 Metadata : public client::JsonCppData {
52  public:
58  class MetadataItems : public client::JsonCppData {
59  public:
65  static MetadataItems* New();
66 
72  explicit MetadataItems(const Json::Value& storage);
73 
79  explicit MetadataItems(Json::Value* storage);
80 
84  virtual ~MetadataItems();
85 
91  const StringPiece GetTypeName() const {
92  return StringPiece("google_books_api::MetadataItems");
93  }
94 
100  bool has_download_url() const {
101  return Storage().isMember("download_url");
102  }
103 
108  MutableStorage()->removeMember("download_url");
109  }
110 
111 
115  const StringPiece get_download_url() const {
116  const Json::Value& v = Storage("download_url");
117  if (v == Json::Value::null) return StringPiece("");
118  return StringPiece(v.asCString());
119  }
120 
125  void set_download_url(const StringPiece& value) {
126  *MutableStorage("download_url") = value.data();
127  }
128 
134  bool has_encrypted_key() const {
135  return Storage().isMember("encrypted_key");
136  }
137 
142  MutableStorage()->removeMember("encrypted_key");
143  }
144 
145 
149  const StringPiece get_encrypted_key() const {
150  const Json::Value& v = Storage("encrypted_key");
151  if (v == Json::Value::null) return StringPiece("");
152  return StringPiece(v.asCString());
153  }
154 
159  void set_encrypted_key(const StringPiece& value) {
160  *MutableStorage("encrypted_key") = value.data();
161  }
162 
168  bool has_language() const {
169  return Storage().isMember("language");
170  }
171 
175  void clear_language() {
176  MutableStorage()->removeMember("language");
177  }
178 
179 
183  const StringPiece get_language() const {
184  const Json::Value& v = Storage("language");
185  if (v == Json::Value::null) return StringPiece("");
186  return StringPiece(v.asCString());
187  }
188 
193  void set_language(const StringPiece& value) {
194  *MutableStorage("language") = value.data();
195  }
196 
202  bool has_size() const {
203  return Storage().isMember("size");
204  }
205 
209  void clear_size() {
210  MutableStorage()->removeMember("size");
211  }
212 
213 
217  int64 get_size() const {
218  const Json::Value& storage = Storage("size");
219  return client::JsonValueToCppValueHelper<int64 >(storage);
220  }
221 
226  void set_size(int64 value) {
227  client::SetJsonValueFromCppValueHelper<int64 >(
228  value, MutableStorage("size"));
229  }
230 
236  bool has_version() const {
237  return Storage().isMember("version");
238  }
239 
243  void clear_version() {
244  MutableStorage()->removeMember("version");
245  }
246 
247 
251  int64 get_version() const {
252  const Json::Value& storage = Storage("version");
253  return client::JsonValueToCppValueHelper<int64 >(storage);
254  }
255 
260  void set_version(int64 value) {
261  client::SetJsonValueFromCppValueHelper<int64 >(
262  value, MutableStorage("version"));
263  }
264 
265  private:
266  void operator=(const MetadataItems&);
267  }; // MetadataItems
273  static Metadata* New();
274 
280  explicit Metadata(const Json::Value& storage);
281 
287  explicit Metadata(Json::Value* storage);
288 
292  virtual ~Metadata();
293 
299  const StringPiece GetTypeName() const {
300  return StringPiece("google_books_api::Metadata");
301  }
302 
308  bool has_items() const {
309  return Storage().isMember("items");
310  }
311 
315  void clear_items() {
316  MutableStorage()->removeMember("items");
317  }
318 
319 
323  const client::JsonCppArray<MetadataItems > get_items() const {
324  const Json::Value& storage = Storage("items");
325  return client::JsonValueToCppValueHelper<client::JsonCppArray<MetadataItems > >(storage);
326  }
327 
335  client::JsonCppArray<MetadataItems > mutable_items() {
336  Json::Value* storage = MutableStorage("items");
337  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<MetadataItems > >(storage);
338  }
339 
345  bool has_kind() const {
346  return Storage().isMember("kind");
347  }
348 
352  void clear_kind() {
353  MutableStorage()->removeMember("kind");
354  }
355 
356 
360  const StringPiece get_kind() const {
361  const Json::Value& v = Storage("kind");
362  if (v == Json::Value::null) return StringPiece("");
363  return StringPiece(v.asCString());
364  }
365 
373  void set_kind(const StringPiece& value) {
374  *MutableStorage("kind") = value.data();
375  }
376 
377  private:
378  void operator=(const Metadata&);
379 }; // Metadata
380 } // namespace google_books_api
381 #endif // GOOGLE_BOOKS_API_METADATA_H_
void clear_encrypted_key()
Definition: metadata.h:141
void clear_language()
Definition: metadata.h:175
bool has_size() const
Definition: metadata.h:202
const StringPiece get_encrypted_key() const
Definition: metadata.h:149
client::JsonCppArray< MetadataItems > mutable_items()
Definition: metadata.h:335
bool has_download_url() const
Definition: metadata.h:100
void clear_size()
Definition: metadata.h:209
bool has_version() const
Definition: metadata.h:236
void set_language(const StringPiece &value)
Definition: metadata.h:193
const StringPiece GetTypeName() const
Definition: metadata.h:299
Definition: metadata.h:51
void set_encrypted_key(const StringPiece &value)
Definition: metadata.h:159
const StringPiece get_kind() const
Definition: metadata.h:360
void set_size(int64 value)
Definition: metadata.h:226
void clear_version()
Definition: metadata.h:243
void clear_download_url()
Definition: metadata.h:107
const StringPiece GetTypeName() const
Definition: metadata.h:91
void clear_kind()
Definition: metadata.h:352
const client::JsonCppArray< MetadataItems > get_items() const
Definition: metadata.h:323
bool has_kind() const
Definition: metadata.h:345
int64 get_size() const
Definition: metadata.h:217
const StringPiece get_language() const
Definition: metadata.h:183
Definition: annotation.h:42
bool has_language() const
Definition: metadata.h:168
Definition: annotation.cc:44
void set_download_url(const StringPiece &value)
Definition: metadata.h:125
bool has_items() const
Definition: metadata.h:308
bool has_encrypted_key() const
Definition: metadata.h:134
void set_version(int64 value)
Definition: metadata.h:260
int64 get_version() const
Definition: metadata.h:251
void clear_items()
Definition: metadata.h:315
void set_kind(const StringPiece &value)
Definition: metadata.h:373
const StringPiece get_download_url() const
Definition: metadata.h:115