forked from isuruceanu/gohubspot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
filter.go
110 lines (88 loc) · 3.78 KB
/
filter.go
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package gohubspot
const (
// Contact Operators:
IsNotEmpty ContactOperator = "IS_NOT_EMPTY"
IsEmpty ContactOperator = "IS_EMPTY"
Eq ContactOperator = "EQ"
NotEq ContactOperator = "NEQ"
Conatains ContactOperator = "CONTAINS"
Lt ContactOperator = "LT"
Lte ContactOperator = "LTE"
Gt ContactOperator = "GT"
SetAny ContactOperator = "SET_ANY"
SetNotAny ContactOperator = "SET_NOT_ANY"
SetEq ContactOperator = "SET_EQ"
SetNotEq ContactOperator = "SET_NEQ"
SetAll ContactOperator = "SET_ALL"
// ComputedProperty
DateOfLastFormSubmission ComputedProperty = "DATE_OF_LAST_FORM_SUBMISSION"
NumberOfFormsFilledOut ComputedProperty = "NUMBER_OF_FORMS_FILLED_OUT"
// ListMembership operator
InList ListMembershipOperator = "IN_LIST"
NotInList ListMembershipOperator = "NOT_IN_LIST"
// Form Submission
HasFilledOutForm FormSubmissionOperator = "HAS_FILLED_OUT_FORM"
HasNotFilledOutForm FormSubmissionOperator = "HAS_NOT_FILLED_OUT_FORM"
// Events
HasEvent EventsOpeerator = "HAS_EVENT"
NotHasEvent EventsOpeerator = "NOT_HAS_EVENT"
// PageViews
PageviewEq PageviewsOperator = "HAS_PAGEVIEW_EQ"
PageviewContains PageviewsOperator = "HAS_PAGEVIEW_CONTAINS"
PageviewMatchesRegexp PageviewsOperator = "HAS_PAGEVIEW_MATCHES_REGEX"
PageviewNotEq PageviewsOperator = "NOT_HAS_PAGEVIEW_EQ"
PageviewNotContains PageviewsOperator = "NOT_HAS_PAGEVIEW_CONTAINS"
PageviewNotMatchRegexpt PageviewsOperator = "NOT_HAS_PAGEVIEW_MATCHES_REGEX"
)
type Filters struct {
}
type Filter struct {
}
type FilterItem struct {
Operator FilterOperator
}
type ContactFilterItem struct {
Operator ContactOperator `json:"operator"`
Property string `json:"property"`
ComputedProperty ComputedProperty `json:"computed_property"`
Value interface{} `json:"value"`
Type string `json:"type"`
}
type ListMembershipFilterItem struct {
Operator ListMembershipOperator `json:"operator"`
ListID int `json:"list"`
}
type FormSubmissionFilterItem struct {
Operator FormSubmissionOperator `json:"operator"`
FormID int `json:"form"`
PageID int `json:"page"`
AfterTimestamp UnixTime `json:"afterTimestamp"`
Beforetimestamp UnixTime `json:"beforeTimestamp"`
}
type EventsFilterItem struct {
Operator EventsOpeerator `json:"operator"`
EventID int `json:"value"`
FirstOccurenceAfter UnixTime `json:"firstOccurrenceAfterTimestamp"`
FirstOccurenceBefore UnixTime `json:"firstOccurrenceBeforeTimestamp"`
LastOccurenceAfter UnixTime `json:"lastOccurrenceAfterTimestamp"`
LastOccurenceBefore UnixTime `json:"lastOccurrenceBeforeTimestamp"`
MinOccurence int `json:"minOccurrences"`
MaxOccurence int `json:"maxOccurrences"`
}
type PageViewFilterItem struct {
Operator PageviewsOperator `json:"operator"`
Value string `json:"value"`
FirstOccurenceAfter UnixTime `json:"firstOccurrenceAfterTimestamp"`
FirstOccurenceBefore UnixTime `json:"firstOccurrenceBeforeTimestamp"`
LastOccurenceAfter UnixTime `json:"lastOccurrenceAfterTimestamp"`
LastOccurenceBefore UnixTime `json:"lastOccurrenceBeforeTimestamp"`
MinOccurence int `json:"minOccurrences"`
MaxOccurence int `json:"maxOccurrences"`
}
type FilterOperator string
type ComputedProperty string
type ContactOperator FilterOperator
type ListMembershipOperator FilterOperator
type FormSubmissionOperator FilterOperator
type EventsOpeerator FilterOperator
type PageviewsOperator FilterOperator