30 #ifndef GOOGLE_ANALYTICS_API_SEGMENT_H_ 31 #define GOOGLE_ANALYTICS_API_SEGMENT_H_ 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" 51 class Segment :
public client::JsonCppData {
65 explicit Segment(
const Json::Value& storage);
72 explicit Segment(Json::Value* storage);
85 return StringPiece(
"google_analytics_api::Segment");
94 return Storage().isMember(
"created");
101 MutableStorage()->removeMember(
"created");
109 const Json::Value& storage = Storage(
"created");
110 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
121 client::SetJsonValueFromCppValueHelper<client::DateTime >(
122 value, MutableStorage(
"created"));
131 return Storage().isMember(
"definition");
138 MutableStorage()->removeMember(
"definition");
146 const Json::Value& v = Storage(
"definition");
147 if (v == Json::Value::null)
return StringPiece(
"");
148 return StringPiece(v.asCString());
159 *MutableStorage(
"definition") = value.data();
168 return Storage().isMember(
"id");
175 MutableStorage()->removeMember(
"id");
183 const Json::Value& v = Storage(
"id");
184 if (v == Json::Value::null)
return StringPiece(
"");
185 return StringPiece(v.asCString());
196 *MutableStorage(
"id") = value.data();
205 return Storage().isMember(
"kind");
212 MutableStorage()->removeMember(
"kind");
220 const Json::Value& v = Storage(
"kind");
221 if (v == Json::Value::null)
return StringPiece(
"");
222 return StringPiece(v.asCString());
233 *MutableStorage(
"kind") = value.data();
242 return Storage().isMember(
"name");
249 MutableStorage()->removeMember(
"name");
257 const Json::Value& v = Storage(
"name");
258 if (v == Json::Value::null)
return StringPiece(
"");
259 return StringPiece(v.asCString());
270 *MutableStorage(
"name") = value.data();
279 return Storage().isMember(
"segmentId");
286 MutableStorage()->removeMember(
"segmentId");
294 const Json::Value& v = Storage(
"segmentId");
295 if (v == Json::Value::null)
return StringPiece(
"");
296 return StringPiece(v.asCString());
307 *MutableStorage(
"segmentId") = value.data();
316 return Storage().isMember(
"selfLink");
323 MutableStorage()->removeMember(
"selfLink");
331 const Json::Value& v = Storage(
"selfLink");
332 if (v == Json::Value::null)
return StringPiece(
"");
333 return StringPiece(v.asCString());
344 *MutableStorage(
"selfLink") = value.data();
353 return Storage().isMember(
"type");
360 MutableStorage()->removeMember(
"type");
368 const Json::Value& v = Storage(
"type");
369 if (v == Json::Value::null)
return StringPiece(
"");
370 return StringPiece(v.asCString());
381 *MutableStorage(
"type") = value.data();
390 return Storage().isMember(
"updated");
397 MutableStorage()->removeMember(
"updated");
405 const Json::Value& storage = Storage(
"updated");
406 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
417 client::SetJsonValueFromCppValueHelper<client::DateTime >(
418 value, MutableStorage(
"updated"));
422 void operator=(
const Segment&);
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
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
void set_kind(const StringPiece &value)
Definition: segment.h:232
bool has_segment_id() const
Definition: segment.h:278