@@ -68,8 +68,8 @@ type ByTime struct {
6868 Max interface {} `json:"max,required"`
6969 // Minimum results for each metric (object mapping metric names to values).
7070 // Currently always an empty object.
71- Min interface {} `json:"min,required"`
72- Query DNSAnalyticsQuery `json:"query,required"`
71+ Min interface {} `json:"min,required"`
72+ Query ByTimeQuery `json:"query,required"`
7373 // Total number of rows in the result.
7474 Rows float64 `json:"rows,required"`
7575 // Array of time intervals in the response data. Each interval is represented as an
@@ -109,8 +109,8 @@ type ByTimeData struct {
109109 Dimensions []string `json:"dimensions,required"`
110110 // Array with one item per requested metric. Each item is an array of values,
111111 // broken down by time interval.
112- Metrics []DNSAnalyticsNominalMetric `json:"metrics,required"`
113- JSON byTimeDataJSON `json:"-"`
112+ Metrics [][] float64 `json:"metrics,required"`
113+ JSON byTimeDataJSON `json:"-"`
114114}
115115
116116// byTimeDataJSON contains the JSON metadata for the struct [ByTimeData]
@@ -129,6 +129,73 @@ func (r byTimeDataJSON) RawJSON() string {
129129 return r .raw
130130}
131131
132+ type ByTimeQuery struct {
133+ // Array of dimension names.
134+ Dimensions []string `json:"dimensions,required"`
135+ // Limit number of returned metrics.
136+ Limit int64 `json:"limit,required"`
137+ // Array of metric names.
138+ Metrics []string `json:"metrics,required"`
139+ // Start date and time of requesting data period in ISO 8601 format.
140+ Since time.Time `json:"since,required" format:"date-time"`
141+ // Unit of time to group data by.
142+ TimeDelta ByTimeQueryTimeDelta `json:"time_delta,required"`
143+ // End date and time of requesting data period in ISO 8601 format.
144+ Until time.Time `json:"until,required" format:"date-time"`
145+ // Segmentation filter in 'attribute operator value' format.
146+ Filters string `json:"filters"`
147+ // Array of dimensions to sort by, where each dimension may be prefixed by -
148+ // (descending) or + (ascending).
149+ Sort []string `json:"sort"`
150+ JSON byTimeQueryJSON `json:"-"`
151+ }
152+
153+ // byTimeQueryJSON contains the JSON metadata for the struct [ByTimeQuery]
154+ type byTimeQueryJSON struct {
155+ Dimensions apijson.Field
156+ Limit apijson.Field
157+ Metrics apijson.Field
158+ Since apijson.Field
159+ TimeDelta apijson.Field
160+ Until apijson.Field
161+ Filters apijson.Field
162+ Sort apijson.Field
163+ raw string
164+ ExtraFields map [string ]apijson.Field
165+ }
166+
167+ func (r * ByTimeQuery ) UnmarshalJSON (data []byte ) (err error ) {
168+ return apijson .UnmarshalRoot (data , r )
169+ }
170+
171+ func (r byTimeQueryJSON ) RawJSON () string {
172+ return r .raw
173+ }
174+
175+ // Unit of time to group data by.
176+ type ByTimeQueryTimeDelta string
177+
178+ const (
179+ ByTimeQueryTimeDeltaAll ByTimeQueryTimeDelta = "all"
180+ ByTimeQueryTimeDeltaAuto ByTimeQueryTimeDelta = "auto"
181+ ByTimeQueryTimeDeltaYear ByTimeQueryTimeDelta = "year"
182+ ByTimeQueryTimeDeltaQuarter ByTimeQueryTimeDelta = "quarter"
183+ ByTimeQueryTimeDeltaMonth ByTimeQueryTimeDelta = "month"
184+ ByTimeQueryTimeDeltaWeek ByTimeQueryTimeDelta = "week"
185+ ByTimeQueryTimeDeltaDay ByTimeQueryTimeDelta = "day"
186+ ByTimeQueryTimeDeltaHour ByTimeQueryTimeDelta = "hour"
187+ ByTimeQueryTimeDeltaDekaminute ByTimeQueryTimeDelta = "dekaminute"
188+ ByTimeQueryTimeDeltaMinute ByTimeQueryTimeDelta = "minute"
189+ )
190+
191+ func (r ByTimeQueryTimeDelta ) IsKnown () bool {
192+ switch r {
193+ case ByTimeQueryTimeDeltaAll , ByTimeQueryTimeDeltaAuto , ByTimeQueryTimeDeltaYear , ByTimeQueryTimeDeltaQuarter , ByTimeQueryTimeDeltaMonth , ByTimeQueryTimeDeltaWeek , ByTimeQueryTimeDeltaDay , ByTimeQueryTimeDeltaHour , ByTimeQueryTimeDeltaDekaminute , ByTimeQueryTimeDeltaMinute :
194+ return true
195+ }
196+ return false
197+ }
198+
132199type AnalyticsReportBytimeGetParams struct {
133200 // Identifier.
134201 ZoneID param.Field [string ] `path:"zone_id,required"`
0 commit comments