-
Notifications
You must be signed in to change notification settings - Fork 10
/
AnalyticsQueryRequest.ts
90 lines (78 loc) · 2.34 KB
/
AnalyticsQueryRequest.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import {map, mapArray} from '../common/Mapper';
import AnalyticsAbstractFilter from './AnalyticsAbstractFilter';
import AnalyticsAttribute from './AnalyticsAttribute';
import AnalyticsInterval from './AnalyticsInterval';
import AnalyticsOrderByEntry from './AnalyticsOrderByEntry';
import AnalyticsQueryTimeframe from './AnalyticsQueryTimeframe';
/**
* @export
* @class AnalyticsQueryRequest
*/
export class AnalyticsQueryRequest extends AnalyticsQueryTimeframe {
/**
* Analytics license key (required)
* @type {string}
* @memberof AnalyticsQueryRequest
*/
public licenseKey?: string;
/**
* Analytics Query Filters Each filter requires 3 properties: name, operator and value. Valid operators are [IN, EQ, NE, LT, LTE, GT, GTE, CONTAINS, NOTCONTAINS]
* @type {AnalyticsAbstractFilter[]}
* @memberof AnalyticsQueryRequest
*/
public filters?: AnalyticsAbstractFilter[];
/**
* @type {AnalyticsOrderByEntry[]}
* @memberof AnalyticsQueryRequest
*/
public orderBy?: AnalyticsOrderByEntry[];
/**
* @type {AnalyticsAttribute}
* @memberof AnalyticsQueryRequest
*/
public dimension?: AnalyticsAttribute;
/**
* @type {AnalyticsInterval}
* @memberof AnalyticsQueryRequest
*/
public interval?: AnalyticsInterval;
/**
* @type {AnalyticsAttribute[]}
* @memberof AnalyticsQueryRequest
*/
public groupBy?: AnalyticsAttribute[];
/**
* Whether context data should be included in the response
* @type {boolean}
* @memberof AnalyticsQueryRequest
*/
public includeContext?: boolean;
/**
* Maximum number of rows returned (max. 200)
* @type {number}
* @memberof AnalyticsQueryRequest
*/
public limit?: number;
/**
* Offset of data
* @type {number}
* @memberof AnalyticsQueryRequest
*/
public offset?: number;
constructor(obj?: Partial<AnalyticsQueryRequest>) {
super(obj);
if(!obj) {
return;
}
this.licenseKey = map(obj.licenseKey);
this.filters = mapArray(obj.filters, AnalyticsAbstractFilter);
this.orderBy = mapArray(obj.orderBy, AnalyticsOrderByEntry);
this.dimension = map(obj.dimension);
this.interval = map(obj.interval);
this.groupBy = mapArray(obj.groupBy);
this.includeContext = map(obj.includeContext);
this.limit = map(obj.limit);
this.offset = map(obj.offset);
}
}
export default AnalyticsQueryRequest;