analytics  v3
segment.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-01-30, 05:27:32 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Google Analytics API (analytics/v3)
24 // Generated from:
25 // Version: v3
26 // Revision: 169
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_ANALYTICS_API_SEGMENT_H_
31 #define GOOGLE_ANALYTICS_API_SEGMENT_H_
32 
33 #include <string>
34 #include "googleapis/base/macros.h"
35 #include "googleapis/client/data/jsoncpp_data.h"
36 #include "googleapis/client/util/date_time.h"
37 #include "googleapis/strings/stringpiece.h"
38 
39 namespace Json {
40 class Value;
41 } // namespace Json
42 
43 namespace google_analytics_api {
44 using namespace googleapis;
45 
51 class Segment : public client::JsonCppData {
52  public:
58  static Segment* New();
59 
65  explicit Segment(const Json::Value& storage);
66 
72  explicit Segment(Json::Value* storage);
73 
77  virtual ~Segment();
78 
84  const StringPiece GetTypeName() const {
85  return StringPiece("google_analytics_api::Segment");
86  }
87 
93  bool has_created() const {
94  return Storage().isMember("created");
95  }
96 
100  void clear_created() {
101  MutableStorage()->removeMember("created");
102  }
103 
104 
108  client::DateTime get_created() const {
109  const Json::Value& storage = Storage("created");
110  return client::JsonValueToCppValueHelper<client::DateTime >(storage);
111  }
112 
120  void set_created(client::DateTime value) {
121  client::SetJsonValueFromCppValueHelper<client::DateTime >(
122  value, MutableStorage("created"));
123  }
124 
130  bool has_definition() const {
131  return Storage().isMember("definition");
132  }
133 
138  MutableStorage()->removeMember("definition");
139  }
140 
141 
145  const StringPiece get_definition() const {
146  const Json::Value& v = Storage("definition");
147  if (v == Json::Value::null) return StringPiece("");
148  return StringPiece(v.asCString());
149  }
150 
158  void set_definition(const StringPiece& value) {
159  *MutableStorage("definition") = value.data();
160  }
161 
167  bool has_id() const {
168  return Storage().isMember("id");
169  }
170 
174  void clear_id() {
175  MutableStorage()->removeMember("id");
176  }
177 
178 
182  const StringPiece get_id() const {
183  const Json::Value& v = Storage("id");
184  if (v == Json::Value::null) return StringPiece("");
185  return StringPiece(v.asCString());
186  }
187 
195  void set_id(const StringPiece& value) {
196  *MutableStorage("id") = value.data();
197  }
198 
204  bool has_kind() const {
205  return Storage().isMember("kind");
206  }
207 
211  void clear_kind() {
212  MutableStorage()->removeMember("kind");
213  }
214 
215 
219  const StringPiece get_kind() const {
220  const Json::Value& v = Storage("kind");
221  if (v == Json::Value::null) return StringPiece("");
222  return StringPiece(v.asCString());
223  }
224 
232  void set_kind(const StringPiece& value) {
233  *MutableStorage("kind") = value.data();
234  }
235 
241  bool has_name() const {
242  return Storage().isMember("name");
243  }
244 
248  void clear_name() {
249  MutableStorage()->removeMember("name");
250  }
251 
252 
256  const StringPiece get_name() const {
257  const Json::Value& v = Storage("name");
258  if (v == Json::Value::null) return StringPiece("");
259  return StringPiece(v.asCString());
260  }
261 
269  void set_name(const StringPiece& value) {
270  *MutableStorage("name") = value.data();
271  }
272 
278  bool has_segment_id() const {
279  return Storage().isMember("segmentId");
280  }
281 
286  MutableStorage()->removeMember("segmentId");
287  }
288 
289 
293  const StringPiece get_segment_id() const {
294  const Json::Value& v = Storage("segmentId");
295  if (v == Json::Value::null) return StringPiece("");
296  return StringPiece(v.asCString());
297  }
298 
306  void set_segment_id(const StringPiece& value) {
307  *MutableStorage("segmentId") = value.data();
308  }
309 
315  bool has_self_link() const {
316  return Storage().isMember("selfLink");
317  }
318 
323  MutableStorage()->removeMember("selfLink");
324  }
325 
326 
330  const StringPiece get_self_link() const {
331  const Json::Value& v = Storage("selfLink");
332  if (v == Json::Value::null) return StringPiece("");
333  return StringPiece(v.asCString());
334  }
335 
343  void set_self_link(const StringPiece& value) {
344  *MutableStorage("selfLink") = value.data();
345  }
346 
352  bool has_type() const {
353  return Storage().isMember("type");
354  }
355 
359  void clear_type() {
360  MutableStorage()->removeMember("type");
361  }
362 
363 
367  const StringPiece get_type() const {
368  const Json::Value& v = Storage("type");
369  if (v == Json::Value::null) return StringPiece("");
370  return StringPiece(v.asCString());
371  }
372 
380  void set_type(const StringPiece& value) {
381  *MutableStorage("type") = value.data();
382  }
383 
389  bool has_updated() const {
390  return Storage().isMember("updated");
391  }
392 
396  void clear_updated() {
397  MutableStorage()->removeMember("updated");
398  }
399 
400 
404  client::DateTime get_updated() const {
405  const Json::Value& storage = Storage("updated");
406  return client::JsonValueToCppValueHelper<client::DateTime >(storage);
407  }
408 
416  void set_updated(client::DateTime value) {
417  client::SetJsonValueFromCppValueHelper<client::DateTime >(
418  value, MutableStorage("updated"));
419  }
420 
421  private:
422  void operator=(const Segment&);
423 }; // Segment
424 } // namespace google_analytics_api
425 #endif // GOOGLE_ANALYTICS_API_SEGMENT_H_
void clear_type()
Definition: segment.h:359
void clear_created()
Definition: segment.h:100
bool has_name() const
Definition: segment.h:241
void set_created(client::DateTime value)
Definition: segment.h:120
void clear_definition()
Definition: segment.h:137
void clear_name()
Definition: segment.h:248
void set_name(const StringPiece &value)
Definition: segment.h:269
const StringPiece get_definition() const
Definition: segment.h:145
const StringPiece get_id() const
Definition: segment.h:182
bool has_self_link() const
Definition: segment.h:315
void set_type(const StringPiece &value)
Definition: segment.h:380
void set_updated(client::DateTime value)
Definition: segment.h:416
void set_definition(const StringPiece &value)
Definition: segment.h:158
bool has_updated() const
Definition: segment.h:389
void set_segment_id(const StringPiece &value)
Definition: segment.h:306
void clear_self_link()
Definition: segment.h:322
client::DateTime get_created() const
Definition: segment.h:108
bool has_kind() const
Definition: segment.h:204
const StringPiece GetTypeName() const
Definition: segment.h:84
void clear_updated()
Definition: segment.h:396
void clear_kind()
Definition: segment.h:211
void clear_id()
Definition: segment.h:174
const StringPiece get_kind() const
Definition: segment.h:219
bool has_created() const
Definition: segment.h:93
Definition: account.h:39
void clear_segment_id()
Definition: segment.h:285
Definition: account.cc:41
bool has_id() const
Definition: segment.h:167
const StringPiece get_type() const
Definition: segment.h:367
bool has_definition() const
Definition: segment.h:130
void set_self_link(const StringPiece &value)
Definition: segment.h:343
const StringPiece get_segment_id() const
Definition: segment.h:293
client::DateTime get_updated() const
Definition: segment.h:404
const StringPiece get_self_link() const
Definition: segment.h:330
void set_id(const StringPiece &value)
Definition: segment.h:195
bool has_type() const
Definition: segment.h:352
const StringPiece get_name() const
Definition: segment.h:256
Definition: segment.h:51
void set_kind(const StringPiece &value)
Definition: segment.h:232
bool has_segment_id() const
Definition: segment.h:278