oauth2  v2
tokeninfo.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_TOKENINFO_H_
31 #define GOOGLE_OAUTH2_API_TOKENINFO_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_oauth2_api {
44 using namespace googleapis;
45 
51 class Tokeninfo : public client::JsonCppData {
52  public:
58  static Tokeninfo* New();
59 
65  explicit Tokeninfo(const Json::Value& storage);
66 
72  explicit Tokeninfo(Json::Value* storage);
73 
77  virtual ~Tokeninfo();
78 
84  const StringPiece GetTypeName() const {
85  return StringPiece("google_oauth2_api::Tokeninfo");
86  }
87 
93  bool has_audience() const {
94  return Storage().isMember("audience");
95  }
96 
100  void clear_audience() {
101  MutableStorage()->removeMember("audience");
102  }
103 
104 
108  const StringPiece get_audience() const {
109  const Json::Value& v = Storage("audience");
110  if (v == Json::Value::null) return StringPiece("");
111  return StringPiece(v.asCString());
112  }
113 
122  void set_audience(const StringPiece& value) {
123  *MutableStorage("audience") = value.data();
124  }
125 
131  bool has_email() const {
132  return Storage().isMember("email");
133  }
134 
138  void clear_email() {
139  MutableStorage()->removeMember("email");
140  }
141 
142 
146  const StringPiece get_email() const {
147  const Json::Value& v = Storage("email");
148  if (v == Json::Value::null) return StringPiece("");
149  return StringPiece(v.asCString());
150  }
151 
160  void set_email(const StringPiece& value) {
161  *MutableStorage("email") = value.data();
162  }
163 
169  bool has_expires_in() const {
170  return Storage().isMember("expires_in");
171  }
172 
177  MutableStorage()->removeMember("expires_in");
178  }
179 
180 
184  int32 get_expires_in() const {
185  const Json::Value& storage = Storage("expires_in");
186  return client::JsonValueToCppValueHelper<int32 >(storage);
187  }
188 
196  void set_expires_in(int32 value) {
197  client::SetJsonValueFromCppValueHelper<int32 >(
198  value, MutableStorage("expires_in"));
199  }
200 
206  bool has_issued_to() const {
207  return Storage().isMember("issued_to");
208  }
209 
214  MutableStorage()->removeMember("issued_to");
215  }
216 
217 
221  const StringPiece get_issued_to() const {
222  const Json::Value& v = Storage("issued_to");
223  if (v == Json::Value::null) return StringPiece("");
224  return StringPiece(v.asCString());
225  }
226 
234  void set_issued_to(const StringPiece& value) {
235  *MutableStorage("issued_to") = value.data();
236  }
237 
243  bool has_scope() const {
244  return Storage().isMember("scope");
245  }
246 
250  void clear_scope() {
251  MutableStorage()->removeMember("scope");
252  }
253 
254 
258  const StringPiece get_scope() const {
259  const Json::Value& v = Storage("scope");
260  if (v == Json::Value::null) return StringPiece("");
261  return StringPiece(v.asCString());
262  }
263 
271  void set_scope(const StringPiece& value) {
272  *MutableStorage("scope") = value.data();
273  }
274 
280  bool has_user_id() const {
281  return Storage().isMember("user_id");
282  }
283 
287  void clear_user_id() {
288  MutableStorage()->removeMember("user_id");
289  }
290 
291 
295  const StringPiece get_user_id() const {
296  const Json::Value& v = Storage("user_id");
297  if (v == Json::Value::null) return StringPiece("");
298  return StringPiece(v.asCString());
299  }
300 
308  void set_user_id(const StringPiece& value) {
309  *MutableStorage("user_id") = value.data();
310  }
311 
317  bool has_verified_email() const {
318  return Storage().isMember("verified_email");
319  }
320 
325  MutableStorage()->removeMember("verified_email");
326  }
327 
328 
332  bool get_verified_email() const {
333  const Json::Value& storage = Storage("verified_email");
334  return client::JsonValueToCppValueHelper<bool >(storage);
335  }
336 
345  void set_verified_email(bool value) {
346  client::SetJsonValueFromCppValueHelper<bool >(
347  value, MutableStorage("verified_email"));
348  }
349 
350  private:
351  void operator=(const Tokeninfo&);
352 }; // Tokeninfo
353 } // namespace google_oauth2_api
354 #endif // GOOGLE_OAUTH2_API_TOKENINFO_H_
int32 get_expires_in() const
Definition: tokeninfo.h:184
void clear_audience()
Definition: tokeninfo.h:100
Definition: tokeninfo.h:51
const StringPiece get_user_id() const
Definition: tokeninfo.h:295
void clear_verified_email()
Definition: tokeninfo.h:324
bool has_user_id() const
Definition: tokeninfo.h:280
void set_email(const StringPiece &value)
Definition: tokeninfo.h:160
void set_issued_to(const StringPiece &value)
Definition: tokeninfo.h:234
void set_scope(const StringPiece &value)
Definition: tokeninfo.h:271
void clear_expires_in()
Definition: tokeninfo.h:176
bool get_verified_email() const
Definition: tokeninfo.h:332
void clear_scope()
Definition: tokeninfo.h:250
const StringPiece GetTypeName() const
Definition: tokeninfo.h:84
const StringPiece get_issued_to() const
Definition: tokeninfo.h:221
void set_expires_in(int32 value)
Definition: tokeninfo.h:196
const StringPiece get_email() const
Definition: tokeninfo.h:146
bool has_audience() const
Definition: tokeninfo.h:93
bool has_issued_to() const
Definition: tokeninfo.h:206
Definition: tokeninfo.h:39
bool has_verified_email() const
Definition: tokeninfo.h:317
bool has_scope() const
Definition: tokeninfo.h:243
void clear_email()
Definition: tokeninfo.h:138
void set_verified_email(bool value)
Definition: tokeninfo.h:345
const StringPiece get_scope() const
Definition: tokeninfo.h:258
void set_audience(const StringPiece &value)
Definition: tokeninfo.h:122
bool has_expires_in() const
Definition: tokeninfo.h:169
const StringPiece get_audience() const
Definition: tokeninfo.h:108
bool has_email() const
Definition: tokeninfo.h:131
void clear_user_id()
Definition: tokeninfo.h:287
Definition: oauth2_service.cc:40
void clear_issued_to()
Definition: tokeninfo.h:213
void set_user_id(const StringPiece &value)
Definition: tokeninfo.h:308