gmail  v1
message.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-02-15, 12:56:31 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Gmail API (gmail/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 110
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_GMAIL_API_MESSAGE_H_
31 #define GOOGLE_GMAIL_API_MESSAGE_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 #include "google/gmail_api/message_part.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_gmail_api {
46 using namespace googleapis;
47 
53 class Message : public client::JsonCppData {
54  public:
60  static Message* New();
61 
67  explicit Message(const Json::Value& storage);
68 
74  explicit Message(Json::Value* storage);
75 
79  virtual ~Message();
80 
86  const StringPiece GetTypeName() const {
87  return StringPiece("google_gmail_api::Message");
88  }
89 
95  bool has_history_id() const {
96  return Storage().isMember("historyId");
97  }
98 
103  MutableStorage()->removeMember("historyId");
104  }
105 
106 
110  uint64 get_history_id() const {
111  const Json::Value& storage = Storage("historyId");
112  return client::JsonValueToCppValueHelper<uint64 >(storage);
113  }
114 
122  void set_history_id(uint64 value) {
123  client::SetJsonValueFromCppValueHelper<uint64 >(
124  value, MutableStorage("historyId"));
125  }
126 
132  bool has_id() const {
133  return Storage().isMember("id");
134  }
135 
139  void clear_id() {
140  MutableStorage()->removeMember("id");
141  }
142 
143 
147  const StringPiece get_id() const {
148  const Json::Value& v = Storage("id");
149  if (v == Json::Value::null) return StringPiece("");
150  return StringPiece(v.asCString());
151  }
152 
160  void set_id(const StringPiece& value) {
161  *MutableStorage("id") = value.data();
162  }
163 
169  bool has_internal_date() const {
170  return Storage().isMember("internalDate");
171  }
172 
177  MutableStorage()->removeMember("internalDate");
178  }
179 
180 
184  int64 get_internal_date() const {
185  const Json::Value& storage = Storage("internalDate");
186  return client::JsonValueToCppValueHelper<int64 >(storage);
187  }
188 
200  void set_internal_date(int64 value) {
201  client::SetJsonValueFromCppValueHelper<int64 >(
202  value, MutableStorage("internalDate"));
203  }
204 
210  bool has_label_ids() const {
211  return Storage().isMember("labelIds");
212  }
213 
218  MutableStorage()->removeMember("labelIds");
219  }
220 
221 
225  const client::JsonCppArray<string > get_label_ids() const {
226  const Json::Value& storage = Storage("labelIds");
227  return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
228  }
229 
238  client::JsonCppArray<string > mutable_labelIds() {
239  Json::Value* storage = MutableStorage("labelIds");
240  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
241  }
242 
248  bool has_payload() const {
249  return Storage().isMember("payload");
250  }
251 
255  void clear_payload() {
256  MutableStorage()->removeMember("payload");
257  }
258 
259 
263  const MessagePart get_payload() const;
264 
272  MessagePart mutable_payload();
273 
279  bool has_raw() const {
280  return Storage().isMember("raw");
281  }
282 
286  void clear_raw() {
287  MutableStorage()->removeMember("raw");
288  }
289 
290 
294  const StringPiece get_raw() const {
295  const Json::Value& v = Storage("raw");
296  if (v == Json::Value::null) return StringPiece("");
297  return StringPiece(v.asCString());
298  }
299 
309  void set_raw(const StringPiece& value) {
310  *MutableStorage("raw") = value.data();
311  }
312 
318  bool has_size_estimate() const {
319  return Storage().isMember("sizeEstimate");
320  }
321 
326  MutableStorage()->removeMember("sizeEstimate");
327  }
328 
329 
333  int32 get_size_estimate() const {
334  const Json::Value& storage = Storage("sizeEstimate");
335  return client::JsonValueToCppValueHelper<int32 >(storage);
336  }
337 
345  void set_size_estimate(int32 value) {
346  client::SetJsonValueFromCppValueHelper<int32 >(
347  value, MutableStorage("sizeEstimate"));
348  }
349 
355  bool has_snippet() const {
356  return Storage().isMember("snippet");
357  }
358 
362  void clear_snippet() {
363  MutableStorage()->removeMember("snippet");
364  }
365 
366 
370  const StringPiece get_snippet() const {
371  const Json::Value& v = Storage("snippet");
372  if (v == Json::Value::null) return StringPiece("");
373  return StringPiece(v.asCString());
374  }
375 
383  void set_snippet(const StringPiece& value) {
384  *MutableStorage("snippet") = value.data();
385  }
386 
392  bool has_thread_id() const {
393  return Storage().isMember("threadId");
394  }
395 
400  MutableStorage()->removeMember("threadId");
401  }
402 
403 
407  const StringPiece get_thread_id() const {
408  const Json::Value& v = Storage("threadId");
409  if (v == Json::Value::null) return StringPiece("");
410  return StringPiece(v.asCString());
411  }
412 
426  void set_thread_id(const StringPiece& value) {
427  *MutableStorage("threadId") = value.data();
428  }
429 
430  private:
431  void operator=(const Message&);
432 }; // Message
433 } // namespace google_gmail_api
434 #endif // GOOGLE_GMAIL_API_MESSAGE_H_
bool has_label_ids() const
Definition: message.h:210
bool has_payload() const
Definition: message.h:248
void set_raw(const StringPiece &value)
Definition: message.h:309
const StringPiece get_snippet() const
Definition: message.h:370
void set_history_id(uint64 value)
Definition: message.h:122
void set_internal_date(int64 value)
Definition: message.h:200
bool has_history_id() const
Definition: message.h:95
void set_thread_id(const StringPiece &value)
Definition: message.h:426
void clear_payload()
Definition: message.h:255
Definition: message.h:53
void clear_size_estimate()
Definition: message.h:325
const StringPiece get_thread_id() const
Definition: message.h:407
const StringPiece get_raw() const
Definition: message.h:294
bool has_raw() const
Definition: message.h:279
const StringPiece GetTypeName() const
Definition: message.h:86
client::JsonCppArray< string > mutable_labelIds()
Definition: message.h:238
int32 get_size_estimate() const
Definition: message.h:333
uint64 get_history_id() const
Definition: message.h:110
bool has_thread_id() const
Definition: message.h:392
bool has_snippet() const
Definition: message.h:355
void set_snippet(const StringPiece &value)
Definition: message.h:383
Definition: auto_forwarding.h:38
int64 get_internal_date() const
Definition: message.h:184
void clear_thread_id()
Definition: message.h:399
void clear_snippet()
Definition: message.h:362
void set_size_estimate(int32 value)
Definition: message.h:345
void clear_label_ids()
Definition: message.h:217
void clear_internal_date()
Definition: message.h:176
void set_id(const StringPiece &value)
Definition: message.h:160
void clear_history_id()
Definition: message.h:102
const StringPiece get_id() const
Definition: message.h:147
const client::JsonCppArray< string > get_label_ids() const
Definition: message.h:225
Definition: message_part.h:54
bool has_id() const
Definition: message.h:132
void clear_raw()
Definition: message.h:286
Definition: auto_forwarding.cc:40
bool has_size_estimate() const
Definition: message.h:318
bool has_internal_date() const
Definition: message.h:169
void clear_id()
Definition: message.h:139