gmail  v1
thread.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_THREAD_H_
31 #define GOOGLE_GMAIL_API_THREAD_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.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_gmail_api {
46 using namespace googleapis;
47 
53 class Thread : public client::JsonCppData {
54  public:
60  static Thread* New();
61 
67  explicit Thread(const Json::Value& storage);
68 
74  explicit Thread(Json::Value* storage);
75 
79  virtual ~Thread();
80 
86  const StringPiece GetTypeName() const {
87  return StringPiece("google_gmail_api::Thread");
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_messages() const {
170  return Storage().isMember("messages");
171  }
172 
176  void clear_messages() {
177  MutableStorage()->removeMember("messages");
178  }
179 
180 
184  const client::JsonCppArray<Message > get_messages() const;
185 
194  client::JsonCppArray<Message > mutable_messages();
195 
201  bool has_snippet() const {
202  return Storage().isMember("snippet");
203  }
204 
208  void clear_snippet() {
209  MutableStorage()->removeMember("snippet");
210  }
211 
212 
216  const StringPiece get_snippet() const {
217  const Json::Value& v = Storage("snippet");
218  if (v == Json::Value::null) return StringPiece("");
219  return StringPiece(v.asCString());
220  }
221 
229  void set_snippet(const StringPiece& value) {
230  *MutableStorage("snippet") = value.data();
231  }
232 
233  private:
234  void operator=(const Thread&);
235 }; // Thread
236 } // namespace google_gmail_api
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
Definition: thread.h:53
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