-
Notifications
You must be signed in to change notification settings - Fork 541
/
connectiontampering.go
632 lines (550 loc) · 30.1 KB
/
connectiontampering.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
// 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"
)
// ConnectionTamperingService 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 [NewConnectionTamperingService]
// method instead.
type ConnectionTamperingService struct {
Options []option.RequestOption
}
// NewConnectionTamperingService 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 NewConnectionTamperingService(opts ...option.RequestOption) (r *ConnectionTamperingService) {
r = &ConnectionTamperingService{}
r.Options = opts
return
}
// Distribution of connection tampering types over a given time period.
func (r *ConnectionTamperingService) Summary(ctx context.Context, query ConnectionTamperingSummaryParams, opts ...option.RequestOption) (res *ConnectionTamperingSummaryResponse, err error) {
opts = append(r.Options[:], opts...)
var env ConnectionTamperingSummaryResponseEnvelope
path := "radar/connection_tampering/summary"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
// Distribution of connection tampering types over time.
func (r *ConnectionTamperingService) TimeseriesGroups(ctx context.Context, query ConnectionTamperingTimeseriesGroupsParams, opts ...option.RequestOption) (res *ConnectionTamperingTimeseriesGroupsResponse, err error) {
opts = append(r.Options[:], opts...)
var env ConnectionTamperingTimeseriesGroupsResponseEnvelope
path := "radar/connection_tampering/timeseries_groups"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &env, opts...)
if err != nil {
return
}
res = &env.Result
return
}
type ConnectionTamperingSummaryResponse struct {
Meta ConnectionTamperingSummaryResponseMeta `json:"meta,required"`
Summary0 ConnectionTamperingSummaryResponseSummary0 `json:"summary_0,required"`
JSON connectionTamperingSummaryResponseJSON `json:"-"`
}
// connectionTamperingSummaryResponseJSON contains the JSON metadata for the struct
// [ConnectionTamperingSummaryResponse]
type connectionTamperingSummaryResponseJSON struct {
Meta apijson.Field
Summary0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingSummaryResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingSummaryResponseJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingSummaryResponseMeta struct {
DateRange []ConnectionTamperingSummaryResponseMetaDateRange `json:"dateRange,required"`
ConfidenceInfo ConnectionTamperingSummaryResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON connectionTamperingSummaryResponseMetaJSON `json:"-"`
}
// connectionTamperingSummaryResponseMetaJSON contains the JSON metadata for the
// struct [ConnectionTamperingSummaryResponseMeta]
type connectionTamperingSummaryResponseMetaJSON struct {
DateRange apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingSummaryResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingSummaryResponseMetaJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingSummaryResponseMetaDateRange 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 connectionTamperingSummaryResponseMetaDateRangeJSON `json:"-"`
}
// connectionTamperingSummaryResponseMetaDateRangeJSON contains the JSON metadata
// for the struct [ConnectionTamperingSummaryResponseMetaDateRange]
type connectionTamperingSummaryResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingSummaryResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingSummaryResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingSummaryResponseMetaConfidenceInfo struct {
Annotations []ConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON connectionTamperingSummaryResponseMetaConfidenceInfoJSON `json:"-"`
}
// connectionTamperingSummaryResponseMetaConfidenceInfoJSON contains the JSON
// metadata for the struct [ConnectionTamperingSummaryResponseMetaConfidenceInfo]
type connectionTamperingSummaryResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingSummaryResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingSummaryResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation 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 connectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// connectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON contains the
// JSON metadata for the struct
// [ConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation]
type connectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON 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 *ConnectionTamperingSummaryResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingSummaryResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingSummaryResponseSummary0 struct {
// Connections matching signatures for tampering later in the connection, after the
// transfer of multiple data packets.
LaterInFlow string `json:"later_in_flow,required"`
// Connections that do not match any tampering signatures.
NoMatch string `json:"no_match,required"`
// Connections matching signatures for tampering after the receipt of a SYN packet
// and ACK packet, meaning the TCP connection was successfully established but the
// server did not receive any subsequent packets.
PostAck string `json:"post_ack,required"`
// Connections matching signatures for tampering after the receipt of a packet with
// PSH flag set, following connection establishment.
PostPsh string `json:"post_psh,required"`
// Connections matching signatures for tampering after the receipt of only a single
// SYN packet, and before the handshake completes.
PostSyn string `json:"post_syn,required"`
JSON connectionTamperingSummaryResponseSummary0JSON `json:"-"`
}
// connectionTamperingSummaryResponseSummary0JSON contains the JSON metadata for
// the struct [ConnectionTamperingSummaryResponseSummary0]
type connectionTamperingSummaryResponseSummary0JSON struct {
LaterInFlow apijson.Field
NoMatch apijson.Field
PostAck apijson.Field
PostPsh apijson.Field
PostSyn apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingSummaryResponseSummary0) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingSummaryResponseSummary0JSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingTimeseriesGroupsResponse struct {
Meta ConnectionTamperingTimeseriesGroupsResponseMeta `json:"meta,required"`
Serie0 ConnectionTamperingTimeseriesGroupsResponseSerie0 `json:"serie_0,required"`
JSON connectionTamperingTimeseriesGroupsResponseJSON `json:"-"`
}
// connectionTamperingTimeseriesGroupsResponseJSON contains the JSON metadata for
// the struct [ConnectionTamperingTimeseriesGroupsResponse]
type connectionTamperingTimeseriesGroupsResponseJSON struct {
Meta apijson.Field
Serie0 apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingTimeseriesGroupsResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingTimeseriesGroupsResponseJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingTimeseriesGroupsResponseMeta struct {
AggInterval string `json:"aggInterval,required"`
DateRange []ConnectionTamperingTimeseriesGroupsResponseMetaDateRange `json:"dateRange,required"`
LastUpdated time.Time `json:"lastUpdated,required" format:"date-time"`
ConfidenceInfo ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo `json:"confidenceInfo"`
JSON connectionTamperingTimeseriesGroupsResponseMetaJSON `json:"-"`
}
// connectionTamperingTimeseriesGroupsResponseMetaJSON contains the JSON metadata
// for the struct [ConnectionTamperingTimeseriesGroupsResponseMeta]
type connectionTamperingTimeseriesGroupsResponseMetaJSON struct {
AggInterval apijson.Field
DateRange apijson.Field
LastUpdated apijson.Field
ConfidenceInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingTimeseriesGroupsResponseMeta) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingTimeseriesGroupsResponseMetaJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingTimeseriesGroupsResponseMetaDateRange 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 connectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON `json:"-"`
}
// connectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON contains the JSON
// metadata for the struct
// [ConnectionTamperingTimeseriesGroupsResponseMetaDateRange]
type connectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON struct {
EndTime apijson.Field
StartTime apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingTimeseriesGroupsResponseMetaDateRange) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingTimeseriesGroupsResponseMetaDateRangeJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo struct {
Annotations []ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation `json:"annotations"`
Level int64 `json:"level"`
JSON connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON `json:"-"`
}
// connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON contains the
// JSON metadata for the struct
// [ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo]
type connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON struct {
Annotations apijson.Field
Level apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation 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 connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON `json:"-"`
}
// connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON
// contains the JSON metadata for the struct
// [ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation]
type connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON 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 *ConnectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotation) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingTimeseriesGroupsResponseMetaConfidenceInfoAnnotationJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingTimeseriesGroupsResponseSerie0 struct {
// Connections matching signatures for tampering later in the connection, after the
// transfer of multiple data packets.
LaterInFlow []string `json:"later_in_flow,required"`
// Connections that do not match any tampering signatures.
NoMatch []string `json:"no_match,required"`
// Connections matching signatures for tampering after the receipt of a SYN packet
// and ACK packet, meaning the TCP connection was successfully established but the
// server did not receive any subsequent packets.
PostAck []string `json:"post_ack,required"`
// Connections matching signatures for tampering after the receipt of a packet with
// PSH flag set, following connection establishment.
PostPsh []string `json:"post_psh,required"`
// Connections matching signatures for tampering after the receipt of only a single
// SYN packet, and before the handshake completes.
PostSyn []string `json:"post_syn,required"`
Timestamps []time.Time `json:"timestamps,required" format:"date-time"`
JSON connectionTamperingTimeseriesGroupsResponseSerie0JSON `json:"-"`
}
// connectionTamperingTimeseriesGroupsResponseSerie0JSON contains the JSON metadata
// for the struct [ConnectionTamperingTimeseriesGroupsResponseSerie0]
type connectionTamperingTimeseriesGroupsResponseSerie0JSON struct {
LaterInFlow apijson.Field
NoMatch apijson.Field
PostAck apijson.Field
PostPsh apijson.Field
PostSyn apijson.Field
Timestamps apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingTimeseriesGroupsResponseSerie0) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingTimeseriesGroupsResponseSerie0JSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingSummaryParams 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[[]ConnectionTamperingSummaryParamsDateRange] `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[ConnectionTamperingSummaryParamsFormat] `query:"format"`
// 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 [ConnectionTamperingSummaryParams]'s query parameters as
// `url.Values`.
func (r ConnectionTamperingSummaryParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type ConnectionTamperingSummaryParamsDateRange string
const (
ConnectionTamperingSummaryParamsDateRange1d ConnectionTamperingSummaryParamsDateRange = "1d"
ConnectionTamperingSummaryParamsDateRange2d ConnectionTamperingSummaryParamsDateRange = "2d"
ConnectionTamperingSummaryParamsDateRange7d ConnectionTamperingSummaryParamsDateRange = "7d"
ConnectionTamperingSummaryParamsDateRange14d ConnectionTamperingSummaryParamsDateRange = "14d"
ConnectionTamperingSummaryParamsDateRange28d ConnectionTamperingSummaryParamsDateRange = "28d"
ConnectionTamperingSummaryParamsDateRange12w ConnectionTamperingSummaryParamsDateRange = "12w"
ConnectionTamperingSummaryParamsDateRange24w ConnectionTamperingSummaryParamsDateRange = "24w"
ConnectionTamperingSummaryParamsDateRange52w ConnectionTamperingSummaryParamsDateRange = "52w"
ConnectionTamperingSummaryParamsDateRange1dControl ConnectionTamperingSummaryParamsDateRange = "1dControl"
ConnectionTamperingSummaryParamsDateRange2dControl ConnectionTamperingSummaryParamsDateRange = "2dControl"
ConnectionTamperingSummaryParamsDateRange7dControl ConnectionTamperingSummaryParamsDateRange = "7dControl"
ConnectionTamperingSummaryParamsDateRange14dControl ConnectionTamperingSummaryParamsDateRange = "14dControl"
ConnectionTamperingSummaryParamsDateRange28dControl ConnectionTamperingSummaryParamsDateRange = "28dControl"
ConnectionTamperingSummaryParamsDateRange12wControl ConnectionTamperingSummaryParamsDateRange = "12wControl"
ConnectionTamperingSummaryParamsDateRange24wControl ConnectionTamperingSummaryParamsDateRange = "24wControl"
)
func (r ConnectionTamperingSummaryParamsDateRange) IsKnown() bool {
switch r {
case ConnectionTamperingSummaryParamsDateRange1d, ConnectionTamperingSummaryParamsDateRange2d, ConnectionTamperingSummaryParamsDateRange7d, ConnectionTamperingSummaryParamsDateRange14d, ConnectionTamperingSummaryParamsDateRange28d, ConnectionTamperingSummaryParamsDateRange12w, ConnectionTamperingSummaryParamsDateRange24w, ConnectionTamperingSummaryParamsDateRange52w, ConnectionTamperingSummaryParamsDateRange1dControl, ConnectionTamperingSummaryParamsDateRange2dControl, ConnectionTamperingSummaryParamsDateRange7dControl, ConnectionTamperingSummaryParamsDateRange14dControl, ConnectionTamperingSummaryParamsDateRange28dControl, ConnectionTamperingSummaryParamsDateRange12wControl, ConnectionTamperingSummaryParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type ConnectionTamperingSummaryParamsFormat string
const (
ConnectionTamperingSummaryParamsFormatJson ConnectionTamperingSummaryParamsFormat = "JSON"
ConnectionTamperingSummaryParamsFormatCsv ConnectionTamperingSummaryParamsFormat = "CSV"
)
func (r ConnectionTamperingSummaryParamsFormat) IsKnown() bool {
switch r {
case ConnectionTamperingSummaryParamsFormatJson, ConnectionTamperingSummaryParamsFormatCsv:
return true
}
return false
}
type ConnectionTamperingSummaryResponseEnvelope struct {
Result ConnectionTamperingSummaryResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON connectionTamperingSummaryResponseEnvelopeJSON `json:"-"`
}
// connectionTamperingSummaryResponseEnvelopeJSON contains the JSON metadata for
// the struct [ConnectionTamperingSummaryResponseEnvelope]
type connectionTamperingSummaryResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingSummaryResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingSummaryResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
type ConnectionTamperingTimeseriesGroupsParams struct {
// Aggregation interval results should be returned in (for example, in 15 minutes
// or 1 hour intervals). Refer to
// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
AggInterval param.Field[ConnectionTamperingTimeseriesGroupsParamsAggInterval] `query:"aggInterval"`
// 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[[]ConnectionTamperingTimeseriesGroupsParamsDateRange] `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[ConnectionTamperingTimeseriesGroupsParamsFormat] `query:"format"`
// 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 [ConnectionTamperingTimeseriesGroupsParams]'s query
// parameters as `url.Values`.
func (r ConnectionTamperingTimeseriesGroupsParams) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
// Aggregation interval results should be returned in (for example, in 15 minutes
// or 1 hour intervals). Refer to
// [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/).
type ConnectionTamperingTimeseriesGroupsParamsAggInterval string
const (
ConnectionTamperingTimeseriesGroupsParamsAggInterval15m ConnectionTamperingTimeseriesGroupsParamsAggInterval = "15m"
ConnectionTamperingTimeseriesGroupsParamsAggInterval1h ConnectionTamperingTimeseriesGroupsParamsAggInterval = "1h"
ConnectionTamperingTimeseriesGroupsParamsAggInterval1d ConnectionTamperingTimeseriesGroupsParamsAggInterval = "1d"
ConnectionTamperingTimeseriesGroupsParamsAggInterval1w ConnectionTamperingTimeseriesGroupsParamsAggInterval = "1w"
)
func (r ConnectionTamperingTimeseriesGroupsParamsAggInterval) IsKnown() bool {
switch r {
case ConnectionTamperingTimeseriesGroupsParamsAggInterval15m, ConnectionTamperingTimeseriesGroupsParamsAggInterval1h, ConnectionTamperingTimeseriesGroupsParamsAggInterval1d, ConnectionTamperingTimeseriesGroupsParamsAggInterval1w:
return true
}
return false
}
type ConnectionTamperingTimeseriesGroupsParamsDateRange string
const (
ConnectionTamperingTimeseriesGroupsParamsDateRange1d ConnectionTamperingTimeseriesGroupsParamsDateRange = "1d"
ConnectionTamperingTimeseriesGroupsParamsDateRange2d ConnectionTamperingTimeseriesGroupsParamsDateRange = "2d"
ConnectionTamperingTimeseriesGroupsParamsDateRange7d ConnectionTamperingTimeseriesGroupsParamsDateRange = "7d"
ConnectionTamperingTimeseriesGroupsParamsDateRange14d ConnectionTamperingTimeseriesGroupsParamsDateRange = "14d"
ConnectionTamperingTimeseriesGroupsParamsDateRange28d ConnectionTamperingTimeseriesGroupsParamsDateRange = "28d"
ConnectionTamperingTimeseriesGroupsParamsDateRange12w ConnectionTamperingTimeseriesGroupsParamsDateRange = "12w"
ConnectionTamperingTimeseriesGroupsParamsDateRange24w ConnectionTamperingTimeseriesGroupsParamsDateRange = "24w"
ConnectionTamperingTimeseriesGroupsParamsDateRange52w ConnectionTamperingTimeseriesGroupsParamsDateRange = "52w"
ConnectionTamperingTimeseriesGroupsParamsDateRange1dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "1dControl"
ConnectionTamperingTimeseriesGroupsParamsDateRange2dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "2dControl"
ConnectionTamperingTimeseriesGroupsParamsDateRange7dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "7dControl"
ConnectionTamperingTimeseriesGroupsParamsDateRange14dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "14dControl"
ConnectionTamperingTimeseriesGroupsParamsDateRange28dControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "28dControl"
ConnectionTamperingTimeseriesGroupsParamsDateRange12wControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "12wControl"
ConnectionTamperingTimeseriesGroupsParamsDateRange24wControl ConnectionTamperingTimeseriesGroupsParamsDateRange = "24wControl"
)
func (r ConnectionTamperingTimeseriesGroupsParamsDateRange) IsKnown() bool {
switch r {
case ConnectionTamperingTimeseriesGroupsParamsDateRange1d, ConnectionTamperingTimeseriesGroupsParamsDateRange2d, ConnectionTamperingTimeseriesGroupsParamsDateRange7d, ConnectionTamperingTimeseriesGroupsParamsDateRange14d, ConnectionTamperingTimeseriesGroupsParamsDateRange28d, ConnectionTamperingTimeseriesGroupsParamsDateRange12w, ConnectionTamperingTimeseriesGroupsParamsDateRange24w, ConnectionTamperingTimeseriesGroupsParamsDateRange52w, ConnectionTamperingTimeseriesGroupsParamsDateRange1dControl, ConnectionTamperingTimeseriesGroupsParamsDateRange2dControl, ConnectionTamperingTimeseriesGroupsParamsDateRange7dControl, ConnectionTamperingTimeseriesGroupsParamsDateRange14dControl, ConnectionTamperingTimeseriesGroupsParamsDateRange28dControl, ConnectionTamperingTimeseriesGroupsParamsDateRange12wControl, ConnectionTamperingTimeseriesGroupsParamsDateRange24wControl:
return true
}
return false
}
// Format results are returned in.
type ConnectionTamperingTimeseriesGroupsParamsFormat string
const (
ConnectionTamperingTimeseriesGroupsParamsFormatJson ConnectionTamperingTimeseriesGroupsParamsFormat = "JSON"
ConnectionTamperingTimeseriesGroupsParamsFormatCsv ConnectionTamperingTimeseriesGroupsParamsFormat = "CSV"
)
func (r ConnectionTamperingTimeseriesGroupsParamsFormat) IsKnown() bool {
switch r {
case ConnectionTamperingTimeseriesGroupsParamsFormatJson, ConnectionTamperingTimeseriesGroupsParamsFormatCsv:
return true
}
return false
}
type ConnectionTamperingTimeseriesGroupsResponseEnvelope struct {
Result ConnectionTamperingTimeseriesGroupsResponse `json:"result,required"`
Success bool `json:"success,required"`
JSON connectionTamperingTimeseriesGroupsResponseEnvelopeJSON `json:"-"`
}
// connectionTamperingTimeseriesGroupsResponseEnvelopeJSON contains the JSON
// metadata for the struct [ConnectionTamperingTimeseriesGroupsResponseEnvelope]
type connectionTamperingTimeseriesGroupsResponseEnvelopeJSON struct {
Result apijson.Field
Success apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *ConnectionTamperingTimeseriesGroupsResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r connectionTamperingTimeseriesGroupsResponseEnvelopeJSON) RawJSON() string {
return r.raw
}