30 #ifndef GOOGLE_FITNESS_API_DATA_SOURCE_H_ 31 #define GOOGLE_FITNESS_API_DATA_SOURCE_H_ 34 #include "googleapis/base/macros.h" 35 #include "googleapis/client/data/jsoncpp_data.h" 36 #include "googleapis/strings/stringpiece.h" 38 #include "google/fitness_api/application.h" 39 #include "google/fitness_api/data_type.h" 40 #include "google/fitness_api/device.h" 82 explicit DataSource(
const Json::Value& storage);
102 return StringPiece(
"google_fitness_api::DataSource");
111 return Storage().isMember(
"application");
118 MutableStorage()->removeMember(
"application");
143 return Storage().isMember(
"dataQualityStandard");
150 MutableStorage()->removeMember(
"dataQualityStandard");
159 const Json::Value& storage = Storage(
"dataQualityStandard");
160 return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
174 Json::Value* storage = MutableStorage(
"dataQualityStandard");
175 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
184 return Storage().isMember(
"dataStreamId");
191 MutableStorage()->removeMember(
"dataStreamId");
199 const Json::Value& v = Storage(
"dataStreamId");
200 if (v == Json::Value::null)
return StringPiece(
"");
201 return StringPiece(v.asCString());
244 *MutableStorage(
"dataStreamId") = value.data();
253 return Storage().isMember(
"dataStreamName");
260 MutableStorage()->removeMember(
"dataStreamName");
268 const Json::Value& v = Storage(
"dataStreamName");
269 if (v == Json::Value::null)
return StringPiece(
"");
270 return StringPiece(v.asCString());
285 *MutableStorage(
"dataStreamName") = value.data();
294 return Storage().isMember(
"dataType");
301 MutableStorage()->removeMember(
"dataType");
308 const DataType get_data_type()
const;
327 return Storage().isMember(
"device");
334 MutableStorage()->removeMember(
"device");
341 const Device get_device()
const;
359 return Storage().isMember(
"name");
366 MutableStorage()->removeMember(
"name");
374 const Json::Value& v = Storage(
"name");
375 if (v == Json::Value::null)
return StringPiece(
"");
376 return StringPiece(v.asCString());
387 *MutableStorage(
"name") = value.data();
396 return Storage().isMember(
"type");
403 MutableStorage()->removeMember(
"type");
411 const Json::Value& v = Storage(
"type");
412 if (v == Json::Value::null)
return StringPiece(
"");
413 return StringPiece(v.asCString());
425 *MutableStorage(
"type") = value.data();
432 #endif // GOOGLE_FITNESS_API_DATA_SOURCE_H_ bool has_data_stream_name() const
Definition: data_source.h:252
Definition: application.h:50
bool has_device() const
Definition: data_source.h:326
bool has_type() const
Definition: data_source.h:395
bool has_name() const
Definition: data_source.h:358
const StringPiece get_name() const
Definition: data_source.h:373
void clear_data_quality_standard()
Definition: data_source.h:149
const StringPiece GetTypeName() const
Definition: data_source.h:101
void clear_application()
Definition: data_source.h:117
void clear_data_stream_name()
Definition: data_source.h:259
void clear_data_type()
Definition: data_source.h:300
const client::JsonCppArray< string > get_data_quality_standard() const
Definition: data_source.h:158
const StringPiece get_data_stream_name() const
Definition: data_source.h:267
bool has_application() const
Definition: data_source.h:110
void set_data_stream_name(const StringPiece &value)
Definition: data_source.h:284
void set_type(const StringPiece &value)
Definition: data_source.h:424
void clear_data_stream_id()
Definition: data_source.h:190
bool has_data_type() const
Definition: data_source.h:293
void set_data_stream_id(const StringPiece &value)
Definition: data_source.h:243
Definition: aggregate_bucket.h:42
const StringPiece get_type() const
Definition: data_source.h:410
bool has_data_stream_id() const
Definition: data_source.h:183
void clear_type()
Definition: data_source.h:402
Definition: data_type.h:52
bool has_data_quality_standard() const
Definition: data_source.h:142
void clear_device()
Definition: data_source.h:333
Definition: data_source.h:68
void clear_name()
Definition: data_source.h:365
Definition: aggregate_bucket.cc:44
client::JsonCppArray< string > mutable_dataQualityStandard()
Definition: data_source.h:173
void set_name(const StringPiece &value)
Definition: data_source.h:386
const StringPiece get_data_stream_id() const
Definition: data_source.h:198