oauth2  v2
userinfo.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-23, 20:41:13 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 OAuth2 API (oauth2/v2)
24 // Generated from:
25 // Version: v2
26 // Revision: 157
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_OAUTH2_API_USERINFO_H_
31 #define GOOGLE_OAUTH2_API_USERINFO_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_oauth2_api {
43 using namespace googleapis;
44 
50 class Userinfo : public client::JsonCppData {
51  public:
57  static Userinfo* New();
58 
64  explicit Userinfo(const Json::Value& storage);
65 
71  explicit Userinfo(Json::Value* storage);
72 
76  virtual ~Userinfo();
77 
83  const StringPiece GetTypeName() const {
84  return StringPiece("google_oauth2_api::Userinfo");
85  }
86 
92  bool has_email() const {
93  return Storage().isMember("email");
94  }
95 
99  void clear_email() {
100  MutableStorage()->removeMember("email");
101  }
102 
103 
107  const StringPiece get_email() const {
108  const Json::Value& v = Storage("email");
109  if (v == Json::Value::null) return StringPiece("");
110  return StringPiece(v.asCString());
111  }
112 
120  void set_email(const StringPiece& value) {
121  *MutableStorage("email") = value.data();
122  }
123 
129  bool has_family_name() const {
130  return Storage().isMember("family_name");
131  }
132 
137  MutableStorage()->removeMember("family_name");
138  }
139 
140 
144  const StringPiece get_family_name() const {
145  const Json::Value& v = Storage("family_name");
146  if (v == Json::Value::null) return StringPiece("");
147  return StringPiece(v.asCString());
148  }
149 
157  void set_family_name(const StringPiece& value) {
158  *MutableStorage("family_name") = value.data();
159  }
160 
166  bool has_gender() const {
167  return Storage().isMember("gender");
168  }
169 
173  void clear_gender() {
174  MutableStorage()->removeMember("gender");
175  }
176 
177 
181  const StringPiece get_gender() const {
182  const Json::Value& v = Storage("gender");
183  if (v == Json::Value::null) return StringPiece("");
184  return StringPiece(v.asCString());
185  }
186 
194  void set_gender(const StringPiece& value) {
195  *MutableStorage("gender") = value.data();
196  }
197 
203  bool has_given_name() const {
204  return Storage().isMember("given_name");
205  }
206 
211  MutableStorage()->removeMember("given_name");
212  }
213 
214 
218  const StringPiece get_given_name() const {
219  const Json::Value& v = Storage("given_name");
220  if (v == Json::Value::null) return StringPiece("");
221  return StringPiece(v.asCString());
222  }
223 
231  void set_given_name(const StringPiece& value) {
232  *MutableStorage("given_name") = value.data();
233  }
234 
240  bool has_hd() const {
241  return Storage().isMember("hd");
242  }
243 
247  void clear_hd() {
248  MutableStorage()->removeMember("hd");
249  }
250 
251 
255  const StringPiece get_hd() const {
256  const Json::Value& v = Storage("hd");
257  if (v == Json::Value::null) return StringPiece("");
258  return StringPiece(v.asCString());
259  }
260 
268  void set_hd(const StringPiece& value) {
269  *MutableStorage("hd") = value.data();
270  }
271 
277  bool has_id() const {
278  return Storage().isMember("id");
279  }
280 
284  void clear_id() {
285  MutableStorage()->removeMember("id");
286  }
287 
288 
292  const StringPiece get_id() const {
293  const Json::Value& v = Storage("id");
294  if (v == Json::Value::null) return StringPiece("");
295  return StringPiece(v.asCString());
296  }
297 
305  void set_id(const StringPiece& value) {
306  *MutableStorage("id") = value.data();
307  }
308 
314  bool has_link() const {
315  return Storage().isMember("link");
316  }
317 
321  void clear_link() {
322  MutableStorage()->removeMember("link");
323  }
324 
325 
329  const StringPiece get_link() const {
330  const Json::Value& v = Storage("link");
331  if (v == Json::Value::null) return StringPiece("");
332  return StringPiece(v.asCString());
333  }
334 
342  void set_link(const StringPiece& value) {
343  *MutableStorage("link") = value.data();
344  }
345 
351  bool has_locale() const {
352  return Storage().isMember("locale");
353  }
354 
358  void clear_locale() {
359  MutableStorage()->removeMember("locale");
360  }
361 
362 
366  const StringPiece get_locale() const {
367  const Json::Value& v = Storage("locale");
368  if (v == Json::Value::null) return StringPiece("");
369  return StringPiece(v.asCString());
370  }
371 
379  void set_locale(const StringPiece& value) {
380  *MutableStorage("locale") = value.data();
381  }
382 
388  bool has_name() const {
389  return Storage().isMember("name");
390  }
391 
395  void clear_name() {
396  MutableStorage()->removeMember("name");
397  }
398 
399 
403  const StringPiece get_name() const {
404  const Json::Value& v = Storage("name");
405  if (v == Json::Value::null) return StringPiece("");
406  return StringPiece(v.asCString());
407  }
408 
416  void set_name(const StringPiece& value) {
417  *MutableStorage("name") = value.data();
418  }
419 
425  bool has_picture() const {
426  return Storage().isMember("picture");
427  }
428 
432  void clear_picture() {
433  MutableStorage()->removeMember("picture");
434  }
435 
436 
440  const StringPiece get_picture() const {
441  const Json::Value& v = Storage("picture");
442  if (v == Json::Value::null) return StringPiece("");
443  return StringPiece(v.asCString());
444  }
445 
453  void set_picture(const StringPiece& value) {
454  *MutableStorage("picture") = value.data();
455  }
456 
462  bool has_verified_email() const {
463  return Storage().isMember("verified_email");
464  }
465 
470  MutableStorage()->removeMember("verified_email");
471  }
472 
473 
477  bool get_verified_email() const {
478  const Json::Value& storage = Storage("verified_email");
479  return client::JsonValueToCppValueHelper<bool >(storage);
480  }
481 
490  void set_verified_email(bool value) {
491  client::SetJsonValueFromCppValueHelper<bool >(
492  value, MutableStorage("verified_email"));
493  }
494 
495  private:
496  void operator=(const Userinfo&);
497 }; // Userinfo
498 } // namespace google_oauth2_api
499 #endif // GOOGLE_OAUTH2_API_USERINFO_H_
void set_verified_email(bool value)
Definition: userinfo.h:490
void clear_locale()
Definition: userinfo.h:358
const StringPiece get_hd() const
Definition: userinfo.h:255
bool get_verified_email() const
Definition: userinfo.h:477
bool has_name() const
Definition: userinfo.h:388
const StringPiece GetTypeName() const
Definition: userinfo.h:83
const StringPiece get_family_name() const
Definition: userinfo.h:144
bool has_link() const
Definition: userinfo.h:314
bool has_hd() const
Definition: userinfo.h:240
void clear_picture()
Definition: userinfo.h:432
void clear_id()
Definition: userinfo.h:284
void clear_link()
Definition: userinfo.h:321
void set_email(const StringPiece &value)
Definition: userinfo.h:120
const StringPiece get_locale() const
Definition: userinfo.h:366
void clear_verified_email()
Definition: userinfo.h:469
void set_link(const StringPiece &value)
Definition: userinfo.h:342
bool has_gender() const
Definition: userinfo.h:166
void clear_family_name()
Definition: userinfo.h:136
const StringPiece get_picture() const
Definition: userinfo.h:440
bool has_locale() const
Definition: userinfo.h:351
void set_gender(const StringPiece &value)
Definition: userinfo.h:194
void set_family_name(const StringPiece &value)
Definition: userinfo.h:157
bool has_given_name() const
Definition: userinfo.h:203
void clear_given_name()
Definition: userinfo.h:210
void clear_gender()
Definition: userinfo.h:173
const StringPiece get_id() const
Definition: userinfo.h:292
void set_hd(const StringPiece &value)
Definition: userinfo.h:268
void set_id(const StringPiece &value)
Definition: userinfo.h:305
const StringPiece get_link() const
Definition: userinfo.h:329
const StringPiece get_email() const
Definition: userinfo.h:107
Definition: tokeninfo.h:39
bool has_verified_email() const
Definition: userinfo.h:462
void clear_email()
Definition: userinfo.h:99
void set_given_name(const StringPiece &value)
Definition: userinfo.h:231
const StringPiece get_given_name() const
Definition: userinfo.h:218
bool has_id() const
Definition: userinfo.h:277
void clear_name()
Definition: userinfo.h:395
const StringPiece get_gender() const
Definition: userinfo.h:181
bool has_picture() const
Definition: userinfo.h:425
Definition: userinfo.h:50
void clear_hd()
Definition: userinfo.h:247
bool has_family_name() const
Definition: userinfo.h:129
void set_name(const StringPiece &value)
Definition: userinfo.h:416
void set_locale(const StringPiece &value)
Definition: userinfo.h:379
Definition: oauth2_service.cc:40
const StringPiece get_name() const
Definition: userinfo.h:403
void set_picture(const StringPiece &value)
Definition: userinfo.h:453
bool has_email() const
Definition: userinfo.h:92