fitness  v1
value.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_VALUE_H_
31 #define GOOGLE_FITNESS_API_VALUE_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/value_map_val_entry.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_fitness_api {
46 using namespace googleapis;
47 
56 class Value : public client::JsonCppData {
57  public:
63  static Value* New();
64 
70  explicit Value(const Json::Value& storage);
71 
77  explicit Value(Json::Value* storage);
78 
82  virtual ~Value();
83 
89  const StringPiece GetTypeName() const {
90  return StringPiece("google_fitness_api::Value");
91  }
92 
98  bool has_fp_val() const {
99  return Storage().isMember("fpVal");
100  }
101 
105  void clear_fp_val() {
106  MutableStorage()->removeMember("fpVal");
107  }
108 
109 
113  double get_fp_val() const {
114  const Json::Value& storage = Storage("fpVal");
115  return client::JsonValueToCppValueHelper<double >(storage);
116  }
117 
125  void set_fp_val(double value) {
126  client::SetJsonValueFromCppValueHelper<double >(
127  value, MutableStorage("fpVal"));
128  }
129 
135  bool has_int_val() const {
136  return Storage().isMember("intVal");
137  }
138 
142  void clear_int_val() {
143  MutableStorage()->removeMember("intVal");
144  }
145 
146 
150  int32 get_int_val() const {
151  const Json::Value& storage = Storage("intVal");
152  return client::JsonValueToCppValueHelper<int32 >(storage);
153  }
154 
162  void set_int_val(int32 value) {
163  client::SetJsonValueFromCppValueHelper<int32 >(
164  value, MutableStorage("intVal"));
165  }
166 
172  bool has_map_val() const {
173  return Storage().isMember("mapVal");
174  }
175 
179  void clear_map_val() {
180  MutableStorage()->removeMember("mapVal");
181  }
182 
183 
187  const client::JsonCppArray<ValueMapValEntry > get_map_val() const;
188 
199  client::JsonCppArray<ValueMapValEntry > mutable_mapVal();
200 
206  bool has_string_val() const {
207  return Storage().isMember("stringVal");
208  }
209 
214  MutableStorage()->removeMember("stringVal");
215  }
216 
217 
221  const StringPiece get_string_val() const {
222  const Json::Value& v = Storage("stringVal");
223  if (v == Json::Value::null) return StringPiece("");
224  return StringPiece(v.asCString());
225  }
226 
236  void set_string_val(const StringPiece& value) {
237  *MutableStorage("stringVal") = value.data();
238  }
239 
240  private:
241  void operator=(const Value&);
242 }; // Value
243 } // namespace google_fitness_api
244 #endif // GOOGLE_FITNESS_API_VALUE_H_
bool has_string_val() const
Definition: value.h:206
double get_fp_val() const
Definition: value.h:113
bool has_int_val() const
Definition: value.h:135
void set_fp_val(double value)
Definition: value.h:125
void clear_fp_val()
Definition: value.h:105
void set_int_val(int32 value)
Definition: value.h:162
void set_string_val(const StringPiece &value)
Definition: value.h:236
bool has_map_val() const
Definition: value.h:172
Definition: value.h:56
void clear_string_val()
Definition: value.h:213
Definition: aggregate_bucket.h:42
bool has_fp_val() const
Definition: value.h:98
const StringPiece GetTypeName() const
Definition: value.h:89
Definition: aggregate_bucket.cc:44
const StringPiece get_string_val() const
Definition: value.h:221
int32 get_int_val() const
Definition: value.h:150
void clear_map_val()
Definition: value.h:179
void clear_int_val()
Definition: value.h:142