gmail  v1
message_part.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_PART_H_
31 #define GOOGLE_GMAIL_API_MESSAGE_PART_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/gmail_api/message_part.h"
39 #include "google/gmail_api/message_part_body.h"
40 #include "google/gmail_api/message_part_header.h"
41 
42 namespace Json {
43 class Value;
44 } // namespace Json
45 
46 namespace google_gmail_api {
47 using namespace googleapis;
48 
54 class MessagePart : public client::JsonCppData {
55  public:
61  static MessagePart* New();
62 
68  explicit MessagePart(const Json::Value& storage);
69 
75  explicit MessagePart(Json::Value* storage);
76 
80  virtual ~MessagePart();
81 
87  const StringPiece GetTypeName() const {
88  return StringPiece("google_gmail_api::MessagePart");
89  }
90 
96  bool has_body() const {
97  return Storage().isMember("body");
98  }
99 
103  void clear_body() {
104  MutableStorage()->removeMember("body");
105  }
106 
107 
111  const MessagePartBody get_body() const;
112 
121  MessagePartBody mutable_body();
122 
128  bool has_filename() const {
129  return Storage().isMember("filename");
130  }
131 
135  void clear_filename() {
136  MutableStorage()->removeMember("filename");
137  }
138 
139 
143  const StringPiece get_filename() const {
144  const Json::Value& v = Storage("filename");
145  if (v == Json::Value::null) return StringPiece("");
146  return StringPiece(v.asCString());
147  }
148 
157  void set_filename(const StringPiece& value) {
158  *MutableStorage("filename") = value.data();
159  }
160 
166  bool has_headers() const {
167  return Storage().isMember("headers");
168  }
169 
173  void clear_headers() {
174  MutableStorage()->removeMember("headers");
175  }
176 
177 
181  const client::JsonCppArray<MessagePartHeader > get_headers() const;
182 
192  client::JsonCppArray<MessagePartHeader > mutable_headers();
193 
199  bool has_mime_type() const {
200  return Storage().isMember("mimeType");
201  }
202 
207  MutableStorage()->removeMember("mimeType");
208  }
209 
210 
214  const StringPiece get_mime_type() const {
215  const Json::Value& v = Storage("mimeType");
216  if (v == Json::Value::null) return StringPiece("");
217  return StringPiece(v.asCString());
218  }
219 
227  void set_mime_type(const StringPiece& value) {
228  *MutableStorage("mimeType") = value.data();
229  }
230 
236  bool has_part_id() const {
237  return Storage().isMember("partId");
238  }
239 
243  void clear_part_id() {
244  MutableStorage()->removeMember("partId");
245  }
246 
247 
251  const StringPiece get_part_id() const {
252  const Json::Value& v = Storage("partId");
253  if (v == Json::Value::null) return StringPiece("");
254  return StringPiece(v.asCString());
255  }
256 
264  void set_part_id(const StringPiece& value) {
265  *MutableStorage("partId") = value.data();
266  }
267 
273  bool has_parts() const {
274  return Storage().isMember("parts");
275  }
276 
280  void clear_parts() {
281  MutableStorage()->removeMember("parts");
282  }
283 
284 
288  const client::JsonCppArray<MessagePart > get_parts() const;
289 
300  client::JsonCppArray<MessagePart > mutable_parts();
301 
302  private:
303  void operator=(const MessagePart&);
304 }; // MessagePart
305 } // namespace google_gmail_api
306 #endif // GOOGLE_GMAIL_API_MESSAGE_PART_H_
const StringPiece get_mime_type() const
Definition: message_part.h:214
bool has_headers() const
Definition: message_part.h:166
void set_filename(const StringPiece &value)
Definition: message_part.h:157
void set_mime_type(const StringPiece &value)
Definition: message_part.h:227
void clear_part_id()
Definition: message_part.h:243
const StringPiece GetTypeName() const
Definition: message_part.h:87
const StringPiece get_part_id() const
Definition: message_part.h:251
const StringPiece get_filename() const
Definition: message_part.h:143
void clear_headers()
Definition: message_part.h:173
void clear_body()
Definition: message_part.h:103
bool has_parts() const
Definition: message_part.h:273
void clear_mime_type()
Definition: message_part.h:206
bool has_part_id() const
Definition: message_part.h:236
bool has_filename() const
Definition: message_part.h:128
Definition: auto_forwarding.h:38
Definition: message_part_body.h:51
bool has_mime_type() const
Definition: message_part.h:199
void set_part_id(const StringPiece &value)
Definition: message_part.h:264
void clear_filename()
Definition: message_part.h:135
bool has_body() const
Definition: message_part.h:96
void clear_parts()
Definition: message_part.h:280
Definition: message_part.h:54
Definition: auto_forwarding.cc:40