/
attacklayer3top.go
929 lines (800 loc) · 40.1 KB
/
attacklayer3top.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
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
// 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"
)
// AttackLayer3TopService 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 [NewAttackLayer3TopService] method
// instead.
type AttackLayer3TopService struct {
Options []option.RequestOption
Locations *AttackLayer3TopLocationService
}
// NewAttackLayer3TopService 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 NewAttackLayer3TopService(opts ...option.RequestOption) (r *AttackLayer3TopService) {
r = &AttackLayer3TopService{}
r.Options = opts
r.Locations = NewAttackLayer3TopLocationService(opts...)
return
}
// Get the top attacks from origin to target location. Values are a percentage out
// of the total layer 3 attacks (with billing country). You can optionally limit
// the number of attacks per origin/target location (useful if all the top attacks
// are from or to the same location).
func (r *AttackLayer3TopService) Attacks(ctx context.Context, query AttackLayer3TopAttacksParams, opts ...option.RequestOption) (res *AttackLayer3TopAttacksResponse, err error) {
opts = append(r.Options[:], opts...)
var env AttackLayer3TopAttacksResponseEnvelope
path := "radar/attacks/layer3/top/attacks"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Get the Industry of attacks.
func (r *AttackLayer3TopService) Industry(ctx context.Context, query AttackLayer3TopIndustryParams, opts ...option.RequestOption) (res *AttackLayer3TopIndustryResponse, err error) {
opts = append(r.Options[:], opts...)
var env AttackLayer3TopIndustryResponseEnvelope
path := "radar/attacks/layer3/top/industry"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Get the Verticals of attacks.
func (r *AttackLayer3TopService) Vertical(ctx context.Context, query AttackLayer3TopVerticalParams, opts ...option.RequestOption) (res *AttackLayer3TopVerticalResponse, err error) {
opts = append(r.Options[:], opts...)
var env AttackLayer3TopVerticalResponseEnvelope
path := "radar/attacks/layer3/top/vertical"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
type AttackLayer3TopAttacksResponse struct {
Meta AttackLayer3TopAttacksResponseMeta `json:"meta,required"`
Top0 []AttackLayer3TopAttacksResponseTop0 `json:"top_0,required"`
JSON attackLayer3TopAttacksResponseJSON `json:"-"`
}
// attackLayer3TopAttacksResponseJSON contains the JSON metadata for the struct
// [AttackLayer3TopAttacksResponse]
type attackLayer3TopAttacksResponseJSON struct {
Meta apijson.Field
Top0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopAttacksResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopAttacksResponseJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopAttacksResponseMeta struct {
DateRange []AttackLayer3TopAttacksResponseMetaDateRange `json:"dateRange,required"`
LastUpdated string `json:"lastUpdated,required"`
ConfidenceInfo AttackLayer3TopAttacksResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON attackLayer3TopAttacksResponseMetaJSON `json:"-"`
}
// attackLayer3TopAttacksResponseMetaJSON contains the JSON metadata for the struct
// [AttackLayer3TopAttacksResponseMeta]
type attackLayer3TopAttacksResponseMetaJSON struct {
DateRange apijson.Field
LastUpdated apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopAttacksResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopAttacksResponseMetaJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopAttacksResponseMetaDateRange 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 attackLayer3TopAttacksResponseMetaDateRangeJSON `json:"-"`
}
// attackLayer3TopAttacksResponseMetaDateRangeJSON contains the JSON metadata for
// the struct [AttackLayer3TopAttacksResponseMetaDateRange]
type attackLayer3TopAttacksResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopAttacksResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopAttacksResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopAttacksResponseMetaConfidenceInfo struct {
Annotations []AttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON attackLayer3TopAttacksResponseMetaConfidenceInfoJSON `json:"-"`
}
// attackLayer3TopAttacksResponseMetaConfidenceInfoJSON contains the JSON metadata
// for the struct [AttackLayer3TopAttacksResponseMetaConfidenceInfo]
type attackLayer3TopAttacksResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopAttacksResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopAttacksResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation 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 attackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// attackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON contains the JSON
// metadata for the struct
// [AttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation]
type attackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TopAttacksResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopAttacksResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopAttacksResponseTop0 struct {
OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
OriginCountryName string `json:"originCountryName,required"`
Value string `json:"value,required"`
JSON attackLayer3TopAttacksResponseTop0JSON `json:"-"`
}
// attackLayer3TopAttacksResponseTop0JSON contains the JSON metadata for the struct
// [AttackLayer3TopAttacksResponseTop0]
type attackLayer3TopAttacksResponseTop0JSON struct {
OriginCountryAlpha2 apijson.Field
OriginCountryName apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopAttacksResponseTop0) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopAttacksResponseTop0JSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopIndustryResponse struct {
Meta AttackLayer3TopIndustryResponseMeta `json:"meta,required"`
Top0 []Browser `json:"top_0,required"`
JSON attackLayer3TopIndustryResponseJSON `json:"-"`
}
// attackLayer3TopIndustryResponseJSON contains the JSON metadata for the struct
// [AttackLayer3TopIndustryResponse]
type attackLayer3TopIndustryResponseJSON struct {
Meta apijson.Field
Top0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopIndustryResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopIndustryResponseJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopIndustryResponseMeta struct {
DateRange []AttackLayer3TopIndustryResponseMetaDateRange `json:"dateRange,required"`
LastUpdated string `json:"lastUpdated,required"`
ConfidenceInfo AttackLayer3TopIndustryResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON attackLayer3TopIndustryResponseMetaJSON `json:"-"`
}
// attackLayer3TopIndustryResponseMetaJSON contains the JSON metadata for the
// struct [AttackLayer3TopIndustryResponseMeta]
type attackLayer3TopIndustryResponseMetaJSON struct {
DateRange apijson.Field
LastUpdated apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopIndustryResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopIndustryResponseMetaJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopIndustryResponseMetaDateRange 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 attackLayer3TopIndustryResponseMetaDateRangeJSON `json:"-"`
}
// attackLayer3TopIndustryResponseMetaDateRangeJSON contains the JSON metadata for
// the struct [AttackLayer3TopIndustryResponseMetaDateRange]
type attackLayer3TopIndustryResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopIndustryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopIndustryResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopIndustryResponseMetaConfidenceInfo struct {
Annotations []AttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON attackLayer3TopIndustryResponseMetaConfidenceInfoJSON `json:"-"`
}
// attackLayer3TopIndustryResponseMetaConfidenceInfoJSON contains the JSON metadata
// for the struct [AttackLayer3TopIndustryResponseMetaConfidenceInfo]
type attackLayer3TopIndustryResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopIndustryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopIndustryResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation 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 attackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// attackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON contains the
// JSON metadata for the struct
// [AttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation]
type attackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TopIndustryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopIndustryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopVerticalResponse struct {
Meta AttackLayer3TopVerticalResponseMeta `json:"meta,required"`
Top0 []Browser `json:"top_0,required"`
JSON attackLayer3TopVerticalResponseJSON `json:"-"`
}
// attackLayer3TopVerticalResponseJSON contains the JSON metadata for the struct
// [AttackLayer3TopVerticalResponse]
type attackLayer3TopVerticalResponseJSON struct {
Meta apijson.Field
Top0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopVerticalResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopVerticalResponseJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopVerticalResponseMeta struct {
DateRange []AttackLayer3TopVerticalResponseMetaDateRange `json:"dateRange,required"`
LastUpdated string `json:"lastUpdated,required"`
ConfidenceInfo AttackLayer3TopVerticalResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON attackLayer3TopVerticalResponseMetaJSON `json:"-"`
}
// attackLayer3TopVerticalResponseMetaJSON contains the JSON metadata for the
// struct [AttackLayer3TopVerticalResponseMeta]
type attackLayer3TopVerticalResponseMetaJSON struct {
DateRange apijson.Field
LastUpdated apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopVerticalResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopVerticalResponseMetaJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopVerticalResponseMetaDateRange 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 attackLayer3TopVerticalResponseMetaDateRangeJSON `json:"-"`
}
// attackLayer3TopVerticalResponseMetaDateRangeJSON contains the JSON metadata for
// the struct [AttackLayer3TopVerticalResponseMetaDateRange]
type attackLayer3TopVerticalResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopVerticalResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopVerticalResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopVerticalResponseMetaConfidenceInfo struct {
Annotations []AttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON attackLayer3TopVerticalResponseMetaConfidenceInfoJSON `json:"-"`
}
// attackLayer3TopVerticalResponseMetaConfidenceInfoJSON contains the JSON metadata
// for the struct [AttackLayer3TopVerticalResponseMetaConfidenceInfo]
type attackLayer3TopVerticalResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopVerticalResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopVerticalResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation 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 attackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// attackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON contains the
// JSON metadata for the struct
// [AttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation]
type attackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer3TopVerticalResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopVerticalResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopAttacksParams struct {
// 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[[]AttackLayer3TopAttacksParamsDateRange] `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[AttackLayer3TopAttacksParamsFormat] `query:"format"`
// Filter for ip version.
IPVersion param.Field[[]AttackLayer3TopAttacksParamsIPVersion] `query:"ipVersion"`
// Limit the number of objects in the response.
Limit param.Field[int64] `query:"limit"`
// Array of attack origin/target location attack limits. Together with
// `limitPerLocation`, limits how many objects will be fetched per origin/target
// location.
LimitDirection param.Field[AttackLayer3TopAttacksParamsLimitDirection] `query:"limitDirection"`
// Limit the number of attacks per origin/target (refer to `limitDirection`
// parameter) location.
LimitPerLocation param.Field[int64] `query:"limitPerLocation"`
// 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"`
// Array of L3/4 attack types.
Protocol param.Field[[]AttackLayer3TopAttacksParamsProtocol] `query:"protocol"`
}
// URLQuery serializes [AttackLayer3TopAttacksParams]'s query parameters as
// `url.Values`.
func (r AttackLayer3TopAttacksParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type AttackLayer3TopAttacksParamsDateRange string
const (
AttackLayer3TopAttacksParamsDateRange1d AttackLayer3TopAttacksParamsDateRange = "1d"
AttackLayer3TopAttacksParamsDateRange2d AttackLayer3TopAttacksParamsDateRange = "2d"
AttackLayer3TopAttacksParamsDateRange7d AttackLayer3TopAttacksParamsDateRange = "7d"
AttackLayer3TopAttacksParamsDateRange14d AttackLayer3TopAttacksParamsDateRange = "14d"
AttackLayer3TopAttacksParamsDateRange28d AttackLayer3TopAttacksParamsDateRange = "28d"
AttackLayer3TopAttacksParamsDateRange12w AttackLayer3TopAttacksParamsDateRange = "12w"
AttackLayer3TopAttacksParamsDateRange24w AttackLayer3TopAttacksParamsDateRange = "24w"
AttackLayer3TopAttacksParamsDateRange52w AttackLayer3TopAttacksParamsDateRange = "52w"
AttackLayer3TopAttacksParamsDateRange1dControl AttackLayer3TopAttacksParamsDateRange = "1dControl"
AttackLayer3TopAttacksParamsDateRange2dControl AttackLayer3TopAttacksParamsDateRange = "2dControl"
AttackLayer3TopAttacksParamsDateRange7dControl AttackLayer3TopAttacksParamsDateRange = "7dControl"
AttackLayer3TopAttacksParamsDateRange14dControl AttackLayer3TopAttacksParamsDateRange = "14dControl"
AttackLayer3TopAttacksParamsDateRange28dControl AttackLayer3TopAttacksParamsDateRange = "28dControl"
AttackLayer3TopAttacksParamsDateRange12wControl AttackLayer3TopAttacksParamsDateRange = "12wControl"
AttackLayer3TopAttacksParamsDateRange24wControl AttackLayer3TopAttacksParamsDateRange = "24wControl"
)
func (r AttackLayer3TopAttacksParamsDateRange) IsKnown() bool {
switch r {
case AttackLayer3TopAttacksParamsDateRange1d, AttackLayer3TopAttacksParamsDateRange2d, AttackLayer3TopAttacksParamsDateRange7d, AttackLayer3TopAttacksParamsDateRange14d, AttackLayer3TopAttacksParamsDateRange28d, AttackLayer3TopAttacksParamsDateRange12w, AttackLayer3TopAttacksParamsDateRange24w, AttackLayer3TopAttacksParamsDateRange52w, AttackLayer3TopAttacksParamsDateRange1dControl, AttackLayer3TopAttacksParamsDateRange2dControl, AttackLayer3TopAttacksParamsDateRange7dControl, AttackLayer3TopAttacksParamsDateRange14dControl, AttackLayer3TopAttacksParamsDateRange28dControl, AttackLayer3TopAttacksParamsDateRange12wControl, AttackLayer3TopAttacksParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type AttackLayer3TopAttacksParamsFormat string
const (
AttackLayer3TopAttacksParamsFormatJson AttackLayer3TopAttacksParamsFormat = "JSON"
AttackLayer3TopAttacksParamsFormatCsv AttackLayer3TopAttacksParamsFormat = "CSV"
)
func (r AttackLayer3TopAttacksParamsFormat) IsKnown() bool {
switch r {
case AttackLayer3TopAttacksParamsFormatJson, AttackLayer3TopAttacksParamsFormatCsv:
return true
}
return false
}
type AttackLayer3TopAttacksParamsIPVersion string
const (
AttackLayer3TopAttacksParamsIPVersionIPv4 AttackLayer3TopAttacksParamsIPVersion = "IPv4"
AttackLayer3TopAttacksParamsIPVersionIPv6 AttackLayer3TopAttacksParamsIPVersion = "IPv6"
)
func (r AttackLayer3TopAttacksParamsIPVersion) IsKnown() bool {
switch r {
case AttackLayer3TopAttacksParamsIPVersionIPv4, AttackLayer3TopAttacksParamsIPVersionIPv6:
return true
}
return false
}
// Array of attack origin/target location attack limits. Together with
// `limitPerLocation`, limits how many objects will be fetched per origin/target
// location.
type AttackLayer3TopAttacksParamsLimitDirection string
const (
AttackLayer3TopAttacksParamsLimitDirectionOrigin AttackLayer3TopAttacksParamsLimitDirection = "ORIGIN"
AttackLayer3TopAttacksParamsLimitDirectionTarget AttackLayer3TopAttacksParamsLimitDirection = "TARGET"
)
func (r AttackLayer3TopAttacksParamsLimitDirection) IsKnown() bool {
switch r {
case AttackLayer3TopAttacksParamsLimitDirectionOrigin, AttackLayer3TopAttacksParamsLimitDirectionTarget:
return true
}
return false
}
type AttackLayer3TopAttacksParamsProtocol string
const (
AttackLayer3TopAttacksParamsProtocolUdp AttackLayer3TopAttacksParamsProtocol = "UDP"
AttackLayer3TopAttacksParamsProtocolTCP AttackLayer3TopAttacksParamsProtocol = "TCP"
AttackLayer3TopAttacksParamsProtocolIcmp AttackLayer3TopAttacksParamsProtocol = "ICMP"
AttackLayer3TopAttacksParamsProtocolGRE AttackLayer3TopAttacksParamsProtocol = "GRE"
)
func (r AttackLayer3TopAttacksParamsProtocol) IsKnown() bool {
switch r {
case AttackLayer3TopAttacksParamsProtocolUdp, AttackLayer3TopAttacksParamsProtocolTCP, AttackLayer3TopAttacksParamsProtocolIcmp, AttackLayer3TopAttacksParamsProtocolGRE:
return true
}
return false
}
type AttackLayer3TopAttacksResponseEnvelope struct {
Result AttackLayer3TopAttacksResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON attackLayer3TopAttacksResponseEnvelopeJSON `json:"-"`
}
// attackLayer3TopAttacksResponseEnvelopeJSON contains the JSON metadata for the
// struct [AttackLayer3TopAttacksResponseEnvelope]
type attackLayer3TopAttacksResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopAttacksResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopAttacksResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopIndustryParams struct {
// 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[[]AttackLayer3TopIndustryParamsDateRange] `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[AttackLayer3TopIndustryParamsFormat] `query:"format"`
// Filter for ip version.
IPVersion param.Field[[]AttackLayer3TopIndustryParamsIPVersion] `query:"ipVersion"`
// 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"`
// Array of L3/4 attack types.
Protocol param.Field[[]AttackLayer3TopIndustryParamsProtocol] `query:"protocol"`
}
// URLQuery serializes [AttackLayer3TopIndustryParams]'s query parameters as
// `url.Values`.
func (r AttackLayer3TopIndustryParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type AttackLayer3TopIndustryParamsDateRange string
const (
AttackLayer3TopIndustryParamsDateRange1d AttackLayer3TopIndustryParamsDateRange = "1d"
AttackLayer3TopIndustryParamsDateRange2d AttackLayer3TopIndustryParamsDateRange = "2d"
AttackLayer3TopIndustryParamsDateRange7d AttackLayer3TopIndustryParamsDateRange = "7d"
AttackLayer3TopIndustryParamsDateRange14d AttackLayer3TopIndustryParamsDateRange = "14d"
AttackLayer3TopIndustryParamsDateRange28d AttackLayer3TopIndustryParamsDateRange = "28d"
AttackLayer3TopIndustryParamsDateRange12w AttackLayer3TopIndustryParamsDateRange = "12w"
AttackLayer3TopIndustryParamsDateRange24w AttackLayer3TopIndustryParamsDateRange = "24w"
AttackLayer3TopIndustryParamsDateRange52w AttackLayer3TopIndustryParamsDateRange = "52w"
AttackLayer3TopIndustryParamsDateRange1dControl AttackLayer3TopIndustryParamsDateRange = "1dControl"
AttackLayer3TopIndustryParamsDateRange2dControl AttackLayer3TopIndustryParamsDateRange = "2dControl"
AttackLayer3TopIndustryParamsDateRange7dControl AttackLayer3TopIndustryParamsDateRange = "7dControl"
AttackLayer3TopIndustryParamsDateRange14dControl AttackLayer3TopIndustryParamsDateRange = "14dControl"
AttackLayer3TopIndustryParamsDateRange28dControl AttackLayer3TopIndustryParamsDateRange = "28dControl"
AttackLayer3TopIndustryParamsDateRange12wControl AttackLayer3TopIndustryParamsDateRange = "12wControl"
AttackLayer3TopIndustryParamsDateRange24wControl AttackLayer3TopIndustryParamsDateRange = "24wControl"
)
func (r AttackLayer3TopIndustryParamsDateRange) IsKnown() bool {
switch r {
case AttackLayer3TopIndustryParamsDateRange1d, AttackLayer3TopIndustryParamsDateRange2d, AttackLayer3TopIndustryParamsDateRange7d, AttackLayer3TopIndustryParamsDateRange14d, AttackLayer3TopIndustryParamsDateRange28d, AttackLayer3TopIndustryParamsDateRange12w, AttackLayer3TopIndustryParamsDateRange24w, AttackLayer3TopIndustryParamsDateRange52w, AttackLayer3TopIndustryParamsDateRange1dControl, AttackLayer3TopIndustryParamsDateRange2dControl, AttackLayer3TopIndustryParamsDateRange7dControl, AttackLayer3TopIndustryParamsDateRange14dControl, AttackLayer3TopIndustryParamsDateRange28dControl, AttackLayer3TopIndustryParamsDateRange12wControl, AttackLayer3TopIndustryParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type AttackLayer3TopIndustryParamsFormat string
const (
AttackLayer3TopIndustryParamsFormatJson AttackLayer3TopIndustryParamsFormat = "JSON"
AttackLayer3TopIndustryParamsFormatCsv AttackLayer3TopIndustryParamsFormat = "CSV"
)
func (r AttackLayer3TopIndustryParamsFormat) IsKnown() bool {
switch r {
case AttackLayer3TopIndustryParamsFormatJson, AttackLayer3TopIndustryParamsFormatCsv:
return true
}
return false
}
type AttackLayer3TopIndustryParamsIPVersion string
const (
AttackLayer3TopIndustryParamsIPVersionIPv4 AttackLayer3TopIndustryParamsIPVersion = "IPv4"
AttackLayer3TopIndustryParamsIPVersionIPv6 AttackLayer3TopIndustryParamsIPVersion = "IPv6"
)
func (r AttackLayer3TopIndustryParamsIPVersion) IsKnown() bool {
switch r {
case AttackLayer3TopIndustryParamsIPVersionIPv4, AttackLayer3TopIndustryParamsIPVersionIPv6:
return true
}
return false
}
type AttackLayer3TopIndustryParamsProtocol string
const (
AttackLayer3TopIndustryParamsProtocolUdp AttackLayer3TopIndustryParamsProtocol = "UDP"
AttackLayer3TopIndustryParamsProtocolTCP AttackLayer3TopIndustryParamsProtocol = "TCP"
AttackLayer3TopIndustryParamsProtocolIcmp AttackLayer3TopIndustryParamsProtocol = "ICMP"
AttackLayer3TopIndustryParamsProtocolGRE AttackLayer3TopIndustryParamsProtocol = "GRE"
)
func (r AttackLayer3TopIndustryParamsProtocol) IsKnown() bool {
switch r {
case AttackLayer3TopIndustryParamsProtocolUdp, AttackLayer3TopIndustryParamsProtocolTCP, AttackLayer3TopIndustryParamsProtocolIcmp, AttackLayer3TopIndustryParamsProtocolGRE:
return true
}
return false
}
type AttackLayer3TopIndustryResponseEnvelope struct {
Result AttackLayer3TopIndustryResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON attackLayer3TopIndustryResponseEnvelopeJSON `json:"-"`
}
// attackLayer3TopIndustryResponseEnvelopeJSON contains the JSON metadata for the
// struct [AttackLayer3TopIndustryResponseEnvelope]
type attackLayer3TopIndustryResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopIndustryResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
type AttackLayer3TopVerticalParams struct {
// 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[[]AttackLayer3TopVerticalParamsDateRange] `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[AttackLayer3TopVerticalParamsFormat] `query:"format"`
// Filter for ip version.
IPVersion param.Field[[]AttackLayer3TopVerticalParamsIPVersion] `query:"ipVersion"`
// 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"`
// Array of L3/4 attack types.
Protocol param.Field[[]AttackLayer3TopVerticalParamsProtocol] `query:"protocol"`
}
// URLQuery serializes [AttackLayer3TopVerticalParams]'s query parameters as
// `url.Values`.
func (r AttackLayer3TopVerticalParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type AttackLayer3TopVerticalParamsDateRange string
const (
AttackLayer3TopVerticalParamsDateRange1d AttackLayer3TopVerticalParamsDateRange = "1d"
AttackLayer3TopVerticalParamsDateRange2d AttackLayer3TopVerticalParamsDateRange = "2d"
AttackLayer3TopVerticalParamsDateRange7d AttackLayer3TopVerticalParamsDateRange = "7d"
AttackLayer3TopVerticalParamsDateRange14d AttackLayer3TopVerticalParamsDateRange = "14d"
AttackLayer3TopVerticalParamsDateRange28d AttackLayer3TopVerticalParamsDateRange = "28d"
AttackLayer3TopVerticalParamsDateRange12w AttackLayer3TopVerticalParamsDateRange = "12w"
AttackLayer3TopVerticalParamsDateRange24w AttackLayer3TopVerticalParamsDateRange = "24w"
AttackLayer3TopVerticalParamsDateRange52w AttackLayer3TopVerticalParamsDateRange = "52w"
AttackLayer3TopVerticalParamsDateRange1dControl AttackLayer3TopVerticalParamsDateRange = "1dControl"
AttackLayer3TopVerticalParamsDateRange2dControl AttackLayer3TopVerticalParamsDateRange = "2dControl"
AttackLayer3TopVerticalParamsDateRange7dControl AttackLayer3TopVerticalParamsDateRange = "7dControl"
AttackLayer3TopVerticalParamsDateRange14dControl AttackLayer3TopVerticalParamsDateRange = "14dControl"
AttackLayer3TopVerticalParamsDateRange28dControl AttackLayer3TopVerticalParamsDateRange = "28dControl"
AttackLayer3TopVerticalParamsDateRange12wControl AttackLayer3TopVerticalParamsDateRange = "12wControl"
AttackLayer3TopVerticalParamsDateRange24wControl AttackLayer3TopVerticalParamsDateRange = "24wControl"
)
func (r AttackLayer3TopVerticalParamsDateRange) IsKnown() bool {
switch r {
case AttackLayer3TopVerticalParamsDateRange1d, AttackLayer3TopVerticalParamsDateRange2d, AttackLayer3TopVerticalParamsDateRange7d, AttackLayer3TopVerticalParamsDateRange14d, AttackLayer3TopVerticalParamsDateRange28d, AttackLayer3TopVerticalParamsDateRange12w, AttackLayer3TopVerticalParamsDateRange24w, AttackLayer3TopVerticalParamsDateRange52w, AttackLayer3TopVerticalParamsDateRange1dControl, AttackLayer3TopVerticalParamsDateRange2dControl, AttackLayer3TopVerticalParamsDateRange7dControl, AttackLayer3TopVerticalParamsDateRange14dControl, AttackLayer3TopVerticalParamsDateRange28dControl, AttackLayer3TopVerticalParamsDateRange12wControl, AttackLayer3TopVerticalParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type AttackLayer3TopVerticalParamsFormat string
const (
AttackLayer3TopVerticalParamsFormatJson AttackLayer3TopVerticalParamsFormat = "JSON"
AttackLayer3TopVerticalParamsFormatCsv AttackLayer3TopVerticalParamsFormat = "CSV"
)
func (r AttackLayer3TopVerticalParamsFormat) IsKnown() bool {
switch r {
case AttackLayer3TopVerticalParamsFormatJson, AttackLayer3TopVerticalParamsFormatCsv:
return true
}
return false
}
type AttackLayer3TopVerticalParamsIPVersion string
const (
AttackLayer3TopVerticalParamsIPVersionIPv4 AttackLayer3TopVerticalParamsIPVersion = "IPv4"
AttackLayer3TopVerticalParamsIPVersionIPv6 AttackLayer3TopVerticalParamsIPVersion = "IPv6"
)
func (r AttackLayer3TopVerticalParamsIPVersion) IsKnown() bool {
switch r {
case AttackLayer3TopVerticalParamsIPVersionIPv4, AttackLayer3TopVerticalParamsIPVersionIPv6:
return true
}
return false
}
type AttackLayer3TopVerticalParamsProtocol string
const (
AttackLayer3TopVerticalParamsProtocolUdp AttackLayer3TopVerticalParamsProtocol = "UDP"
AttackLayer3TopVerticalParamsProtocolTCP AttackLayer3TopVerticalParamsProtocol = "TCP"
AttackLayer3TopVerticalParamsProtocolIcmp AttackLayer3TopVerticalParamsProtocol = "ICMP"
AttackLayer3TopVerticalParamsProtocolGRE AttackLayer3TopVerticalParamsProtocol = "GRE"
)
func (r AttackLayer3TopVerticalParamsProtocol) IsKnown() bool {
switch r {
case AttackLayer3TopVerticalParamsProtocolUdp, AttackLayer3TopVerticalParamsProtocolTCP, AttackLayer3TopVerticalParamsProtocolIcmp, AttackLayer3TopVerticalParamsProtocolGRE:
return true
}
return false
}
type AttackLayer3TopVerticalResponseEnvelope struct {
Result AttackLayer3TopVerticalResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON attackLayer3TopVerticalResponseEnvelopeJSON `json:"-"`
}
// attackLayer3TopVerticalResponseEnvelopeJSON contains the JSON metadata for the
// struct [AttackLayer3TopVerticalResponseEnvelope]
type attackLayer3TopVerticalResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer3TopVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer3TopVerticalResponseEnvelopeJSON) RawJSON() string {
return r.raw
}