30 #ifndef GOOGLE_GMAIL_API_MESSAGE_H_ 31 #define GOOGLE_GMAIL_API_MESSAGE_H_ 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" 39 #include "google/gmail_api/message_part.h" 53 class Message :
public client::JsonCppData {
67 explicit Message(
const Json::Value& storage);
74 explicit Message(Json::Value* storage);
87 return StringPiece(
"google_gmail_api::Message");
96 return Storage().isMember(
"historyId");
103 MutableStorage()->removeMember(
"historyId");
111 const Json::Value& storage = Storage(
"historyId");
112 return client::JsonValueToCppValueHelper<uint64 >(storage);
123 client::SetJsonValueFromCppValueHelper<uint64 >(
124 value, MutableStorage(
"historyId"));
133 return Storage().isMember(
"id");
140 MutableStorage()->removeMember(
"id");
148 const Json::Value& v = Storage(
"id");
149 if (v == Json::Value::null)
return StringPiece(
"");
150 return StringPiece(v.asCString());
161 *MutableStorage(
"id") = value.data();
170 return Storage().isMember(
"internalDate");
177 MutableStorage()->removeMember(
"internalDate");
185 const Json::Value& storage = Storage(
"internalDate");
186 return client::JsonValueToCppValueHelper<int64 >(storage);
201 client::SetJsonValueFromCppValueHelper<int64 >(
202 value, MutableStorage(
"internalDate"));
211 return Storage().isMember(
"labelIds");
218 MutableStorage()->removeMember(
"labelIds");
226 const Json::Value& storage = Storage(
"labelIds");
227 return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
239 Json::Value* storage = MutableStorage(
"labelIds");
240 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
249 return Storage().isMember(
"payload");
256 MutableStorage()->removeMember(
"payload");
280 return Storage().isMember(
"raw");
287 MutableStorage()->removeMember(
"raw");
295 const Json::Value& v = Storage(
"raw");
296 if (v == Json::Value::null)
return StringPiece(
"");
297 return StringPiece(v.asCString());
310 *MutableStorage(
"raw") = value.data();
319 return Storage().isMember(
"sizeEstimate");
326 MutableStorage()->removeMember(
"sizeEstimate");
334 const Json::Value& storage = Storage(
"sizeEstimate");
335 return client::JsonValueToCppValueHelper<int32 >(storage);
346 client::SetJsonValueFromCppValueHelper<int32 >(
347 value, MutableStorage(
"sizeEstimate"));
356 return Storage().isMember(
"snippet");
363 MutableStorage()->removeMember(
"snippet");
371 const Json::Value& v = Storage(
"snippet");
372 if (v == Json::Value::null)
return StringPiece(
"");
373 return StringPiece(v.asCString());
384 *MutableStorage(
"snippet") = value.data();
393 return Storage().isMember(
"threadId");
400 MutableStorage()->removeMember(
"threadId");
408 const Json::Value& v = Storage(
"threadId");
409 if (v == Json::Value::null)
return StringPiece(
"");
410 return StringPiece(v.asCString());
427 *MutableStorage(
"threadId") = value.data();
431 void operator=(
const Message&);
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
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