-
Notifications
You must be signed in to change notification settings - Fork 541
/
attacklayer7top.go
860 lines (746 loc) · 37.9 KB
/
attacklayer7top.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
// 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"
)
// AttackLayer7TopService 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 [NewAttackLayer7TopService] method
// instead.
type AttackLayer7TopService struct {
Options []option.RequestOption
Locations *AttackLayer7TopLocationService
Ases *AttackLayer7TopAseService
}
// NewAttackLayer7TopService 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 NewAttackLayer7TopService(opts ...option.RequestOption) (r *AttackLayer7TopService) {
r = &AttackLayer7TopService{}
r.Options = opts
r.Locations = NewAttackLayer7TopLocationService(opts...)
r.Ases = NewAttackLayer7TopAseService(opts...)
return
}
// Get the top attacks from origin to target location. Values are a percentage out
// of the total layer 7 attacks (with billing country). The attack magnitude can be
// defined by the number of mitigated requests or by the number of zones affected.
// 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 *AttackLayer7TopService) Attacks(ctx context.Context, query AttackLayer7TopAttacksParams, opts ...option.RequestOption) (res *AttackLayer7TopAttacksResponse, err error) {
opts = append(r.Options[:], opts...)
var env AttackLayer7TopAttacksResponseEnvelope
path := "radar/attacks/layer7/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 *AttackLayer7TopService) Industry(ctx context.Context, query AttackLayer7TopIndustryParams, opts ...option.RequestOption) (res *AttackLayer7TopIndustryResponse, err error) {
opts = append(r.Options[:], opts...)
var env AttackLayer7TopIndustryResponseEnvelope
path := "radar/attacks/layer7/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 *AttackLayer7TopService) Vertical(ctx context.Context, query AttackLayer7TopVerticalParams, opts ...option.RequestOption) (res *AttackLayer7TopVerticalResponse, err error) {
opts = append(r.Options[:], opts...)
var env AttackLayer7TopVerticalResponseEnvelope
path := "radar/attacks/layer7/top/vertical"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
type AttackLayer7TopAttacksResponse struct {
Meta AttackLayer7TopAttacksResponseMeta `json:"meta,required"`
Top0 []AttackLayer7TopAttacksResponseTop0 `json:"top_0,required"`
JSON attackLayer7TopAttacksResponseJSON `json:"-"`
}
// attackLayer7TopAttacksResponseJSON contains the JSON metadata for the struct
// [AttackLayer7TopAttacksResponse]
type attackLayer7TopAttacksResponseJSON struct {
Meta apijson.Field
Top0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopAttacksResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopAttacksResponseJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopAttacksResponseMeta struct {
DateRange []AttackLayer7TopAttacksResponseMetaDateRange `json:"dateRange,required"`
LastUpdated string `json:"lastUpdated,required"`
ConfidenceInfo AttackLayer7TopAttacksResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON attackLayer7TopAttacksResponseMetaJSON `json:"-"`
}
// attackLayer7TopAttacksResponseMetaJSON contains the JSON metadata for the struct
// [AttackLayer7TopAttacksResponseMeta]
type attackLayer7TopAttacksResponseMetaJSON struct {
DateRange apijson.Field
LastUpdated apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopAttacksResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopAttacksResponseMetaJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopAttacksResponseMetaDateRange 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 attackLayer7TopAttacksResponseMetaDateRangeJSON `json:"-"`
}
// attackLayer7TopAttacksResponseMetaDateRangeJSON contains the JSON metadata for
// the struct [AttackLayer7TopAttacksResponseMetaDateRange]
type attackLayer7TopAttacksResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopAttacksResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopAttacksResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopAttacksResponseMetaConfidenceInfo struct {
Annotations []AttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON attackLayer7TopAttacksResponseMetaConfidenceInfoJSON `json:"-"`
}
// attackLayer7TopAttacksResponseMetaConfidenceInfoJSON contains the JSON metadata
// for the struct [AttackLayer7TopAttacksResponseMetaConfidenceInfo]
type attackLayer7TopAttacksResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopAttacksResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopAttacksResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// attackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON contains the JSON
// metadata for the struct
// [AttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation]
type attackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopAttacksResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopAttacksResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopAttacksResponseTop0 struct {
OriginCountryAlpha2 string `json:"originCountryAlpha2,required"`
OriginCountryName string `json:"originCountryName,required"`
TargetCountryAlpha2 string `json:"targetCountryAlpha2,required"`
TargetCountryName string `json:"targetCountryName,required"`
Value string `json:"value,required"`
JSON attackLayer7TopAttacksResponseTop0JSON `json:"-"`
}
// attackLayer7TopAttacksResponseTop0JSON contains the JSON metadata for the struct
// [AttackLayer7TopAttacksResponseTop0]
type attackLayer7TopAttacksResponseTop0JSON struct {
OriginCountryAlpha2 apijson.Field
OriginCountryName apijson.Field
TargetCountryAlpha2 apijson.Field
TargetCountryName apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopAttacksResponseTop0) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopAttacksResponseTop0JSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopIndustryResponse struct {
Meta AttackLayer7TopIndustryResponseMeta `json:"meta,required"`
Top0 []Browser `json:"top_0,required"`
JSON attackLayer7TopIndustryResponseJSON `json:"-"`
}
// attackLayer7TopIndustryResponseJSON contains the JSON metadata for the struct
// [AttackLayer7TopIndustryResponse]
type attackLayer7TopIndustryResponseJSON struct {
Meta apijson.Field
Top0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopIndustryResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopIndustryResponseJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopIndustryResponseMeta struct {
DateRange []AttackLayer7TopIndustryResponseMetaDateRange `json:"dateRange,required"`
LastUpdated string `json:"lastUpdated,required"`
ConfidenceInfo AttackLayer7TopIndustryResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON attackLayer7TopIndustryResponseMetaJSON `json:"-"`
}
// attackLayer7TopIndustryResponseMetaJSON contains the JSON metadata for the
// struct [AttackLayer7TopIndustryResponseMeta]
type attackLayer7TopIndustryResponseMetaJSON struct {
DateRange apijson.Field
LastUpdated apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopIndustryResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopIndustryResponseMetaJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopIndustryResponseMetaDateRange 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 attackLayer7TopIndustryResponseMetaDateRangeJSON `json:"-"`
}
// attackLayer7TopIndustryResponseMetaDateRangeJSON contains the JSON metadata for
// the struct [AttackLayer7TopIndustryResponseMetaDateRange]
type attackLayer7TopIndustryResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopIndustryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopIndustryResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopIndustryResponseMetaConfidenceInfo struct {
Annotations []AttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON attackLayer7TopIndustryResponseMetaConfidenceInfoJSON `json:"-"`
}
// attackLayer7TopIndustryResponseMetaConfidenceInfoJSON contains the JSON metadata
// for the struct [AttackLayer7TopIndustryResponseMetaConfidenceInfo]
type attackLayer7TopIndustryResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopIndustryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopIndustryResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// attackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON contains the
// JSON metadata for the struct
// [AttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation]
type attackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopIndustryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopIndustryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopVerticalResponse struct {
Meta AttackLayer7TopVerticalResponseMeta `json:"meta,required"`
Top0 []Browser `json:"top_0,required"`
JSON attackLayer7TopVerticalResponseJSON `json:"-"`
}
// attackLayer7TopVerticalResponseJSON contains the JSON metadata for the struct
// [AttackLayer7TopVerticalResponse]
type attackLayer7TopVerticalResponseJSON struct {
Meta apijson.Field
Top0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopVerticalResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopVerticalResponseJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopVerticalResponseMeta struct {
DateRange []AttackLayer7TopVerticalResponseMetaDateRange `json:"dateRange,required"`
LastUpdated string `json:"lastUpdated,required"`
ConfidenceInfo AttackLayer7TopVerticalResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON attackLayer7TopVerticalResponseMetaJSON `json:"-"`
}
// attackLayer7TopVerticalResponseMetaJSON contains the JSON metadata for the
// struct [AttackLayer7TopVerticalResponseMeta]
type attackLayer7TopVerticalResponseMetaJSON struct {
DateRange apijson.Field
LastUpdated apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopVerticalResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopVerticalResponseMetaJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopVerticalResponseMetaDateRange 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 attackLayer7TopVerticalResponseMetaDateRangeJSON `json:"-"`
}
// attackLayer7TopVerticalResponseMetaDateRangeJSON contains the JSON metadata for
// the struct [AttackLayer7TopVerticalResponseMetaDateRange]
type attackLayer7TopVerticalResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopVerticalResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopVerticalResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopVerticalResponseMetaConfidenceInfo struct {
Annotations []AttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON attackLayer7TopVerticalResponseMetaConfidenceInfoJSON `json:"-"`
}
// attackLayer7TopVerticalResponseMetaConfidenceInfoJSON contains the JSON metadata
// for the struct [AttackLayer7TopVerticalResponseMetaConfidenceInfo]
type attackLayer7TopVerticalResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopVerticalResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopVerticalResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation 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 attackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// attackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON contains the
// JSON metadata for the struct
// [AttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation]
type attackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON 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 *AttackLayer7TopVerticalResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopVerticalResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopAttacksParams 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[[]AttackLayer7TopAttacksParamsDateRange] `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[AttackLayer7TopAttacksParamsFormat] `query:"format"`
// 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[AttackLayer7TopAttacksParamsLimitDirection] `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"`
// Attack magnitude can be defined by total requests mitigated or by total zones
// attacked.
Magnitude param.Field[AttackLayer7TopAttacksParamsMagnitude] `query:"magnitude"`
// Array of names that will be used to name the series in responses.
Name param.Field[[]string] `query:"name"`
}
// URLQuery serializes [AttackLayer7TopAttacksParams]'s query parameters as
// `url.Values`.
func (r AttackLayer7TopAttacksParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type AttackLayer7TopAttacksParamsDateRange string
const (
AttackLayer7TopAttacksParamsDateRange1d AttackLayer7TopAttacksParamsDateRange = "1d"
AttackLayer7TopAttacksParamsDateRange2d AttackLayer7TopAttacksParamsDateRange = "2d"
AttackLayer7TopAttacksParamsDateRange7d AttackLayer7TopAttacksParamsDateRange = "7d"
AttackLayer7TopAttacksParamsDateRange14d AttackLayer7TopAttacksParamsDateRange = "14d"
AttackLayer7TopAttacksParamsDateRange28d AttackLayer7TopAttacksParamsDateRange = "28d"
AttackLayer7TopAttacksParamsDateRange12w AttackLayer7TopAttacksParamsDateRange = "12w"
AttackLayer7TopAttacksParamsDateRange24w AttackLayer7TopAttacksParamsDateRange = "24w"
AttackLayer7TopAttacksParamsDateRange52w AttackLayer7TopAttacksParamsDateRange = "52w"
AttackLayer7TopAttacksParamsDateRange1dControl AttackLayer7TopAttacksParamsDateRange = "1dControl"
AttackLayer7TopAttacksParamsDateRange2dControl AttackLayer7TopAttacksParamsDateRange = "2dControl"
AttackLayer7TopAttacksParamsDateRange7dControl AttackLayer7TopAttacksParamsDateRange = "7dControl"
AttackLayer7TopAttacksParamsDateRange14dControl AttackLayer7TopAttacksParamsDateRange = "14dControl"
AttackLayer7TopAttacksParamsDateRange28dControl AttackLayer7TopAttacksParamsDateRange = "28dControl"
AttackLayer7TopAttacksParamsDateRange12wControl AttackLayer7TopAttacksParamsDateRange = "12wControl"
AttackLayer7TopAttacksParamsDateRange24wControl AttackLayer7TopAttacksParamsDateRange = "24wControl"
)
func (r AttackLayer7TopAttacksParamsDateRange) IsKnown() bool {
switch r {
case AttackLayer7TopAttacksParamsDateRange1d, AttackLayer7TopAttacksParamsDateRange2d, AttackLayer7TopAttacksParamsDateRange7d, AttackLayer7TopAttacksParamsDateRange14d, AttackLayer7TopAttacksParamsDateRange28d, AttackLayer7TopAttacksParamsDateRange12w, AttackLayer7TopAttacksParamsDateRange24w, AttackLayer7TopAttacksParamsDateRange52w, AttackLayer7TopAttacksParamsDateRange1dControl, AttackLayer7TopAttacksParamsDateRange2dControl, AttackLayer7TopAttacksParamsDateRange7dControl, AttackLayer7TopAttacksParamsDateRange14dControl, AttackLayer7TopAttacksParamsDateRange28dControl, AttackLayer7TopAttacksParamsDateRange12wControl, AttackLayer7TopAttacksParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type AttackLayer7TopAttacksParamsFormat string
const (
AttackLayer7TopAttacksParamsFormatJson AttackLayer7TopAttacksParamsFormat = "JSON"
AttackLayer7TopAttacksParamsFormatCsv AttackLayer7TopAttacksParamsFormat = "CSV"
)
func (r AttackLayer7TopAttacksParamsFormat) IsKnown() bool {
switch r {
case AttackLayer7TopAttacksParamsFormatJson, AttackLayer7TopAttacksParamsFormatCsv:
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 AttackLayer7TopAttacksParamsLimitDirection string
const (
AttackLayer7TopAttacksParamsLimitDirectionOrigin AttackLayer7TopAttacksParamsLimitDirection = "ORIGIN"
AttackLayer7TopAttacksParamsLimitDirectionTarget AttackLayer7TopAttacksParamsLimitDirection = "TARGET"
)
func (r AttackLayer7TopAttacksParamsLimitDirection) IsKnown() bool {
switch r {
case AttackLayer7TopAttacksParamsLimitDirectionOrigin, AttackLayer7TopAttacksParamsLimitDirectionTarget:
return true
}
return false
}
// Attack magnitude can be defined by total requests mitigated or by total zones
// attacked.
type AttackLayer7TopAttacksParamsMagnitude string
const (
AttackLayer7TopAttacksParamsMagnitudeAffectedZones AttackLayer7TopAttacksParamsMagnitude = "AFFECTED_ZONES"
AttackLayer7TopAttacksParamsMagnitudeMitigatedRequests AttackLayer7TopAttacksParamsMagnitude = "MITIGATED_REQUESTS"
)
func (r AttackLayer7TopAttacksParamsMagnitude) IsKnown() bool {
switch r {
case AttackLayer7TopAttacksParamsMagnitudeAffectedZones, AttackLayer7TopAttacksParamsMagnitudeMitigatedRequests:
return true
}
return false
}
type AttackLayer7TopAttacksResponseEnvelope struct {
Result AttackLayer7TopAttacksResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON attackLayer7TopAttacksResponseEnvelopeJSON `json:"-"`
}
// attackLayer7TopAttacksResponseEnvelopeJSON contains the JSON metadata for the
// struct [AttackLayer7TopAttacksResponseEnvelope]
type attackLayer7TopAttacksResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopAttacksResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopAttacksResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopIndustryParams 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[[]AttackLayer7TopIndustryParamsDateRange] `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[AttackLayer7TopIndustryParamsFormat] `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 [AttackLayer7TopIndustryParams]'s query parameters as
// `url.Values`.
func (r AttackLayer7TopIndustryParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type AttackLayer7TopIndustryParamsDateRange string
const (
AttackLayer7TopIndustryParamsDateRange1d AttackLayer7TopIndustryParamsDateRange = "1d"
AttackLayer7TopIndustryParamsDateRange2d AttackLayer7TopIndustryParamsDateRange = "2d"
AttackLayer7TopIndustryParamsDateRange7d AttackLayer7TopIndustryParamsDateRange = "7d"
AttackLayer7TopIndustryParamsDateRange14d AttackLayer7TopIndustryParamsDateRange = "14d"
AttackLayer7TopIndustryParamsDateRange28d AttackLayer7TopIndustryParamsDateRange = "28d"
AttackLayer7TopIndustryParamsDateRange12w AttackLayer7TopIndustryParamsDateRange = "12w"
AttackLayer7TopIndustryParamsDateRange24w AttackLayer7TopIndustryParamsDateRange = "24w"
AttackLayer7TopIndustryParamsDateRange52w AttackLayer7TopIndustryParamsDateRange = "52w"
AttackLayer7TopIndustryParamsDateRange1dControl AttackLayer7TopIndustryParamsDateRange = "1dControl"
AttackLayer7TopIndustryParamsDateRange2dControl AttackLayer7TopIndustryParamsDateRange = "2dControl"
AttackLayer7TopIndustryParamsDateRange7dControl AttackLayer7TopIndustryParamsDateRange = "7dControl"
AttackLayer7TopIndustryParamsDateRange14dControl AttackLayer7TopIndustryParamsDateRange = "14dControl"
AttackLayer7TopIndustryParamsDateRange28dControl AttackLayer7TopIndustryParamsDateRange = "28dControl"
AttackLayer7TopIndustryParamsDateRange12wControl AttackLayer7TopIndustryParamsDateRange = "12wControl"
AttackLayer7TopIndustryParamsDateRange24wControl AttackLayer7TopIndustryParamsDateRange = "24wControl"
)
func (r AttackLayer7TopIndustryParamsDateRange) IsKnown() bool {
switch r {
case AttackLayer7TopIndustryParamsDateRange1d, AttackLayer7TopIndustryParamsDateRange2d, AttackLayer7TopIndustryParamsDateRange7d, AttackLayer7TopIndustryParamsDateRange14d, AttackLayer7TopIndustryParamsDateRange28d, AttackLayer7TopIndustryParamsDateRange12w, AttackLayer7TopIndustryParamsDateRange24w, AttackLayer7TopIndustryParamsDateRange52w, AttackLayer7TopIndustryParamsDateRange1dControl, AttackLayer7TopIndustryParamsDateRange2dControl, AttackLayer7TopIndustryParamsDateRange7dControl, AttackLayer7TopIndustryParamsDateRange14dControl, AttackLayer7TopIndustryParamsDateRange28dControl, AttackLayer7TopIndustryParamsDateRange12wControl, AttackLayer7TopIndustryParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type AttackLayer7TopIndustryParamsFormat string
const (
AttackLayer7TopIndustryParamsFormatJson AttackLayer7TopIndustryParamsFormat = "JSON"
AttackLayer7TopIndustryParamsFormatCsv AttackLayer7TopIndustryParamsFormat = "CSV"
)
func (r AttackLayer7TopIndustryParamsFormat) IsKnown() bool {
switch r {
case AttackLayer7TopIndustryParamsFormatJson, AttackLayer7TopIndustryParamsFormatCsv:
return true
}
return false
}
type AttackLayer7TopIndustryResponseEnvelope struct {
Result AttackLayer7TopIndustryResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON attackLayer7TopIndustryResponseEnvelopeJSON `json:"-"`
}
// attackLayer7TopIndustryResponseEnvelopeJSON contains the JSON metadata for the
// struct [AttackLayer7TopIndustryResponseEnvelope]
type attackLayer7TopIndustryResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopIndustryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopIndustryResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
type AttackLayer7TopVerticalParams 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[[]AttackLayer7TopVerticalParamsDateRange] `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[AttackLayer7TopVerticalParamsFormat] `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 [AttackLayer7TopVerticalParams]'s query parameters as
// `url.Values`.
func (r AttackLayer7TopVerticalParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type AttackLayer7TopVerticalParamsDateRange string
const (
AttackLayer7TopVerticalParamsDateRange1d AttackLayer7TopVerticalParamsDateRange = "1d"
AttackLayer7TopVerticalParamsDateRange2d AttackLayer7TopVerticalParamsDateRange = "2d"
AttackLayer7TopVerticalParamsDateRange7d AttackLayer7TopVerticalParamsDateRange = "7d"
AttackLayer7TopVerticalParamsDateRange14d AttackLayer7TopVerticalParamsDateRange = "14d"
AttackLayer7TopVerticalParamsDateRange28d AttackLayer7TopVerticalParamsDateRange = "28d"
AttackLayer7TopVerticalParamsDateRange12w AttackLayer7TopVerticalParamsDateRange = "12w"
AttackLayer7TopVerticalParamsDateRange24w AttackLayer7TopVerticalParamsDateRange = "24w"
AttackLayer7TopVerticalParamsDateRange52w AttackLayer7TopVerticalParamsDateRange = "52w"
AttackLayer7TopVerticalParamsDateRange1dControl AttackLayer7TopVerticalParamsDateRange = "1dControl"
AttackLayer7TopVerticalParamsDateRange2dControl AttackLayer7TopVerticalParamsDateRange = "2dControl"
AttackLayer7TopVerticalParamsDateRange7dControl AttackLayer7TopVerticalParamsDateRange = "7dControl"
AttackLayer7TopVerticalParamsDateRange14dControl AttackLayer7TopVerticalParamsDateRange = "14dControl"
AttackLayer7TopVerticalParamsDateRange28dControl AttackLayer7TopVerticalParamsDateRange = "28dControl"
AttackLayer7TopVerticalParamsDateRange12wControl AttackLayer7TopVerticalParamsDateRange = "12wControl"
AttackLayer7TopVerticalParamsDateRange24wControl AttackLayer7TopVerticalParamsDateRange = "24wControl"
)
func (r AttackLayer7TopVerticalParamsDateRange) IsKnown() bool {
switch r {
case AttackLayer7TopVerticalParamsDateRange1d, AttackLayer7TopVerticalParamsDateRange2d, AttackLayer7TopVerticalParamsDateRange7d, AttackLayer7TopVerticalParamsDateRange14d, AttackLayer7TopVerticalParamsDateRange28d, AttackLayer7TopVerticalParamsDateRange12w, AttackLayer7TopVerticalParamsDateRange24w, AttackLayer7TopVerticalParamsDateRange52w, AttackLayer7TopVerticalParamsDateRange1dControl, AttackLayer7TopVerticalParamsDateRange2dControl, AttackLayer7TopVerticalParamsDateRange7dControl, AttackLayer7TopVerticalParamsDateRange14dControl, AttackLayer7TopVerticalParamsDateRange28dControl, AttackLayer7TopVerticalParamsDateRange12wControl, AttackLayer7TopVerticalParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type AttackLayer7TopVerticalParamsFormat string
const (
AttackLayer7TopVerticalParamsFormatJson AttackLayer7TopVerticalParamsFormat = "JSON"
AttackLayer7TopVerticalParamsFormatCsv AttackLayer7TopVerticalParamsFormat = "CSV"
)
func (r AttackLayer7TopVerticalParamsFormat) IsKnown() bool {
switch r {
case AttackLayer7TopVerticalParamsFormatJson, AttackLayer7TopVerticalParamsFormatCsv:
return true
}
return false
}
type AttackLayer7TopVerticalResponseEnvelope struct {
Result AttackLayer7TopVerticalResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON attackLayer7TopVerticalResponseEnvelopeJSON `json:"-"`
}
// attackLayer7TopVerticalResponseEnvelopeJSON contains the JSON metadata for the
// struct [AttackLayer7TopVerticalResponseEnvelope]
type attackLayer7TopVerticalResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *AttackLayer7TopVerticalResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r attackLayer7TopVerticalResponseEnvelopeJSON) RawJSON() string {
return r.raw
}