drive  v2
user.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-19, 05:24:40 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Drive API (drive/v2)
24 // Generated from:
25 // Version: v2
26 // Revision: 393
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_DRIVE_API_USER_H_
31 #define GOOGLE_DRIVE_API_USER_H_
32 
33 #include <string>
34 #include "googleapis/base/macros.h"
35 #include "googleapis/client/data/jsoncpp_data.h"
36 #include "googleapis/strings/stringpiece.h"
37 
38 namespace Json {
39 class Value;
40 } // namespace Json
41 
42 namespace google_drive_api {
43 using namespace googleapis;
44 
50 class User : public client::JsonCppData {
51  public:
57  class UserPicture : public client::JsonCppData {
58  public:
64  static UserPicture* New();
65 
71  explicit UserPicture(const Json::Value& storage);
72 
78  explicit UserPicture(Json::Value* storage);
79 
83  virtual ~UserPicture();
84 
90  const StringPiece GetTypeName() const {
91  return StringPiece("google_drive_api::UserPicture");
92  }
93 
99  bool has_url() const {
100  return Storage().isMember("url");
101  }
102 
106  void clear_url() {
107  MutableStorage()->removeMember("url");
108  }
109 
110 
114  const StringPiece get_url() const {
115  const Json::Value& v = Storage("url");
116  if (v == Json::Value::null) return StringPiece("");
117  return StringPiece(v.asCString());
118  }
119 
127  void set_url(const StringPiece& value) {
128  *MutableStorage("url") = value.data();
129  }
130 
131  private:
132  void operator=(const UserPicture&);
133  }; // UserPicture
139  static User* New();
140 
146  explicit User(const Json::Value& storage);
147 
153  explicit User(Json::Value* storage);
154 
158  virtual ~User();
159 
165  const StringPiece GetTypeName() const {
166  return StringPiece("google_drive_api::User");
167  }
168 
174  bool has_display_name() const {
175  return Storage().isMember("displayName");
176  }
177 
182  MutableStorage()->removeMember("displayName");
183  }
184 
185 
189  const StringPiece get_display_name() const {
190  const Json::Value& v = Storage("displayName");
191  if (v == Json::Value::null) return StringPiece("");
192  return StringPiece(v.asCString());
193  }
194 
202  void set_display_name(const StringPiece& value) {
203  *MutableStorage("displayName") = value.data();
204  }
205 
211  bool has_email_address() const {
212  return Storage().isMember("emailAddress");
213  }
214 
219  MutableStorage()->removeMember("emailAddress");
220  }
221 
222 
226  const StringPiece get_email_address() const {
227  const Json::Value& v = Storage("emailAddress");
228  if (v == Json::Value::null) return StringPiece("");
229  return StringPiece(v.asCString());
230  }
231 
239  void set_email_address(const StringPiece& value) {
240  *MutableStorage("emailAddress") = value.data();
241  }
242 
249  return Storage().isMember("isAuthenticatedUser");
250  }
251 
256  MutableStorage()->removeMember("isAuthenticatedUser");
257  }
258 
259 
264  const Json::Value& storage = Storage("isAuthenticatedUser");
265  return client::JsonValueToCppValueHelper<bool >(storage);
266  }
267 
276  void set_is_authenticated_user(bool value) {
277  client::SetJsonValueFromCppValueHelper<bool >(
278  value, MutableStorage("isAuthenticatedUser"));
279  }
280 
286  bool has_kind() const {
287  return Storage().isMember("kind");
288  }
289 
293  void clear_kind() {
294  MutableStorage()->removeMember("kind");
295  }
296 
297 
301  const StringPiece get_kind() const {
302  const Json::Value& v = Storage("kind");
303  if (v == Json::Value::null) return StringPiece("");
304  return StringPiece(v.asCString());
305  }
306 
314  void set_kind(const StringPiece& value) {
315  *MutableStorage("kind") = value.data();
316  }
317 
323  bool has_permission_id() const {
324  return Storage().isMember("permissionId");
325  }
326 
331  MutableStorage()->removeMember("permissionId");
332  }
333 
334 
338  const StringPiece get_permission_id() const {
339  const Json::Value& v = Storage("permissionId");
340  if (v == Json::Value::null) return StringPiece("");
341  return StringPiece(v.asCString());
342  }
343 
351  void set_permission_id(const StringPiece& value) {
352  *MutableStorage("permissionId") = value.data();
353  }
354 
360  bool has_picture() const {
361  return Storage().isMember("picture");
362  }
363 
367  void clear_picture() {
368  MutableStorage()->removeMember("picture");
369  }
370 
371 
375  const UserPicture get_picture() const {
376  const Json::Value& storage = Storage("picture");
377  return client::JsonValueToCppValueHelper<UserPicture >(storage);
378  }
379 
388  Json::Value* storage = MutableStorage("picture");
389  return client::JsonValueToMutableCppValueHelper<UserPicture >(storage);
390  }
391 
392  private:
393  void operator=(const User&);
394 }; // User
395 } // namespace google_drive_api
396 #endif // GOOGLE_DRIVE_API_USER_H_
bool has_permission_id() const
Definition: user.h:323
void clear_email_address()
Definition: user.h:218
void clear_url()
Definition: user.h:106
const StringPiece get_url() const
Definition: user.h:114
void set_display_name(const StringPiece &value)
Definition: user.h:202
Definition: user.h:50
void set_permission_id(const StringPiece &value)
Definition: user.h:351
void clear_kind()
Definition: user.h:293
void clear_picture()
Definition: user.h:367
const StringPiece get_email_address() const
Definition: user.h:226
void clear_is_authenticated_user()
Definition: user.h:255
bool has_email_address() const
Definition: user.h:211
void set_kind(const StringPiece &value)
Definition: user.h:314
void set_is_authenticated_user(bool value)
Definition: user.h:276
void set_url(const StringPiece &value)
Definition: user.h:127
bool has_url() const
Definition: user.h:99
Definition: about.h:41
bool get_is_authenticated_user() const
Definition: user.h:263
void clear_display_name()
Definition: user.h:181
void clear_permission_id()
Definition: user.h:330
UserPicture mutable_picture()
Definition: user.h:387
const StringPiece GetTypeName() const
Definition: user.h:165
void set_email_address(const StringPiece &value)
Definition: user.h:239
const StringPiece get_display_name() const
Definition: user.h:189
const StringPiece get_kind() const
Definition: user.h:301
bool has_picture() const
Definition: user.h:360
const UserPicture get_picture() const
Definition: user.h:375
bool has_kind() const
Definition: user.h:286
const StringPiece GetTypeName() const
Definition: user.h:90
bool has_display_name() const
Definition: user.h:174
bool has_is_authenticated_user() const
Definition: user.h:248
Definition: about.cc:43
const StringPiece get_permission_id() const
Definition: user.h:338