gmail  v1
message_part_body.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_BODY_H_
31 #define GOOGLE_GMAIL_API_MESSAGE_PART_BODY_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 namespace Json {
40 class Value;
41 } // namespace Json
42 
43 namespace google_gmail_api {
44 using namespace googleapis;
45 
51 class MessagePartBody : public client::JsonCppData {
52  public:
58  static MessagePartBody* New();
59 
65  explicit MessagePartBody(const Json::Value& storage);
66 
72  explicit MessagePartBody(Json::Value* storage);
73 
77  virtual ~MessagePartBody();
78 
84  const StringPiece GetTypeName() const {
85  return StringPiece("google_gmail_api::MessagePartBody");
86  }
87 
93  bool has_attachment_id() const {
94  return Storage().isMember("attachmentId");
95  }
96 
101  MutableStorage()->removeMember("attachmentId");
102  }
103 
104 
108  const StringPiece get_attachment_id() const {
109  const Json::Value& v = Storage("attachmentId");
110  if (v == Json::Value::null) return StringPiece("");
111  return StringPiece(v.asCString());
112  }
113 
123  void set_attachment_id(const StringPiece& value) {
124  *MutableStorage("attachmentId") = value.data();
125  }
126 
132  bool has_data() const {
133  return Storage().isMember("data");
134  }
135 
139  void clear_data() {
140  MutableStorage()->removeMember("data");
141  }
142 
143 
147  const StringPiece get_data() const {
148  const Json::Value& v = Storage("data");
149  if (v == Json::Value::null) return StringPiece("");
150  return StringPiece(v.asCString());
151  }
152 
163  void set_data(const StringPiece& value) {
164  *MutableStorage("data") = value.data();
165  }
166 
172  bool has_size() const {
173  return Storage().isMember("size");
174  }
175 
179  void clear_size() {
180  MutableStorage()->removeMember("size");
181  }
182 
183 
187  int32 get_size() const {
188  const Json::Value& storage = Storage("size");
189  return client::JsonValueToCppValueHelper<int32 >(storage);
190  }
191 
199  void set_size(int32 value) {
200  client::SetJsonValueFromCppValueHelper<int32 >(
201  value, MutableStorage("size"));
202  }
203 
204  private:
205  void operator=(const MessagePartBody&);
206 }; // MessagePartBody
207 } // namespace google_gmail_api
208 #endif // GOOGLE_GMAIL_API_MESSAGE_PART_BODY_H_
void set_attachment_id(const StringPiece &value)
Definition: message_part_body.h:123
const StringPiece get_attachment_id() const
Definition: message_part_body.h:108
bool has_size() const
Definition: message_part_body.h:172
void clear_data()
Definition: message_part_body.h:139
void set_size(int32 value)
Definition: message_part_body.h:199
const StringPiece GetTypeName() const
Definition: message_part_body.h:84
bool has_attachment_id() const
Definition: message_part_body.h:93
void set_data(const StringPiece &value)
Definition: message_part_body.h:163
void clear_attachment_id()
Definition: message_part_body.h:100
bool has_data() const
Definition: message_part_body.h:132
Definition: auto_forwarding.h:38
Definition: message_part_body.h:51
int32 get_size() const
Definition: message_part_body.h:187
const StringPiece get_data() const
Definition: message_part_body.h:147
void clear_size()
Definition: message_part_body.h:179
Definition: auto_forwarding.cc:40