fitness  v1
aggregate_bucket.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-03-28, 03:09:04 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Fitness (fitness/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 130
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_FITNESS_API_AGGREGATE_BUCKET_H_
31 #define GOOGLE_FITNESS_API_AGGREGATE_BUCKET_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/fitness_api/dataset.h"
40 #include "google/fitness_api/session.h"
41 
42 namespace Json {
43 class Value;
44 } // namespace Json
45 
46 namespace google_fitness_api {
47 using namespace googleapis;
48 
54 class AggregateBucket : public client::JsonCppData {
55  public:
61  static AggregateBucket* New();
62 
68  explicit AggregateBucket(const Json::Value& storage);
69 
75  explicit AggregateBucket(Json::Value* storage);
76 
80  virtual ~AggregateBucket();
81 
87  const StringPiece GetTypeName() const {
88  return StringPiece("google_fitness_api::AggregateBucket");
89  }
90 
96  bool has_activity() const {
97  return Storage().isMember("activity");
98  }
99 
103  void clear_activity() {
104  MutableStorage()->removeMember("activity");
105  }
106 
107 
111  int32 get_activity() const {
112  const Json::Value& storage = Storage("activity");
113  return client::JsonValueToCppValueHelper<int32 >(storage);
114  }
115 
123  void set_activity(int32 value) {
124  client::SetJsonValueFromCppValueHelper<int32 >(
125  value, MutableStorage("activity"));
126  }
127 
133  bool has_dataset() const {
134  return Storage().isMember("dataset");
135  }
136 
140  void clear_dataset() {
141  MutableStorage()->removeMember("dataset");
142  }
143 
144 
148  const client::JsonCppArray<Dataset > get_dataset() const;
149 
157  client::JsonCppArray<Dataset > mutable_dataset();
158 
164  bool has_end_time_millis() const {
165  return Storage().isMember("endTimeMillis");
166  }
167 
172  MutableStorage()->removeMember("endTimeMillis");
173  }
174 
175 
179  int64 get_end_time_millis() const {
180  const Json::Value& storage = Storage("endTimeMillis");
181  return client::JsonValueToCppValueHelper<int64 >(storage);
182  }
183 
192  void set_end_time_millis(int64 value) {
193  client::SetJsonValueFromCppValueHelper<int64 >(
194  value, MutableStorage("endTimeMillis"));
195  }
196 
202  bool has_session() const {
203  return Storage().isMember("session");
204  }
205 
209  void clear_session() {
210  MutableStorage()->removeMember("session");
211  }
212 
213 
217  const Session get_session() const;
218 
226  Session mutable_session();
227 
233  bool has_start_time_millis() const {
234  return Storage().isMember("startTimeMillis");
235  }
236 
241  MutableStorage()->removeMember("startTimeMillis");
242  }
243 
244 
248  int64 get_start_time_millis() const {
249  const Json::Value& storage = Storage("startTimeMillis");
250  return client::JsonValueToCppValueHelper<int64 >(storage);
251  }
252 
261  void set_start_time_millis(int64 value) {
262  client::SetJsonValueFromCppValueHelper<int64 >(
263  value, MutableStorage("startTimeMillis"));
264  }
265 
271  bool has_type() const {
272  return Storage().isMember("type");
273  }
274 
278  void clear_type() {
279  MutableStorage()->removeMember("type");
280  }
281 
282 
286  const StringPiece get_type() const {
287  const Json::Value& v = Storage("type");
288  if (v == Json::Value::null) return StringPiece("");
289  return StringPiece(v.asCString());
290  }
291 
300  void set_type(const StringPiece& value) {
301  *MutableStorage("type") = value.data();
302  }
303 
304  private:
305  void operator=(const AggregateBucket&);
306 }; // AggregateBucket
307 } // namespace google_fitness_api
308 #endif // GOOGLE_FITNESS_API_AGGREGATE_BUCKET_H_
void clear_end_time_millis()
Definition: aggregate_bucket.h:171
bool has_activity() const
Definition: aggregate_bucket.h:96
bool has_start_time_millis() const
Definition: aggregate_bucket.h:233
void clear_type()
Definition: aggregate_bucket.h:278
bool has_dataset() const
Definition: aggregate_bucket.h:133
void clear_activity()
Definition: aggregate_bucket.h:103
Definition: session.h:54
const StringPiece get_type() const
Definition: aggregate_bucket.h:286
Definition: aggregate_bucket.h:54
void set_type(const StringPiece &value)
Definition: aggregate_bucket.h:300
int32 get_activity() const
Definition: aggregate_bucket.h:111
void clear_dataset()
Definition: aggregate_bucket.h:140
void clear_session()
Definition: aggregate_bucket.h:209
Definition: aggregate_bucket.h:42
bool has_session() const
Definition: aggregate_bucket.h:202
void clear_start_time_millis()
Definition: aggregate_bucket.h:240
int64 get_start_time_millis() const
Definition: aggregate_bucket.h:248
void set_start_time_millis(int64 value)
Definition: aggregate_bucket.h:261
bool has_end_time_millis() const
Definition: aggregate_bucket.h:164
bool has_type() const
Definition: aggregate_bucket.h:271
int64 get_end_time_millis() const
Definition: aggregate_bucket.h:179
void set_end_time_millis(int64 value)
Definition: aggregate_bucket.h:192
Definition: aggregate_bucket.cc:44
void set_activity(int32 value)
Definition: aggregate_bucket.h:123
const StringPiece GetTypeName() const
Definition: aggregate_bucket.h:87