/
verifiedbottop.go
576 lines (497 loc) · 24.5 KB
/
verifiedbottop.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package radar
import (
"context"
"net/http"
"net/url"
"time"
"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/apiquery"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/option"
)
// VerifiedBotTopService contains methods and other services that help with
// interacting with the cloudflare API. Note, unlike clients, this service does not
// read variables from the environment automatically. You should not instantiate
// this service directly, and instead use the [NewVerifiedBotTopService] method
// instead.
type VerifiedBotTopService struct {
Options []option.RequestOption
}
// NewVerifiedBotTopService generates a new service that applies the given options
// to each request. These options are applied after the parent client's options (if
// there is one), and before any request-specific options.
func NewVerifiedBotTopService(opts ...option.RequestOption) (r *VerifiedBotTopService) {
r = &VerifiedBotTopService{}
r.Options = opts
return
}
// Get top verified bots by HTTP requests, with owner and category.
func (r *VerifiedBotTopService) Bots(ctx context.Context, query VerifiedBotTopBotsParams, opts ...option.RequestOption) (res *VerifiedBotTopBotsResponse, err error) {
opts = append(r.Options[:], opts...)
var env VerifiedBotTopBotsResponseEnvelope
path := "radar/verified_bots/top/bots"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Get top verified bot categories by HTTP requests, along with their corresponding
// percentage, over the total verified bot HTTP requests.
func (r *VerifiedBotTopService) Categories(ctx context.Context, query VerifiedBotTopCategoriesParams, opts ...option.RequestOption) (res *VerifiedBotTopCategoriesResponse, err error) {
opts = append(r.Options[:], opts...)
var env VerifiedBotTopCategoriesResponseEnvelope
path := "radar/verified_bots/top/categories"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
type VerifiedBotTopBotsResponse struct {
Meta VerifiedBotTopBotsResponseMeta `json:"meta,required"`
Top0 []VerifiedBotTopBotsResponseTop0 `json:"top_0,required"`
JSON verifiedBotTopBotsResponseJSON `json:"-"`
}
// verifiedBotTopBotsResponseJSON contains the JSON metadata for the struct
// [VerifiedBotTopBotsResponse]
type verifiedBotTopBotsResponseJSON struct {
Meta apijson.Field
Top0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopBotsResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopBotsResponseJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopBotsResponseMeta struct {
DateRange []VerifiedBotTopBotsResponseMetaDateRange `json:"dateRange,required"`
ConfidenceInfo VerifiedBotTopBotsResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON verifiedBotTopBotsResponseMetaJSON `json:"-"`
}
// verifiedBotTopBotsResponseMetaJSON contains the JSON metadata for the struct
// [VerifiedBotTopBotsResponseMeta]
type verifiedBotTopBotsResponseMetaJSON struct {
DateRange apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopBotsResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopBotsResponseMetaJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopBotsResponseMetaDateRange struct {
// Adjusted end of date range.
EndTime time.Time `json:"endTime,required" format:"date-time"`
// Adjusted start of date range.
StartTime time.Time `json:"startTime,required" format:"date-time"`
JSON verifiedBotTopBotsResponseMetaDateRangeJSON `json:"-"`
}
// verifiedBotTopBotsResponseMetaDateRangeJSON contains the JSON metadata for the
// struct [VerifiedBotTopBotsResponseMetaDateRange]
type verifiedBotTopBotsResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopBotsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopBotsResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopBotsResponseMetaConfidenceInfo struct {
Annotations []VerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON verifiedBotTopBotsResponseMetaConfidenceInfoJSON `json:"-"`
}
// verifiedBotTopBotsResponseMetaConfidenceInfoJSON contains the JSON metadata for
// the struct [VerifiedBotTopBotsResponseMetaConfidenceInfo]
type verifiedBotTopBotsResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopBotsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopBotsResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation struct {
DataSource string `json:"dataSource,required"`
Description string `json:"description,required"`
EventType string `json:"eventType,required"`
IsInstantaneous interface{} `json:"isInstantaneous,required"`
EndTime time.Time `json:"endTime" format:"date-time"`
LinkedURL string `json:"linkedUrl"`
StartTime time.Time `json:"startTime" format:"date-time"`
JSON verifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// verifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON contains the JSON
// metadata for the struct [VerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation]
type verifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON struct {
DataSource apijson.Field
Description apijson.Field
EventType apijson.Field
IsInstantaneous apijson.Field
EndTime apijson.Field
LinkedURL apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopBotsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopBotsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopBotsResponseTop0 struct {
BotCategory string `json:"botCategory,required"`
BotName string `json:"botName,required"`
BotOwner string `json:"botOwner,required"`
Value string `json:"value,required"`
JSON verifiedBotTopBotsResponseTop0JSON `json:"-"`
}
// verifiedBotTopBotsResponseTop0JSON contains the JSON metadata for the struct
// [VerifiedBotTopBotsResponseTop0]
type verifiedBotTopBotsResponseTop0JSON struct {
BotCategory apijson.Field
BotName apijson.Field
BotOwner apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopBotsResponseTop0) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopBotsResponseTop0JSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopCategoriesResponse struct {
Meta VerifiedBotTopCategoriesResponseMeta `json:"meta,required"`
Top0 []VerifiedBotTopCategoriesResponseTop0 `json:"top_0,required"`
JSON verifiedBotTopCategoriesResponseJSON `json:"-"`
}
// verifiedBotTopCategoriesResponseJSON contains the JSON metadata for the struct
// [VerifiedBotTopCategoriesResponse]
type verifiedBotTopCategoriesResponseJSON struct {
Meta apijson.Field
Top0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopCategoriesResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopCategoriesResponseJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopCategoriesResponseMeta struct {
DateRange []VerifiedBotTopCategoriesResponseMetaDateRange `json:"dateRange,required"`
ConfidenceInfo VerifiedBotTopCategoriesResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON verifiedBotTopCategoriesResponseMetaJSON `json:"-"`
}
// verifiedBotTopCategoriesResponseMetaJSON contains the JSON metadata for the
// struct [VerifiedBotTopCategoriesResponseMeta]
type verifiedBotTopCategoriesResponseMetaJSON struct {
DateRange apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopCategoriesResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopCategoriesResponseMetaJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopCategoriesResponseMetaDateRange struct {
// Adjusted end of date range.
EndTime time.Time `json:"endTime,required" format:"date-time"`
// Adjusted start of date range.
StartTime time.Time `json:"startTime,required" format:"date-time"`
JSON verifiedBotTopCategoriesResponseMetaDateRangeJSON `json:"-"`
}
// verifiedBotTopCategoriesResponseMetaDateRangeJSON contains the JSON metadata for
// the struct [VerifiedBotTopCategoriesResponseMetaDateRange]
type verifiedBotTopCategoriesResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopCategoriesResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopCategoriesResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopCategoriesResponseMetaConfidenceInfo struct {
Annotations []VerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON verifiedBotTopCategoriesResponseMetaConfidenceInfoJSON `json:"-"`
}
// verifiedBotTopCategoriesResponseMetaConfidenceInfoJSON contains the JSON
// metadata for the struct [VerifiedBotTopCategoriesResponseMetaConfidenceInfo]
type verifiedBotTopCategoriesResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopCategoriesResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopCategoriesResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation struct {
DataSource string `json:"dataSource,required"`
Description string `json:"description,required"`
EventType string `json:"eventType,required"`
IsInstantaneous interface{} `json:"isInstantaneous,required"`
EndTime time.Time `json:"endTime" format:"date-time"`
LinkedURL string `json:"linkedUrl"`
StartTime time.Time `json:"startTime" format:"date-time"`
JSON verifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// verifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON contains the
// JSON metadata for the struct
// [VerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation]
type verifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON struct {
DataSource apijson.Field
Description apijson.Field
EventType apijson.Field
IsInstantaneous apijson.Field
EndTime apijson.Field
LinkedURL apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopCategoriesResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopCategoriesResponseTop0 struct {
BotCategory string `json:"botCategory,required"`
Value string `json:"value,required"`
JSON verifiedBotTopCategoriesResponseTop0JSON `json:"-"`
}
// verifiedBotTopCategoriesResponseTop0JSON contains the JSON metadata for the
// struct [VerifiedBotTopCategoriesResponseTop0]
type verifiedBotTopCategoriesResponseTop0JSON struct {
BotCategory apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopCategoriesResponseTop0) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopCategoriesResponseTop0JSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopBotsParams struct {
// Array of comma separated list of ASNs, start with `-` to exclude from results.
// For example, `-174, 3356` excludes results from AS174, but includes results from
// AS3356.
ASN param.Field[[]string] `query:"asn"`
// Array of comma separated list of continents (alpha-2 continent codes). Start
// with `-` to exclude from results. For example, `-EU,NA` excludes results from
// Europe, but includes results from North America.
Continent param.Field[[]string] `query:"continent"`
// End of the date range (inclusive).
DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"`
// For example, use `7d` and `7dControl` to compare this week with the previous
// week. Use this parameter or set specific start and end dates (`dateStart` and
// `dateEnd` parameters).
DateRange param.Field[[]VerifiedBotTopBotsParamsDateRange] `query:"dateRange"`
// Array of datetimes to filter the start of a series.
DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
// Format results are returned in.
Format param.Field[VerifiedBotTopBotsParamsFormat] `query:"format"`
// Limit the number of objects in the response.
Limit param.Field[int64] `query:"limit"`
// Array of comma separated list of locations (alpha-2 country codes). Start with
// `-` to exclude from results. For example, `-US,PT` excludes results from the US,
// but includes results from PT.
Location param.Field[[]string] `query:"location"`
// Array of names that will be used to name the series in responses.
Name param.Field[[]string] `query:"name"`
}
// URLQuery serializes [VerifiedBotTopBotsParams]'s query parameters as
// `url.Values`.
func (r VerifiedBotTopBotsParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type VerifiedBotTopBotsParamsDateRange string
const (
VerifiedBotTopBotsParamsDateRange1d VerifiedBotTopBotsParamsDateRange = "1d"
VerifiedBotTopBotsParamsDateRange2d VerifiedBotTopBotsParamsDateRange = "2d"
VerifiedBotTopBotsParamsDateRange7d VerifiedBotTopBotsParamsDateRange = "7d"
VerifiedBotTopBotsParamsDateRange14d VerifiedBotTopBotsParamsDateRange = "14d"
VerifiedBotTopBotsParamsDateRange28d VerifiedBotTopBotsParamsDateRange = "28d"
VerifiedBotTopBotsParamsDateRange12w VerifiedBotTopBotsParamsDateRange = "12w"
VerifiedBotTopBotsParamsDateRange24w VerifiedBotTopBotsParamsDateRange = "24w"
VerifiedBotTopBotsParamsDateRange52w VerifiedBotTopBotsParamsDateRange = "52w"
VerifiedBotTopBotsParamsDateRange1dControl VerifiedBotTopBotsParamsDateRange = "1dControl"
VerifiedBotTopBotsParamsDateRange2dControl VerifiedBotTopBotsParamsDateRange = "2dControl"
VerifiedBotTopBotsParamsDateRange7dControl VerifiedBotTopBotsParamsDateRange = "7dControl"
VerifiedBotTopBotsParamsDateRange14dControl VerifiedBotTopBotsParamsDateRange = "14dControl"
VerifiedBotTopBotsParamsDateRange28dControl VerifiedBotTopBotsParamsDateRange = "28dControl"
VerifiedBotTopBotsParamsDateRange12wControl VerifiedBotTopBotsParamsDateRange = "12wControl"
VerifiedBotTopBotsParamsDateRange24wControl VerifiedBotTopBotsParamsDateRange = "24wControl"
)
func (r VerifiedBotTopBotsParamsDateRange) IsKnown() bool {
switch r {
case VerifiedBotTopBotsParamsDateRange1d, VerifiedBotTopBotsParamsDateRange2d, VerifiedBotTopBotsParamsDateRange7d, VerifiedBotTopBotsParamsDateRange14d, VerifiedBotTopBotsParamsDateRange28d, VerifiedBotTopBotsParamsDateRange12w, VerifiedBotTopBotsParamsDateRange24w, VerifiedBotTopBotsParamsDateRange52w, VerifiedBotTopBotsParamsDateRange1dControl, VerifiedBotTopBotsParamsDateRange2dControl, VerifiedBotTopBotsParamsDateRange7dControl, VerifiedBotTopBotsParamsDateRange14dControl, VerifiedBotTopBotsParamsDateRange28dControl, VerifiedBotTopBotsParamsDateRange12wControl, VerifiedBotTopBotsParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type VerifiedBotTopBotsParamsFormat string
const (
VerifiedBotTopBotsParamsFormatJson VerifiedBotTopBotsParamsFormat = "JSON"
VerifiedBotTopBotsParamsFormatCsv VerifiedBotTopBotsParamsFormat = "CSV"
)
func (r VerifiedBotTopBotsParamsFormat) IsKnown() bool {
switch r {
case VerifiedBotTopBotsParamsFormatJson, VerifiedBotTopBotsParamsFormatCsv:
return true
}
return false
}
type VerifiedBotTopBotsResponseEnvelope struct {
Result VerifiedBotTopBotsResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON verifiedBotTopBotsResponseEnvelopeJSON `json:"-"`
}
// verifiedBotTopBotsResponseEnvelopeJSON contains the JSON metadata for the struct
// [VerifiedBotTopBotsResponseEnvelope]
type verifiedBotTopBotsResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopBotsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopBotsResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
type VerifiedBotTopCategoriesParams struct {
// Array of comma separated list of ASNs, start with `-` to exclude from results.
// For example, `-174, 3356` excludes results from AS174, but includes results from
// AS3356.
ASN param.Field[[]string] `query:"asn"`
// Array of comma separated list of continents (alpha-2 continent codes). Start
// with `-` to exclude from results. For example, `-EU,NA` excludes results from
// Europe, but includes results from North America.
Continent param.Field[[]string] `query:"continent"`
// End of the date range (inclusive).
DateEnd param.Field[[]time.Time] `query:"dateEnd" format:"date-time"`
// For example, use `7d` and `7dControl` to compare this week with the previous
// week. Use this parameter or set specific start and end dates (`dateStart` and
// `dateEnd` parameters).
DateRange param.Field[[]VerifiedBotTopCategoriesParamsDateRange] `query:"dateRange"`
// Array of datetimes to filter the start of a series.
DateStart param.Field[[]time.Time] `query:"dateStart" format:"date-time"`
// Format results are returned in.
Format param.Field[VerifiedBotTopCategoriesParamsFormat] `query:"format"`
// Limit the number of objects in the response.
Limit param.Field[int64] `query:"limit"`
// Array of comma separated list of locations (alpha-2 country codes). Start with
// `-` to exclude from results. For example, `-US,PT` excludes results from the US,
// but includes results from PT.
Location param.Field[[]string] `query:"location"`
// Array of names that will be used to name the series in responses.
Name param.Field[[]string] `query:"name"`
}
// URLQuery serializes [VerifiedBotTopCategoriesParams]'s query parameters as
// `url.Values`.
func (r VerifiedBotTopCategoriesParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type VerifiedBotTopCategoriesParamsDateRange string
const (
VerifiedBotTopCategoriesParamsDateRange1d VerifiedBotTopCategoriesParamsDateRange = "1d"
VerifiedBotTopCategoriesParamsDateRange2d VerifiedBotTopCategoriesParamsDateRange = "2d"
VerifiedBotTopCategoriesParamsDateRange7d VerifiedBotTopCategoriesParamsDateRange = "7d"
VerifiedBotTopCategoriesParamsDateRange14d VerifiedBotTopCategoriesParamsDateRange = "14d"
VerifiedBotTopCategoriesParamsDateRange28d VerifiedBotTopCategoriesParamsDateRange = "28d"
VerifiedBotTopCategoriesParamsDateRange12w VerifiedBotTopCategoriesParamsDateRange = "12w"
VerifiedBotTopCategoriesParamsDateRange24w VerifiedBotTopCategoriesParamsDateRange = "24w"
VerifiedBotTopCategoriesParamsDateRange52w VerifiedBotTopCategoriesParamsDateRange = "52w"
VerifiedBotTopCategoriesParamsDateRange1dControl VerifiedBotTopCategoriesParamsDateRange = "1dControl"
VerifiedBotTopCategoriesParamsDateRange2dControl VerifiedBotTopCategoriesParamsDateRange = "2dControl"
VerifiedBotTopCategoriesParamsDateRange7dControl VerifiedBotTopCategoriesParamsDateRange = "7dControl"
VerifiedBotTopCategoriesParamsDateRange14dControl VerifiedBotTopCategoriesParamsDateRange = "14dControl"
VerifiedBotTopCategoriesParamsDateRange28dControl VerifiedBotTopCategoriesParamsDateRange = "28dControl"
VerifiedBotTopCategoriesParamsDateRange12wControl VerifiedBotTopCategoriesParamsDateRange = "12wControl"
VerifiedBotTopCategoriesParamsDateRange24wControl VerifiedBotTopCategoriesParamsDateRange = "24wControl"
)
func (r VerifiedBotTopCategoriesParamsDateRange) IsKnown() bool {
switch r {
case VerifiedBotTopCategoriesParamsDateRange1d, VerifiedBotTopCategoriesParamsDateRange2d, VerifiedBotTopCategoriesParamsDateRange7d, VerifiedBotTopCategoriesParamsDateRange14d, VerifiedBotTopCategoriesParamsDateRange28d, VerifiedBotTopCategoriesParamsDateRange12w, VerifiedBotTopCategoriesParamsDateRange24w, VerifiedBotTopCategoriesParamsDateRange52w, VerifiedBotTopCategoriesParamsDateRange1dControl, VerifiedBotTopCategoriesParamsDateRange2dControl, VerifiedBotTopCategoriesParamsDateRange7dControl, VerifiedBotTopCategoriesParamsDateRange14dControl, VerifiedBotTopCategoriesParamsDateRange28dControl, VerifiedBotTopCategoriesParamsDateRange12wControl, VerifiedBotTopCategoriesParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type VerifiedBotTopCategoriesParamsFormat string
const (
VerifiedBotTopCategoriesParamsFormatJson VerifiedBotTopCategoriesParamsFormat = "JSON"
VerifiedBotTopCategoriesParamsFormatCsv VerifiedBotTopCategoriesParamsFormat = "CSV"
)
func (r VerifiedBotTopCategoriesParamsFormat) IsKnown() bool {
switch r {
case VerifiedBotTopCategoriesParamsFormatJson, VerifiedBotTopCategoriesParamsFormatCsv:
return true
}
return false
}
type VerifiedBotTopCategoriesResponseEnvelope struct {
Result VerifiedBotTopCategoriesResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON verifiedBotTopCategoriesResponseEnvelopeJSON `json:"-"`
}
// verifiedBotTopCategoriesResponseEnvelopeJSON contains the JSON metadata for the
// struct [VerifiedBotTopCategoriesResponseEnvelope]
type verifiedBotTopCategoriesResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *VerifiedBotTopCategoriesResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r verifiedBotTopCategoriesResponseEnvelopeJSON) RawJSON() string {
return r.raw
}