30 #ifndef GOOGLE_GMAIL_API_THREAD_H_ 31 #define GOOGLE_GMAIL_API_THREAD_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.h" 53 class Thread :
public client::JsonCppData {
67 explicit Thread(
const Json::Value& storage);
74 explicit Thread(Json::Value* storage);
87 return StringPiece(
"google_gmail_api::Thread");
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(
"messages");
177 MutableStorage()->removeMember(
"messages");
184 const client::JsonCppArray<Message > get_messages()
const;
194 client::JsonCppArray<Message > mutable_messages();
202 return Storage().isMember(
"snippet");
209 MutableStorage()->removeMember(
"snippet");
217 const Json::Value& v = Storage(
"snippet");
218 if (v == Json::Value::null)
return StringPiece(
"");
219 return StringPiece(v.asCString());
230 *MutableStorage(
"snippet") = value.data();
234 void operator=(
const Thread&);
237 #endif // GOOGLE_GMAIL_API_THREAD_H_ void clear_id()
Definition: thread.h:139
void clear_history_id()
Definition: thread.h:102
void set_id(const StringPiece &value)
Definition: thread.h:160
void set_snippet(const StringPiece &value)
Definition: thread.h:229
const StringPiece GetTypeName() const
Definition: thread.h:86
void clear_messages()
Definition: thread.h:176
void clear_snippet()
Definition: thread.h:208
bool has_messages() const
Definition: thread.h:169
const StringPiece get_snippet() const
Definition: thread.h:216
Definition: auto_forwarding.h:38
const StringPiece get_id() const
Definition: thread.h:147
bool has_id() const
Definition: thread.h:132
void set_history_id(uint64 value)
Definition: thread.h:122
bool has_snippet() const
Definition: thread.h:201
bool has_history_id() const
Definition: thread.h:95
uint64 get_history_id() const
Definition: thread.h:110
Definition: auto_forwarding.cc:40