Skip to content

Commit 94a9faa

Browse files
committed
fixed AnalyticsQuery code example
1 parent 5b16739 commit 94a9faa

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

primitives/examples/analytics_query.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,8 @@ fn main() {
4141

4242
// Query with all possible fields (publisher/advertiser/admin)
4343
{
44-
let query_str = r#"limit=200
45-
&eventType=CLICK
46-
&metric=paid
47-
&segmentBy=country
48-
&timeframe=week
49-
&start=420
50-
&campaignId=0x936da01f9abd4d9d80c702af85c822a8
51-
&adUnit=QmcUVX7fvoLMM93uN2bD3wGTH8MXSxeL8hojYfL2Lhp7mR
52-
&adSlot=Qmasg8FrbuSQpjFu3kRnZF9beg8rEBFrqgi1uXDRwCbX5f
53-
&adSlotType=legacy_300x100
54-
&avertiser=0xDd589B43793934EF6Ad266067A0d1D4896b0dff0
55-
&publisher=0xE882ebF439207a70dDcCb39E13CA8506c9F45fD9
56-
&hostname=localhost
57-
&country=Bulgaria
58-
&osName=Windows
59-
&chains[0]=1&chains[1]=1337
60-
"#;
44+
let query_str = "limit=200&eventType=CLICK&metric=paid&segmentBy=country&timeframe=week&start=2022-08-04+09:00:00.000000000+UTC&campaignId=0x936da01f9abd4d9d80c702af85c822a8&adUnit=QmcUVX7fvoLMM93uN2bD3wGTH8MXSxeL8hojYfL2Lhp7mR&adSlot=Qmasg8FrbuSQpjFu3kRnZF9beg8rEBFrqgi1uXDRwCbX5f&adSlotType=legacy_300x100&advertiser=0xDd589B43793934EF6Ad266067A0d1D4896b0dff0&publisher=0xE882ebF439207a70dDcCb39E13CA8506c9F45fD9\
45+
&hostname=localhost&country=Bulgaria&osName=Windows&chains[0]=1&chains[1]=1337";
6146
let query: AnalyticsQuery = serde_qs::from_str(query_str).unwrap();
6247

6348
assert_eq!(query.limit, 200);
@@ -68,7 +53,7 @@ fn main() {
6853
query.time,
6954
Time {
7055
timeframe: Timeframe::Week,
71-
start: DateHour::from_ymdh(2021, 12, 31, 22),
56+
start: DateHour::from_ymdh(2022, 8, 4, 9),
7257
end: None,
7358
}
7459
);

0 commit comments

Comments
 (0)