30 #ifndef GOOGLE_ANALYTICS_API_EXPERIMENT_H_ 31 #define GOOGLE_ANALYTICS_API_EXPERIMENT_H_ 34 #include "googleapis/base/integral_types.h" 35 #include "googleapis/base/macros.h" 36 #include "googleapis/client/data/jsoncpp_data.h" 37 #include "googleapis/client/util/date_time.h" 38 #include "googleapis/strings/stringpiece.h" 94 return StringPiece(
"google_analytics_api::ExperimentParentLink");
103 return Storage().isMember(
"href");
110 MutableStorage()->removeMember(
"href");
118 const Json::Value& v = Storage(
"href");
119 if (v == Json::Value::null)
return StringPiece(
"");
120 return StringPiece(v.asCString());
132 *MutableStorage(
"href") = value.data();
141 return Storage().isMember(
"type");
148 MutableStorage()->removeMember(
"type");
156 const Json::Value& v = Storage(
"type");
157 if (v == Json::Value::null)
return StringPiece(
"");
158 return StringPiece(v.asCString());
169 *MutableStorage(
"type") = value.data();
214 return StringPiece(
"google_analytics_api::ExperimentVariations");
223 return Storage().isMember(
"name");
230 MutableStorage()->removeMember(
"name");
238 const Json::Value& v = Storage(
"name");
239 if (v == Json::Value::null)
return StringPiece(
"");
240 return StringPiece(v.asCString());
253 *MutableStorage(
"name") = value.data();
262 return Storage().isMember(
"status");
269 MutableStorage()->removeMember(
"status");
277 const Json::Value& v = Storage(
"status");
278 if (v == Json::Value::null)
return StringPiece(
"");
279 return StringPiece(v.asCString());
292 *MutableStorage(
"status") = value.data();
301 return Storage().isMember(
"url");
308 MutableStorage()->removeMember(
"url");
316 const Json::Value& v = Storage(
"url");
317 if (v == Json::Value::null)
return StringPiece(
"");
318 return StringPiece(v.asCString());
330 *MutableStorage(
"url") = value.data();
339 return Storage().isMember(
"weight");
346 MutableStorage()->removeMember(
"weight");
354 const Json::Value& storage = Storage(
"weight");
355 return client::JsonValueToCppValueHelper<double >(storage);
367 client::SetJsonValueFromCppValueHelper<double >(
368 value, MutableStorage(
"weight"));
377 return Storage().isMember(
"won");
384 MutableStorage()->removeMember(
"won");
392 const Json::Value& storage = Storage(
"won");
393 return client::JsonValueToCppValueHelper<bool >(storage);
406 client::SetJsonValueFromCppValueHelper<bool >(
407 value, MutableStorage(
"won"));
425 explicit Experiment(
const Json::Value& storage);
445 return StringPiece(
"google_analytics_api::Experiment");
454 return Storage().isMember(
"accountId");
461 MutableStorage()->removeMember(
"accountId");
469 const Json::Value& v = Storage(
"accountId");
470 if (v == Json::Value::null)
return StringPiece(
"");
471 return StringPiece(v.asCString());
482 *MutableStorage(
"accountId") = value.data();
491 return Storage().isMember(
"created");
498 MutableStorage()->removeMember(
"created");
506 const Json::Value& storage = Storage(
"created");
507 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
518 client::SetJsonValueFromCppValueHelper<client::DateTime >(
519 value, MutableStorage(
"created"));
528 return Storage().isMember(
"description");
535 MutableStorage()->removeMember(
"description");
543 const Json::Value& v = Storage(
"description");
544 if (v == Json::Value::null)
return StringPiece(
"");
545 return StringPiece(v.asCString());
556 *MutableStorage(
"description") = value.data();
565 return Storage().isMember(
"editableInGaUi");
572 MutableStorage()->removeMember(
"editableInGaUi");
580 const Json::Value& storage = Storage(
"editableInGaUi");
581 return client::JsonValueToCppValueHelper<bool >(storage);
593 client::SetJsonValueFromCppValueHelper<bool >(
594 value, MutableStorage(
"editableInGaUi"));
603 return Storage().isMember(
"endTime");
610 MutableStorage()->removeMember(
"endTime");
618 const Json::Value& storage = Storage(
"endTime");
619 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
632 client::SetJsonValueFromCppValueHelper<client::DateTime >(
633 value, MutableStorage(
"endTime"));
642 return Storage().isMember(
"equalWeighting");
649 MutableStorage()->removeMember(
"equalWeighting");
657 const Json::Value& storage = Storage(
"equalWeighting");
658 return client::JsonValueToCppValueHelper<bool >(storage);
673 client::SetJsonValueFromCppValueHelper<bool >(
674 value, MutableStorage(
"equalWeighting"));
683 return Storage().isMember(
"id");
690 MutableStorage()->removeMember(
"id");
698 const Json::Value& v = Storage(
"id");
699 if (v == Json::Value::null)
return StringPiece(
"");
700 return StringPiece(v.asCString());
711 *MutableStorage(
"id") = value.data();
720 return Storage().isMember(
"internalWebPropertyId");
727 MutableStorage()->removeMember(
"internalWebPropertyId");
735 const Json::Value& v = Storage(
"internalWebPropertyId");
736 if (v == Json::Value::null)
return StringPiece(
"");
737 return StringPiece(v.asCString());
749 *MutableStorage(
"internalWebPropertyId") = value.data();
758 return Storage().isMember(
"kind");
765 MutableStorage()->removeMember(
"kind");
773 const Json::Value& v = Storage(
"kind");
774 if (v == Json::Value::null)
return StringPiece(
"");
775 return StringPiece(v.asCString());
786 *MutableStorage(
"kind") = value.data();
797 return Storage().isMember(
"minimumExperimentLengthInDays");
804 MutableStorage()->removeMember(
"minimumExperimentLengthInDays");
813 const Json::Value& storage = Storage(
"minimumExperimentLengthInDays");
814 return client::JsonValueToCppValueHelper<int32 >(storage);
827 client::SetJsonValueFromCppValueHelper<int32 >(
828 value, MutableStorage(
"minimumExperimentLengthInDays"));
837 return Storage().isMember(
"name");
844 MutableStorage()->removeMember(
"name");
852 const Json::Value& v = Storage(
"name");
853 if (v == Json::Value::null)
return StringPiece(
"");
854 return StringPiece(v.asCString());
866 *MutableStorage(
"name") = value.data();
875 return Storage().isMember(
"objectiveMetric");
882 MutableStorage()->removeMember(
"objectiveMetric");
890 const Json::Value& v = Storage(
"objectiveMetric");
891 if (v == Json::Value::null)
return StringPiece(
"");
892 return StringPiece(v.asCString());
907 *MutableStorage(
"objectiveMetric") = value.data();
916 return Storage().isMember(
"optimizationType");
923 MutableStorage()->removeMember(
"optimizationType");
931 const Json::Value& v = Storage(
"optimizationType");
932 if (v == Json::Value::null)
return StringPiece(
"");
933 return StringPiece(v.asCString());
947 *MutableStorage(
"optimizationType") = value.data();
956 return Storage().isMember(
"parentLink");
963 MutableStorage()->removeMember(
"parentLink");
971 const Json::Value& storage = Storage(
"parentLink");
972 return client::JsonValueToCppValueHelper<ExperimentParentLink >(storage);
985 Json::Value* storage = MutableStorage(
"parentLink");
986 return client::JsonValueToMutableCppValueHelper<ExperimentParentLink >(storage);
995 return Storage().isMember(
"profileId");
1002 MutableStorage()->removeMember(
"profileId");
1010 const Json::Value& v = Storage(
"profileId");
1011 if (v == Json::Value::null)
return StringPiece(
"");
1012 return StringPiece(v.asCString());
1024 *MutableStorage(
"profileId") = value.data();
1033 return Storage().isMember(
"reasonExperimentEnded");
1040 MutableStorage()->removeMember(
"reasonExperimentEnded");
1048 const Json::Value& v = Storage(
"reasonExperimentEnded");
1049 if (v == Json::Value::null)
return StringPiece(
"");
1050 return StringPiece(v.asCString());
1066 *MutableStorage(
"reasonExperimentEnded") = value.data();
1077 return Storage().isMember(
"rewriteVariationUrlsAsOriginal");
1084 MutableStorage()->removeMember(
"rewriteVariationUrlsAsOriginal");
1093 const Json::Value& storage = Storage(
"rewriteVariationUrlsAsOriginal");
1094 return client::JsonValueToCppValueHelper<bool >(storage);
1107 client::SetJsonValueFromCppValueHelper<bool >(
1108 value, MutableStorage(
"rewriteVariationUrlsAsOriginal"));
1117 return Storage().isMember(
"selfLink");
1124 MutableStorage()->removeMember(
"selfLink");
1132 const Json::Value& v = Storage(
"selfLink");
1133 if (v == Json::Value::null)
return StringPiece(
"");
1134 return StringPiece(v.asCString());
1145 *MutableStorage(
"selfLink") = value.data();
1154 return Storage().isMember(
"servingFramework");
1161 MutableStorage()->removeMember(
"servingFramework");
1169 const Json::Value& v = Storage(
"servingFramework");
1170 if (v == Json::Value::null)
return StringPiece(
"");
1171 return StringPiece(v.asCString());
1197 *MutableStorage(
"servingFramework") = value.data();
1206 return Storage().isMember(
"snippet");
1213 MutableStorage()->removeMember(
"snippet");
1221 const Json::Value& v = Storage(
"snippet");
1222 if (v == Json::Value::null)
return StringPiece(
"");
1223 return StringPiece(v.asCString());
1235 *MutableStorage(
"snippet") = value.data();
1244 return Storage().isMember(
"startTime");
1251 MutableStorage()->removeMember(
"startTime");
1259 const Json::Value& storage = Storage(
"startTime");
1260 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
1273 client::SetJsonValueFromCppValueHelper<client::DateTime >(
1274 value, MutableStorage(
"startTime"));
1283 return Storage().isMember(
"status");
1290 MutableStorage()->removeMember(
"status");
1298 const Json::Value& v = Storage(
"status");
1299 if (v == Json::Value::null)
return StringPiece(
"");
1300 return StringPiece(v.asCString());
1313 *MutableStorage(
"status") = value.data();
1322 return Storage().isMember(
"trafficCoverage");
1329 MutableStorage()->removeMember(
"trafficCoverage");
1337 const Json::Value& storage = Storage(
"trafficCoverage");
1338 return client::JsonValueToCppValueHelper<double >(storage);
1352 client::SetJsonValueFromCppValueHelper<double >(
1353 value, MutableStorage(
"trafficCoverage"));
1362 return Storage().isMember(
"updated");
1369 MutableStorage()->removeMember(
"updated");
1377 const Json::Value& storage = Storage(
"updated");
1378 return client::JsonValueToCppValueHelper<client::DateTime >(storage);
1389 client::SetJsonValueFromCppValueHelper<client::DateTime >(
1390 value, MutableStorage(
"updated"));
1399 return Storage().isMember(
"variations");
1406 MutableStorage()->removeMember(
"variations");
1414 const Json::Value& storage = Storage(
"variations");
1415 return client::JsonValueToCppValueHelper<client::JsonCppArray<ExperimentVariations > >(storage);
1430 Json::Value* storage = MutableStorage(
"variations");
1431 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<ExperimentVariations > >(storage);
1440 return Storage().isMember(
"webPropertyId");
1447 MutableStorage()->removeMember(
"webPropertyId");
1455 const Json::Value& v = Storage(
"webPropertyId");
1456 if (v == Json::Value::null)
return StringPiece(
"");
1457 return StringPiece(v.asCString());
1469 *MutableStorage(
"webPropertyId") = value.data();
1478 return Storage().isMember(
"winnerConfidenceLevel");
1485 MutableStorage()->removeMember(
"winnerConfidenceLevel");
1493 const Json::Value& storage = Storage(
"winnerConfidenceLevel");
1494 return client::JsonValueToCppValueHelper<double >(storage);
1507 client::SetJsonValueFromCppValueHelper<double >(
1508 value, MutableStorage(
"winnerConfidenceLevel"));
1517 return Storage().isMember(
"winnerFound");
1524 MutableStorage()->removeMember(
"winnerFound");
1532 const Json::Value& storage = Storage(
"winnerFound");
1533 return client::JsonValueToCppValueHelper<bool >(storage);
1545 client::SetJsonValueFromCppValueHelper<bool >(
1546 value, MutableStorage(
"winnerFound"));
1553 #endif // GOOGLE_ANALYTICS_API_EXPERIMENT_H_ const StringPiece get_self_link() const
Definition: experiment.h:1131
Definition: experiment.h:52
const StringPiece get_profile_id() const
Definition: experiment.h:1009
const StringPiece get_kind() const
Definition: experiment.h:772
void clear_equal_weighting()
Definition: experiment.h:648
void clear_profile_id()
Definition: experiment.h:1001
void set_optimization_type(const StringPiece &value)
Definition: experiment.h:946
void clear_web_property_id()
Definition: experiment.h:1446
bool get_editable_in_ga_ui() const
Definition: experiment.h:579
void clear_variations()
Definition: experiment.h:1405
bool has_equal_weighting() const
Definition: experiment.h:641
const StringPiece get_href() const
Definition: experiment.h:117
const StringPiece get_internal_web_property_id() const
Definition: experiment.h:734
void set_winner_confidence_level(double value)
Definition: experiment.h:1506
void set_web_property_id(const StringPiece &value)
Definition: experiment.h:1468
void clear_optimization_type()
Definition: experiment.h:922
ExperimentParentLink mutable_parentLink()
Definition: experiment.h:984
client::JsonCppArray< ExperimentVariations > mutable_variations()
Definition: experiment.h:1429
bool has_id() const
Definition: experiment.h:682
const StringPiece GetTypeName() const
Definition: experiment.h:444
void clear_traffic_coverage()
Definition: experiment.h:1328
void set_account_id(const StringPiece &value)
Definition: experiment.h:481
void clear_self_link()
Definition: experiment.h:1123
bool has_created() const
Definition: experiment.h:490
const ExperimentParentLink get_parent_link() const
Definition: experiment.h:970
bool has_kind() const
Definition: experiment.h:757
void clear_id()
Definition: experiment.h:689
const StringPiece GetTypeName() const
Definition: experiment.h:93
const StringPiece get_name() const
Definition: experiment.h:851
client::DateTime get_start_time() const
Definition: experiment.h:1258
bool has_href() const
Definition: experiment.h:102
bool has_url() const
Definition: experiment.h:300
const StringPiece GetTypeName() const
Definition: experiment.h:213
bool get_equal_weighting() const
Definition: experiment.h:656
void set_kind(const StringPiece &value)
Definition: experiment.h:785
void clear_snippet()
Definition: experiment.h:1212
void set_minimum_experiment_length_in_days(int32 value)
Definition: experiment.h:826
void clear_account_id()
Definition: experiment.h:460
bool has_winner_confidence_level() const
Definition: experiment.h:1477
bool has_parent_link() const
Definition: experiment.h:955
void set_start_time(client::DateTime value)
Definition: experiment.h:1272
client::DateTime get_created() const
Definition: experiment.h:505
const StringPiece get_type() const
Definition: experiment.h:155
void set_url(const StringPiece &value)
Definition: experiment.h:329
void clear_minimum_experiment_length_in_days()
Definition: experiment.h:803
void set_objective_metric(const StringPiece &value)
Definition: experiment.h:906
bool get_rewrite_variation_urls_as_original() const
Definition: experiment.h:1092
bool has_profile_id() const
Definition: experiment.h:994
Definition: experiment.h:180
double get_weight() const
Definition: experiment.h:353
const StringPiece get_id() const
Definition: experiment.h:697
void set_winner_found(bool value)
Definition: experiment.h:1544
void set_traffic_coverage(double value)
Definition: experiment.h:1351
void set_name(const StringPiece &value)
Definition: experiment.h:865
void clear_status()
Definition: experiment.h:1289
bool has_minimum_experiment_length_in_days() const
Definition: experiment.h:796
void set_type(const StringPiece &value)
Definition: experiment.h:168
void set_end_time(client::DateTime value)
Definition: experiment.h:631
void clear_status()
Definition: experiment.h:268
void set_updated(client::DateTime value)
Definition: experiment.h:1388
const StringPiece get_web_property_id() const
Definition: experiment.h:1454
client::DateTime get_updated() const
Definition: experiment.h:1376
void clear_weight()
Definition: experiment.h:345
const StringPiece get_name() const
Definition: experiment.h:237
void set_snippet(const StringPiece &value)
Definition: experiment.h:1234
bool has_status() const
Definition: experiment.h:261
bool has_internal_web_property_id() const
Definition: experiment.h:719
void clear_end_time()
Definition: experiment.h:609
bool has_rewrite_variation_urls_as_original() const
Definition: experiment.h:1076
const StringPiece get_optimization_type() const
Definition: experiment.h:930
bool has_status() const
Definition: experiment.h:1282
void set_name(const StringPiece &value)
Definition: experiment.h:252
void clear_updated()
Definition: experiment.h:1368
bool has_account_id() const
Definition: experiment.h:453
void set_serving_framework(const StringPiece &value)
Definition: experiment.h:1196
void clear_winner_found()
Definition: experiment.h:1523
bool has_end_time() const
Definition: experiment.h:602
const StringPiece get_objective_metric() const
Definition: experiment.h:889
bool has_traffic_coverage() const
Definition: experiment.h:1321
bool get_won() const
Definition: experiment.h:391
const StringPiece get_status() const
Definition: experiment.h:276
const StringPiece get_snippet() const
Definition: experiment.h:1220
void set_editable_in_ga_ui(bool value)
Definition: experiment.h:592
void clear_created()
Definition: experiment.h:497
bool has_name() const
Definition: experiment.h:836
Definition: experiment.h:60
Definition: account.cc:41
bool has_objective_metric() const
Definition: experiment.h:874
bool has_winner_found() const
Definition: experiment.h:1516
void set_id(const StringPiece &value)
Definition: experiment.h:710
bool has_start_time() const
Definition: experiment.h:1243
const StringPiece get_status() const
Definition: experiment.h:1297
void clear_reason_experiment_ended()
Definition: experiment.h:1039
void set_status(const StringPiece &value)
Definition: experiment.h:291
int32 get_minimum_experiment_length_in_days() const
Definition: experiment.h:812
void set_created(client::DateTime value)
Definition: experiment.h:517
void clear_type()
Definition: experiment.h:147
bool has_type() const
Definition: experiment.h:140
bool has_name() const
Definition: experiment.h:222
void clear_objective_metric()
Definition: experiment.h:881
void clear_description()
Definition: experiment.h:534
void set_rewrite_variation_urls_as_original(bool value)
Definition: experiment.h:1106
void clear_editable_in_ga_ui()
Definition: experiment.h:571
void set_profile_id(const StringPiece &value)
Definition: experiment.h:1023
void clear_name()
Definition: experiment.h:229
const StringPiece get_description() const
Definition: experiment.h:542
void clear_url()
Definition: experiment.h:307
void clear_start_time()
Definition: experiment.h:1250
void clear_serving_framework()
Definition: experiment.h:1160
bool has_variations() const
Definition: experiment.h:1398
void clear_href()
Definition: experiment.h:109
void clear_won()
Definition: experiment.h:383
void set_won(bool value)
Definition: experiment.h:405
bool has_won() const
Definition: experiment.h:376
bool get_winner_found() const
Definition: experiment.h:1531
void set_self_link(const StringPiece &value)
Definition: experiment.h:1144
void clear_kind()
Definition: experiment.h:764
bool has_serving_framework() const
Definition: experiment.h:1153
const client::JsonCppArray< ExperimentVariations > get_variations() const
Definition: experiment.h:1413
void clear_name()
Definition: experiment.h:843
void set_weight(double value)
Definition: experiment.h:366
const StringPiece get_reason_experiment_ended() const
Definition: experiment.h:1047
bool has_self_link() const
Definition: experiment.h:1116
bool has_reason_experiment_ended() const
Definition: experiment.h:1032
bool has_weight() const
Definition: experiment.h:338
bool has_description() const
Definition: experiment.h:527
void clear_rewrite_variation_urls_as_original()
Definition: experiment.h:1083
client::DateTime get_end_time() const
Definition: experiment.h:617
void set_description(const StringPiece &value)
Definition: experiment.h:555
bool has_optimization_type() const
Definition: experiment.h:915
bool has_updated() const
Definition: experiment.h:1361
void set_reason_experiment_ended(const StringPiece &value)
Definition: experiment.h:1065
void clear_winner_confidence_level()
Definition: experiment.h:1484
const StringPiece get_account_id() const
Definition: experiment.h:468
bool has_editable_in_ga_ui() const
Definition: experiment.h:564
void set_equal_weighting(bool value)
Definition: experiment.h:672
void clear_parent_link()
Definition: experiment.h:962
void clear_internal_web_property_id()
Definition: experiment.h:726
bool has_web_property_id() const
Definition: experiment.h:1439
void set_href(const StringPiece &value)
Definition: experiment.h:131
void set_status(const StringPiece &value)
Definition: experiment.h:1312
double get_winner_confidence_level() const
Definition: experiment.h:1492
bool has_snippet() const
Definition: experiment.h:1205
double get_traffic_coverage() const
Definition: experiment.h:1336
const StringPiece get_url() const
Definition: experiment.h:315
void set_internal_web_property_id(const StringPiece &value)
Definition: experiment.h:748
const StringPiece get_serving_framework() const
Definition: experiment.h:1168