analytics  v3
segments.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_SEGMENTS_H_
31 #define GOOGLE_ANALYTICS_API_SEGMENTS_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/analytics_api/segment.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_analytics_api {
46 using namespace googleapis;
47 
54 class Segments : public client::JsonCppData {
55  public:
61  static Segments* New();
62 
68  explicit Segments(const Json::Value& storage);
69 
75  explicit Segments(Json::Value* storage);
76 
80  virtual ~Segments();
81 
87  const StringPiece GetTypeName() const {
88  return StringPiece("google_analytics_api::Segments");
89  }
90 
96  bool has_items() const {
97  return Storage().isMember("items");
98  }
99 
103  void clear_items() {
104  MutableStorage()->removeMember("items");
105  }
106 
107 
111  const client::JsonCppArray<Segment > get_items() const;
112 
120  client::JsonCppArray<Segment > mutable_items();
121 
127  bool has_items_per_page() const {
128  return Storage().isMember("itemsPerPage");
129  }
130 
135  MutableStorage()->removeMember("itemsPerPage");
136  }
137 
138 
142  int32 get_items_per_page() const {
143  const Json::Value& storage = Storage("itemsPerPage");
144  return client::JsonValueToCppValueHelper<int32 >(storage);
145  }
146 
157  void set_items_per_page(int32 value) {
158  client::SetJsonValueFromCppValueHelper<int32 >(
159  value, MutableStorage("itemsPerPage"));
160  }
161 
167  bool has_kind() const {
168  return Storage().isMember("kind");
169  }
170 
174  void clear_kind() {
175  MutableStorage()->removeMember("kind");
176  }
177 
178 
182  const StringPiece get_kind() const {
183  const Json::Value& v = Storage("kind");
184  if (v == Json::Value::null) return StringPiece("");
185  return StringPiece(v.asCString());
186  }
187 
195  void set_kind(const StringPiece& value) {
196  *MutableStorage("kind") = value.data();
197  }
198 
204  bool has_next_link() const {
205  return Storage().isMember("nextLink");
206  }
207 
212  MutableStorage()->removeMember("nextLink");
213  }
214 
215 
219  const StringPiece get_next_link() const {
220  const Json::Value& v = Storage("nextLink");
221  if (v == Json::Value::null) return StringPiece("");
222  return StringPiece(v.asCString());
223  }
224 
232  void set_next_link(const StringPiece& value) {
233  *MutableStorage("nextLink") = value.data();
234  }
235 
241  bool has_previous_link() const {
242  return Storage().isMember("previousLink");
243  }
244 
249  MutableStorage()->removeMember("previousLink");
250  }
251 
252 
256  const StringPiece get_previous_link() const {
257  const Json::Value& v = Storage("previousLink");
258  if (v == Json::Value::null) return StringPiece("");
259  return StringPiece(v.asCString());
260  }
261 
269  void set_previous_link(const StringPiece& value) {
270  *MutableStorage("previousLink") = value.data();
271  }
272 
278  bool has_start_index() const {
279  return Storage().isMember("startIndex");
280  }
281 
286  MutableStorage()->removeMember("startIndex");
287  }
288 
289 
293  int32 get_start_index() const {
294  const Json::Value& storage = Storage("startIndex");
295  return client::JsonValueToCppValueHelper<int32 >(storage);
296  }
297 
306  void set_start_index(int32 value) {
307  client::SetJsonValueFromCppValueHelper<int32 >(
308  value, MutableStorage("startIndex"));
309  }
310 
316  bool has_total_results() const {
317  return Storage().isMember("totalResults");
318  }
319 
324  MutableStorage()->removeMember("totalResults");
325  }
326 
327 
331  int32 get_total_results() const {
332  const Json::Value& storage = Storage("totalResults");
333  return client::JsonValueToCppValueHelper<int32 >(storage);
334  }
335 
344  void set_total_results(int32 value) {
345  client::SetJsonValueFromCppValueHelper<int32 >(
346  value, MutableStorage("totalResults"));
347  }
348 
354  bool has_username() const {
355  return Storage().isMember("username");
356  }
357 
361  void clear_username() {
362  MutableStorage()->removeMember("username");
363  }
364 
365 
369  const StringPiece get_username() const {
370  const Json::Value& v = Storage("username");
371  if (v == Json::Value::null) return StringPiece("");
372  return StringPiece(v.asCString());
373  }
374 
382  void set_username(const StringPiece& value) {
383  *MutableStorage("username") = value.data();
384  }
385 
386  private:
387  void operator=(const Segments&);
388 }; // Segments
389 } // namespace google_analytics_api
390 #endif // GOOGLE_ANALYTICS_API_SEGMENTS_H_
const StringPiece get_username() const
Definition: segments.h:369
const StringPiece get_kind() const
Definition: segments.h:182
bool has_items() const
Definition: segments.h:96
bool has_start_index() const
Definition: segments.h:278
const StringPiece GetTypeName() const
Definition: segments.h:87
void set_items_per_page(int32 value)
Definition: segments.h:157
bool has_username() const
Definition: segments.h:354
const StringPiece get_next_link() const
Definition: segments.h:219
void clear_next_link()
Definition: segments.h:211
void set_kind(const StringPiece &value)
Definition: segments.h:195
bool has_previous_link() const
Definition: segments.h:241
bool has_kind() const
Definition: segments.h:167
Definition: segments.h:54
void clear_start_index()
Definition: segments.h:285
void clear_items()
Definition: segments.h:103
void clear_items_per_page()
Definition: segments.h:134
void set_next_link(const StringPiece &value)
Definition: segments.h:232
int32 get_items_per_page() const
Definition: segments.h:142
bool has_next_link() const
Definition: segments.h:204
void set_start_index(int32 value)
Definition: segments.h:306
void set_username(const StringPiece &value)
Definition: segments.h:382
Definition: account.h:39
Definition: account.cc:41
const StringPiece get_previous_link() const
Definition: segments.h:256
void clear_username()
Definition: segments.h:361
int32 get_start_index() const
Definition: segments.h:293
void clear_previous_link()
Definition: segments.h:248
void clear_kind()
Definition: segments.h:174
void set_previous_link(const StringPiece &value)
Definition: segments.h:269
int32 get_total_results() const
Definition: segments.h:331
void set_total_results(int32 value)
Definition: segments.h:344
bool has_total_results() const
Definition: segments.h:316
bool has_items_per_page() const
Definition: segments.h:127
void clear_total_results()
Definition: segments.h:323