decisions.go raw
1 package pulsar
2
3 // DecisionsQueryParams contains common query parameters for decisions endpoints
4 type DecisionsQueryParams struct {
5 Start int64 `url:"start,omitempty"`
6 End int64 `url:"end,omitempty"`
7 Period string `url:"period,omitempty"`
8 Area string `url:"area,omitempty"`
9 ASN string `url:"asn,omitempty"`
10 Job string `url:"job,omitempty"`
11 Jobs []string `url:"jobs,omitempty"`
12 Record string `url:"record,omitempty"`
13 Result string `url:"result,omitempty"`
14 Agg string `url:"agg,omitempty"`
15 Geo string `url:"geo,omitempty"`
16 ZoneID string `url:"zone_id,omitempty"`
17 CustomerID int64 `url:"customer_id,omitempty"`
18 }
19
20 // DecisionsResponse wraps the response for GetDecisions
21 type DecisionsResponse struct {
22 Graphs []*DecisionsGraph `json:"graphs,omitempty"`
23 Total int64 `json:"total,omitempty"`
24 }
25
26 // DecisionsGraph represents a decision graph with tags
27 type DecisionsGraph struct {
28 Count int64 `json:"count,omitempty"`
29 GraphData []*DecisionsGraphData `json:"graph_data,omitempty"`
30 Avg int64 `json:"avg,omitempty"`
31 Tags *Tags `json:"tags,omitempty"`
32 }
33
34 // DecisionsGraphData represents a single graph data point
35 type DecisionsGraphData struct {
36 Timestamp int64 `json:"timestamp,omitempty"`
37 Count int64 `json:"count,omitempty"`
38 }
39
40 // Tags represents tag parameters for decisions
41 type Tags struct {
42 JobID string `json:"job_id,omitempty"`
43 }
44
45 // DecisionsGraphRegionResponse wraps the response for GetDecisionsGraphRegion
46 type DecisionsGraphRegionResponse struct {
47 Data []*DecisionsGraphRegionData `json:"data,omitempty"`
48 Unit *string `json:"unit,omitempty"`
49 }
50
51 // DecisionsGraphRegionData represents regional graph data
52 type DecisionsGraphRegionData struct {
53 Region string `json:"region,omitempty"`
54 Counts []*JobIDCounts `json:"counts,omitempty"`
55 }
56
57 // DecisionsGraphTimeResponse wraps the response for GetDecisionsGraphTime
58 type DecisionsGraphTimeResponse struct {
59 Data []*DecisionsGraphTimeData `json:"data,omitempty"`
60 Unit *string `json:"unit,omitempty"`
61 }
62
63 // DecisionsGraphTimeData represents time-based graph data
64 type DecisionsGraphTimeData struct {
65 Counts []*JobIDCounts `json:"counts,omitempty"`
66 Timestamp int64 `json:"timestamp,omitempty"`
67 }
68
69 // DecisionsAreaResponse wraps the response for GetDecisionsArea
70 type DecisionsAreaResponse struct {
71 Areas []*AreaData `json:"areas,omitempty"`
72 }
73
74 // AreaData represents area-specific decision data
75 type AreaData struct {
76 AreaName string `json:"area_name,omitempty"`
77 Parent *string `json:"parent,omitempty"`
78 Count int64 `json:"count,omitempty"`
79 JobCounts []*JobIDCounts `json:"job_counts,omitempty"`
80 }
81
82 // JobIDCounts represents job-specific counts
83 type JobIDCounts struct {
84 JobID string `json:"job_id,omitempty"`
85 Count int64 `json:"count,omitempty"`
86 }
87
88 // DecisionsASNResponse wraps the response for GetDecisionsAsn
89 type DecisionsASNResponse struct {
90 Data []*ASNData `json:"data,omitempty"`
91 Unit *string `json:"unit,omitempty"`
92 }
93
94 // ASNData represents ASN-specific decision data
95 type ASNData struct {
96 ASN int64 `json:"asn,omitempty"`
97 Count int64 `json:"count,omitempty"`
98 TrafficDistribution float64 `json:"traffic_distribution,omitempty"`
99 PreviousDay float64 `json:"previousDay,omitempty"`
100 PreviousWeek float64 `json:"previousWeek,omitempty"`
101 }
102
103 // DecisionsResultsTimeResponse wraps the response for GetDecisionsResultsTime
104 type DecisionsResultsTimeResponse struct {
105 Data []*ResultsTimeData `json:"data,omitempty"`
106 }
107
108 // ResultsTimeData represents time-based results data
109 type ResultsTimeData struct {
110 Timestamp int64 `json:"timestamp,omitempty"`
111 Results []*ResultCount `json:"results,omitempty"`
112 }
113
114 // ResultCount represents a result with its count
115 type ResultCount struct {
116 Result string `json:"result,omitempty"`
117 Count int64 `json:"count,omitempty"`
118 }
119
120 // DecisionsResultsAreaResponse wraps the response for GetDecisionsResultsArea
121 type DecisionsResultsAreaResponse struct {
122 Area []*DecisionsResultsArea `json:"area,omitempty"`
123 }
124
125 // DecisionsResultsArea represents area-based results data
126 type DecisionsResultsArea struct {
127 Area string `json:"area,omitempty"`
128 Parent string `json:"parent,omitempty"`
129 DecisionCount int64 `json:"decision_count,omitempty"`
130 Results []*ResultCount `json:"results,omitempty"`
131 }
132
133 // FiltersTimeResponse wraps the response for GetFiltersTime
134 type FiltersTimeResponse struct {
135 Filters []*FilterTimeData `json:"filters,omitempty"`
136 }
137
138 // FilterTimeData represents time-based filter data
139 type FilterTimeData struct {
140 Timestamp int64 `json:"timestamp,omitempty"`
141 Filters map[string]int64 `json:"filters,omitempty"`
142 }
143
144 // DecisionCustomerResponse wraps the response for customer decision endpoints
145 type DecisionCustomerResponse struct {
146 Data []*CustomerDecisionData `json:"data,omitempty"`
147 }
148
149 // CustomerDecisionData represents customer-specific decision data
150 type CustomerDecisionData struct {
151 Timestamp int64 `json:"timestamp,omitempty"`
152 Total int64 `json:"total,omitempty"`
153 JobCounts map[string]int64 `json:"job_counts,omitempty"`
154 }
155
156 // DecisionRecordResponse wraps the response for record decision endpoints
157 type DecisionRecordResponse struct {
158 Data []*RecordDecisionData `json:"data,omitempty"`
159 }
160
161 // RecordDecisionData represents record-specific decision data
162 type RecordDecisionData struct {
163 Timestamp int64 `json:"timestamp,omitempty"`
164 Domain string `json:"domain,omitempty"`
165 RecType string `json:"rec_type,omitempty"`
166 Total int64 `json:"total,omitempty"`
167 JobCounts map[string]int64 `json:"job_counts,omitempty"`
168 }
169
170 // DecisionTotalResponse wraps the response for GetDecisionTotal
171 type DecisionTotalResponse struct {
172 Total int64 `json:"total,omitempty"`
173 }
174
175 // DecisionsRecordsResponse wraps the response for GetPulsarDecisionsRecords
176 type DecisionsRecordsResponse struct {
177 Total int64 `json:"total,omitempty"`
178 Records map[string]*Record `json:"records,omitempty"`
179 }
180
181 // Record represents a record with count and percentage
182 type Record struct {
183 Count int64 `json:"count,omitempty"`
184 PercentageOfTotal float64 `json:"percentage_of_total,omitempty"`
185 }
186
187 // DecisionsResultsRecordResponse wraps the response for GetPulsarDecisionsResultsRecord
188 type DecisionsResultsRecordResponse struct {
189 Record map[string]*Results `json:"record,omitempty"`
190 }
191
192 // Results represents results with decision count and result map
193 type Results struct {
194 DecisionCount int64 `json:"decision_count,omitempty"`
195 Results map[string]int64 `json:"results,omitempty"`
196 }
197