classroom  v1
user_profile.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-13, 00:00:47 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 Classroom API (classroom/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 386
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_CLASSROOM_API_USER_PROFILE_H_
31 #define GOOGLE_CLASSROOM_API_USER_PROFILE_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 #include "google/classroom_api/global_permission.h"
39 #include "google/classroom_api/name.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_classroom_api {
46 using namespace googleapis;
47 
53 class UserProfile : public client::JsonCppData {
54  public:
60  static UserProfile* New();
61 
67  explicit UserProfile(const Json::Value& storage);
68 
74  explicit UserProfile(Json::Value* storage);
75 
79  virtual ~UserProfile();
80 
86  const StringPiece GetTypeName() const {
87  return StringPiece("google_classroom_api::UserProfile");
88  }
89 
95  bool has_email_address() const {
96  return Storage().isMember("emailAddress");
97  }
98 
103  MutableStorage()->removeMember("emailAddress");
104  }
105 
106 
110  const StringPiece get_email_address() const {
111  const Json::Value& v = Storage("emailAddress");
112  if (v == Json::Value::null) return StringPiece("");
113  return StringPiece(v.asCString());
114  }
115 
125  void set_email_address(const StringPiece& value) {
126  *MutableStorage("emailAddress") = value.data();
127  }
128 
134  bool has_id() const {
135  return Storage().isMember("id");
136  }
137 
141  void clear_id() {
142  MutableStorage()->removeMember("id");
143  }
144 
145 
149  const StringPiece get_id() const {
150  const Json::Value& v = Storage("id");
151  if (v == Json::Value::null) return StringPiece("");
152  return StringPiece(v.asCString());
153  }
154 
164  void set_id(const StringPiece& value) {
165  *MutableStorage("id") = value.data();
166  }
167 
173  bool has_name() const {
174  return Storage().isMember("name");
175  }
176 
180  void clear_name() {
181  MutableStorage()->removeMember("name");
182  }
183 
184 
188  const Name get_name() const;
189 
199  Name mutable_name();
200 
206  bool has_permissions() const {
207  return Storage().isMember("permissions");
208  }
209 
214  MutableStorage()->removeMember("permissions");
215  }
216 
217 
221  const client::JsonCppArray<GlobalPermission > get_permissions() const;
222 
233  client::JsonCppArray<GlobalPermission > mutable_permissions();
234 
240  bool has_photo_url() const {
241  return Storage().isMember("photoUrl");
242  }
243 
248  MutableStorage()->removeMember("photoUrl");
249  }
250 
251 
255  const StringPiece get_photo_url() const {
256  const Json::Value& v = Storage("photoUrl");
257  if (v == Json::Value::null) return StringPiece("");
258  return StringPiece(v.asCString());
259  }
260 
270  void set_photo_url(const StringPiece& value) {
271  *MutableStorage("photoUrl") = value.data();
272  }
273 
279  bool has_verified_teacher() const {
280  return Storage().isMember("verifiedTeacher");
281  }
282 
287  MutableStorage()->removeMember("verifiedTeacher");
288  }
289 
290 
294  bool get_verified_teacher() const {
295  const Json::Value& storage = Storage("verifiedTeacher");
296  return client::JsonValueToCppValueHelper<bool >(storage);
297  }
298 
310  void set_verified_teacher(bool value) {
311  client::SetJsonValueFromCppValueHelper<bool >(
312  value, MutableStorage("verifiedTeacher"));
313  }
314 
315  private:
316  void operator=(const UserProfile&);
317 }; // UserProfile
318 } // namespace google_classroom_api
319 #endif // GOOGLE_CLASSROOM_API_USER_PROFILE_H_
bool has_name() const
Definition: user_profile.h:173
bool has_id() const
Definition: user_profile.h:134
const StringPiece get_email_address() const
Definition: user_profile.h:110
void set_email_address(const StringPiece &value)
Definition: user_profile.h:125
const StringPiece get_id() const
Definition: user_profile.h:149
void clear_verified_teacher()
Definition: user_profile.h:286
const StringPiece get_photo_url() const
Definition: user_profile.h:255
bool has_photo_url() const
Definition: user_profile.h:240
void set_verified_teacher(bool value)
Definition: user_profile.h:310
void set_photo_url(const StringPiece &value)
Definition: user_profile.h:270
Definition: announcement.h:41
void clear_email_address()
Definition: user_profile.h:102
bool get_verified_teacher() const
Definition: user_profile.h:294
const StringPiece GetTypeName() const
Definition: user_profile.h:86
void clear_name()
Definition: user_profile.h:180
Definition: name.h:50
void set_id(const StringPiece &value)
Definition: user_profile.h:164
Definition: announcement.cc:43
bool has_email_address() const
Definition: user_profile.h:95
void clear_id()
Definition: user_profile.h:141
Definition: user_profile.h:53
bool has_verified_teacher() const
Definition: user_profile.h:279
bool has_permissions() const
Definition: user_profile.h:206
void clear_photo_url()
Definition: user_profile.h:247
void clear_permissions()
Definition: user_profile.h:213