-
Notifications
You must be signed in to change notification settings - Fork 781
Expand file tree
/
Copy pathpolicy.go
More file actions
1364 lines (1225 loc) · 74.2 KB
/
Copy pathpolicy.go
File metadata and controls
1364 lines (1225 loc) · 74.2 KB
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
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package alerting
import (
"context"
"errors"
"fmt"
"net/http"
"slices"
"time"
"github.com/cloudflare/cloudflare-go/v7/internal/apijson"
"github.com/cloudflare/cloudflare-go/v7/internal/param"
"github.com/cloudflare/cloudflare-go/v7/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v7/option"
"github.com/cloudflare/cloudflare-go/v7/packages/pagination"
)
// PolicyService 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 [NewPolicyService] method instead.
type PolicyService struct {
Options []option.RequestOption
}
// NewPolicyService 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 NewPolicyService(opts ...option.RequestOption) (r *PolicyService) {
r = &PolicyService{}
r.Options = opts
return
}
// Creates a new Notification policy.
func (r *PolicyService) New(ctx context.Context, params PolicyNewParams, opts ...option.RequestOption) (res *PolicyNewResponse, err error) {
var env PolicyNewResponseEnvelope
opts = slices.Concat(r.Options, opts)
if params.AccountID.Value == "" {
err = errors.New("missing required account_id parameter")
return nil, err
}
path := fmt.Sprintf("accounts/%s/alerting/v3/policies", params.AccountID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
if err != nil {
return nil, err
}
res = &env.Result
return res, nil
}
// Update a Notification policy.
func (r *PolicyService) Update(ctx context.Context, policyID string, params PolicyUpdateParams, opts ...option.RequestOption) (res *PolicyUpdateResponse, err error) {
var env PolicyUpdateResponseEnvelope
opts = slices.Concat(r.Options, opts)
if params.AccountID.Value == "" {
err = errors.New("missing required account_id parameter")
return nil, err
}
if policyID == "" {
err = errors.New("missing required policy_id parameter")
return nil, err
}
path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", params.AccountID, policyID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &env, opts...)
if err != nil {
return nil, err
}
res = &env.Result
return res, nil
}
// Get a list of all Notification policies.
func (r *PolicyService) List(ctx context.Context, query PolicyListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Policy], err error) {
var raw *http.Response
opts = slices.Concat(r.Options, opts)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
if query.AccountID.Value == "" {
err = errors.New("missing required account_id parameter")
return nil, err
}
path := fmt.Sprintf("accounts/%s/alerting/v3/policies", query.AccountID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, nil, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// Get a list of all Notification policies.
func (r *PolicyService) ListAutoPaging(ctx context.Context, query PolicyListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Policy] {
return pagination.NewSinglePageAutoPager(r.List(ctx, query, opts...))
}
// Delete a Notification policy.
func (r *PolicyService) Delete(ctx context.Context, policyID string, body PolicyDeleteParams, opts ...option.RequestOption) (res *PolicyDeleteResponse, err error) {
opts = slices.Concat(r.Options, opts)
if body.AccountID.Value == "" {
err = errors.New("missing required account_id parameter")
return nil, err
}
if policyID == "" {
err = errors.New("missing required policy_id parameter")
return nil, err
}
path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", body.AccountID, policyID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &res, opts...)
return res, err
}
// Get details for a single policy.
func (r *PolicyService) Get(ctx context.Context, policyID string, query PolicyGetParams, opts ...option.RequestOption) (res *Policy, err error) {
var env PolicyGetResponseEnvelope
opts = slices.Concat(r.Options, opts)
if query.AccountID.Value == "" {
err = errors.New("missing required account_id parameter")
return nil, err
}
if policyID == "" {
err = errors.New("missing required policy_id parameter")
return nil, err
}
path := fmt.Sprintf("accounts/%s/alerting/v3/policies/%s", query.AccountID, policyID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &env, opts...)
if err != nil {
return nil, err
}
res = &env.Result
return res, nil
}
// List of IDs that will be used when dispatching a notification. IDs for email
// type will be the email address.
type Mechanism struct {
Email []MechanismEmail `json:"email"`
Pagerduty []MechanismPagerduty `json:"pagerduty"`
Webhooks []MechanismWebhook `json:"webhooks"`
JSON mechanismJSON `json:"-"`
}
// mechanismJSON contains the JSON metadata for the struct [Mechanism]
type mechanismJSON struct {
Email apijson.Field
Pagerduty apijson.Field
Webhooks apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *Mechanism) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r mechanismJSON) RawJSON() string {
return r.raw
}
type MechanismEmail struct {
// The email address
ID string `json:"id"`
JSON mechanismEmailJSON `json:"-"`
}
// mechanismEmailJSON contains the JSON metadata for the struct [MechanismEmail]
type mechanismEmailJSON struct {
ID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *MechanismEmail) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r mechanismEmailJSON) RawJSON() string {
return r.raw
}
type MechanismPagerduty struct {
// UUID
ID string `json:"id"`
JSON mechanismPagerdutyJSON `json:"-"`
}
// mechanismPagerdutyJSON contains the JSON metadata for the struct
// [MechanismPagerduty]
type mechanismPagerdutyJSON struct {
ID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *MechanismPagerduty) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r mechanismPagerdutyJSON) RawJSON() string {
return r.raw
}
type MechanismWebhook struct {
// UUID
ID string `json:"id"`
JSON mechanismWebhookJSON `json:"-"`
}
// mechanismWebhookJSON contains the JSON metadata for the struct
// [MechanismWebhook]
type mechanismWebhookJSON struct {
ID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *MechanismWebhook) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r mechanismWebhookJSON) RawJSON() string {
return r.raw
}
// List of IDs that will be used when dispatching a notification. IDs for email
// type will be the email address.
type MechanismParam struct {
Email param.Field[[]MechanismEmailParam] `json:"email"`
Pagerduty param.Field[[]MechanismPagerdutyParam] `json:"pagerduty"`
Webhooks param.Field[[]MechanismWebhookParam] `json:"webhooks"`
}
func (r MechanismParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type MechanismEmailParam struct {
// The email address
ID param.Field[string] `json:"id"`
}
func (r MechanismEmailParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type MechanismPagerdutyParam struct {
// UUID
ID param.Field[string] `json:"id"`
}
func (r MechanismPagerdutyParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type MechanismWebhookParam struct {
// UUID
ID param.Field[string] `json:"id"`
}
func (r MechanismWebhookParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type Policy struct {
// The unique identifier of a notification policy
ID string `json:"id"`
// Optional specification of how often to re-alert from the same incident, not
// support on all alert types.
AlertInterval string `json:"alert_interval"`
// Refers to which event will trigger a Notification dispatch. You can use the
// endpoint to get available alert types which then will give you a list of
// possible values.
AlertType PolicyAlertType `json:"alert_type"`
Created time.Time `json:"created" format:"date-time"`
// Optional description for the Notification policy.
Description string `json:"description"`
// Whether or not the Notification policy is enabled.
Enabled bool `json:"enabled"`
// Optional filters that allow you to be alerted only on a subset of events for
// that alert type based on some criteria. This is only available for select alert
// types. See alert type documentation for more details.
Filters PolicyFilter `json:"filters"`
// List of IDs that will be used when dispatching a notification. IDs for email
// type will be the email address.
Mechanisms Mechanism `json:"mechanisms"`
Modified time.Time `json:"modified" format:"date-time"`
// Name of the policy.
Name string `json:"name"`
JSON policyJSON `json:"-"`
}
// policyJSON contains the JSON metadata for the struct [Policy]
type policyJSON struct {
ID apijson.Field
AlertInterval apijson.Field
AlertType apijson.Field
Created apijson.Field
Description apijson.Field
Enabled apijson.Field
Filters apijson.Field
Mechanisms apijson.Field
Modified apijson.Field
Name apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *Policy) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyJSON) RawJSON() string {
return r.raw
}
// Refers to which event will trigger a Notification dispatch. You can use the
// endpoint to get available alert types which then will give you a list of
// possible values.
type PolicyAlertType string
const (
PolicyAlertTypeAbuseReportAlert PolicyAlertType = "abuse_report_alert"
PolicyAlertTypeAccessCustomCertificateExpirationType PolicyAlertType = "access_custom_certificate_expiration_type"
PolicyAlertTypeAdvancedDDoSAttackL4Alert PolicyAlertType = "advanced_ddos_attack_l4_alert"
PolicyAlertTypeAdvancedDDoSAttackL7Alert PolicyAlertType = "advanced_ddos_attack_l7_alert"
PolicyAlertTypeAdvancedHTTPAlertError PolicyAlertType = "advanced_http_alert_error"
PolicyAlertTypeBGPHijackNotification PolicyAlertType = "bgp_hijack_notification"
PolicyAlertTypeBillingUsageAlert PolicyAlertType = "billing_usage_alert"
PolicyAlertTypeBlockNotificationBlockRemoved PolicyAlertType = "block_notification_block_removed"
PolicyAlertTypeBlockNotificationNewBlock PolicyAlertType = "block_notification_new_block"
PolicyAlertTypeBlockNotificationReviewRejected PolicyAlertType = "block_notification_review_rejected"
PolicyAlertTypeBotTrafficBasicAlert PolicyAlertType = "bot_traffic_basic_alert"
PolicyAlertTypeBrandProtectionAlert PolicyAlertType = "brand_protection_alert"
PolicyAlertTypeBrandProtectionDigest PolicyAlertType = "brand_protection_digest"
PolicyAlertTypeClickhouseAlertFwAnomaly PolicyAlertType = "clickhouse_alert_fw_anomaly"
PolicyAlertTypeClickhouseAlertFwEntAnomaly PolicyAlertType = "clickhouse_alert_fw_ent_anomaly"
PolicyAlertTypeCloudforceOneRequestNotification PolicyAlertType = "cloudforce_one_request_notification"
PolicyAlertTypeCNIMaintenanceNotification PolicyAlertType = "cni_maintenance_notification"
PolicyAlertTypeCustomAnalytics PolicyAlertType = "custom_analytics"
PolicyAlertTypeCustomBotDetectionAlert PolicyAlertType = "custom_bot_detection_alert"
PolicyAlertTypeCustomSSLCertificateEventType PolicyAlertType = "custom_ssl_certificate_event_type"
PolicyAlertTypeDedicatedSSLCertificateEventType PolicyAlertType = "dedicated_ssl_certificate_event_type"
PolicyAlertTypeDeviceConnectivityAnomalyAlert PolicyAlertType = "device_connectivity_anomaly_alert"
PolicyAlertTypeDosAttackL4 PolicyAlertType = "dos_attack_l4"
PolicyAlertTypeDosAttackL7 PolicyAlertType = "dos_attack_l7"
PolicyAlertTypeExpiringServiceTokenAlert PolicyAlertType = "expiring_service_token_alert"
PolicyAlertTypeFailingLogpushJobDisabledAlert PolicyAlertType = "failing_logpush_job_disabled_alert"
PolicyAlertTypeFbmAutoAdvertisement PolicyAlertType = "fbm_auto_advertisement"
PolicyAlertTypeFbmDosdAttack PolicyAlertType = "fbm_dosd_attack"
PolicyAlertTypeFbmVolumetricAttack PolicyAlertType = "fbm_volumetric_attack"
PolicyAlertTypeHealthCheckStatusNotification PolicyAlertType = "health_check_status_notification"
PolicyAlertTypeHostnameAopCustomCertificateExpirationType PolicyAlertType = "hostname_aop_custom_certificate_expiration_type"
PolicyAlertTypeHTTPAlertEdgeError PolicyAlertType = "http_alert_edge_error"
PolicyAlertTypeHTTPAlertOriginError PolicyAlertType = "http_alert_origin_error"
PolicyAlertTypeImageNotification PolicyAlertType = "image_notification"
PolicyAlertTypeImageResizingNotification PolicyAlertType = "image_resizing_notification"
PolicyAlertTypeIncidentAlert PolicyAlertType = "incident_alert"
PolicyAlertTypeLoadBalancingHealthAlert PolicyAlertType = "load_balancing_health_alert"
PolicyAlertTypeLoadBalancingPoolEnablementAlert PolicyAlertType = "load_balancing_pool_enablement_alert"
PolicyAlertTypeLogoMatchAlert PolicyAlertType = "logo_match_alert"
PolicyAlertTypeMagicTunnelHealthCheckEvent PolicyAlertType = "magic_tunnel_health_check_event"
PolicyAlertTypeMagicWANTunnelHealth PolicyAlertType = "magic_wan_tunnel_health"
PolicyAlertTypeMaintenanceEventNotification PolicyAlertType = "maintenance_event_notification"
PolicyAlertTypeMTLSCertificateStoreCertificateExpirationType PolicyAlertType = "mtls_certificate_store_certificate_expiration_type"
PolicyAlertTypePagesEventAlert PolicyAlertType = "pages_event_alert"
PolicyAlertTypeRadarNotification PolicyAlertType = "radar_notification"
PolicyAlertTypeRealOriginMonitoring PolicyAlertType = "real_origin_monitoring"
PolicyAlertTypeScriptmonitorAlertNewCodeChangeDetections PolicyAlertType = "scriptmonitor_alert_new_code_change_detections"
PolicyAlertTypeScriptmonitorAlertNewHosts PolicyAlertType = "scriptmonitor_alert_new_hosts"
PolicyAlertTypeScriptmonitorAlertNewMaliciousHosts PolicyAlertType = "scriptmonitor_alert_new_malicious_hosts"
PolicyAlertTypeScriptmonitorAlertNewMaliciousScripts PolicyAlertType = "scriptmonitor_alert_new_malicious_scripts"
PolicyAlertTypeScriptmonitorAlertNewMaliciousURL PolicyAlertType = "scriptmonitor_alert_new_malicious_url"
PolicyAlertTypeScriptmonitorAlertNewMaxLengthResourceURL PolicyAlertType = "scriptmonitor_alert_new_max_length_resource_url"
PolicyAlertTypeScriptmonitorAlertNewResources PolicyAlertType = "scriptmonitor_alert_new_resources"
PolicyAlertTypeSecondaryDNSAllPrimariesFailing PolicyAlertType = "secondary_dns_all_primaries_failing"
PolicyAlertTypeSecondaryDNSPrimariesFailing PolicyAlertType = "secondary_dns_primaries_failing"
PolicyAlertTypeSecondaryDNSWarning PolicyAlertType = "secondary_dns_warning"
PolicyAlertTypeSecondaryDNSZoneSuccessfullyUpdated PolicyAlertType = "secondary_dns_zone_successfully_updated"
PolicyAlertTypeSecondaryDNSZoneValidationWarning PolicyAlertType = "secondary_dns_zone_validation_warning"
PolicyAlertTypeSecurityInsightsAlert PolicyAlertType = "security_insights_alert"
PolicyAlertTypeSentinelAlert PolicyAlertType = "sentinel_alert"
PolicyAlertTypeStreamLiveNotifications PolicyAlertType = "stream_live_notifications"
PolicyAlertTypeSyntheticTestLatencyAlert PolicyAlertType = "synthetic_test_latency_alert"
PolicyAlertTypeSyntheticTestLowAvailabilityAlert PolicyAlertType = "synthetic_test_low_availability_alert"
PolicyAlertTypeTrafficAnomaliesAlert PolicyAlertType = "traffic_anomalies_alert"
PolicyAlertTypeTunnelHealthEvent PolicyAlertType = "tunnel_health_event"
PolicyAlertTypeTunnelUpdateEvent PolicyAlertType = "tunnel_update_event"
PolicyAlertTypeUniversalSSLEventType PolicyAlertType = "universal_ssl_event_type"
PolicyAlertTypeWebAnalyticsMetricsUpdate PolicyAlertType = "web_analytics_metrics_update"
PolicyAlertTypeZoneAopCustomCertificateExpirationType PolicyAlertType = "zone_aop_custom_certificate_expiration_type"
)
func (r PolicyAlertType) IsKnown() bool {
switch r {
case PolicyAlertTypeAbuseReportAlert, PolicyAlertTypeAccessCustomCertificateExpirationType, PolicyAlertTypeAdvancedDDoSAttackL4Alert, PolicyAlertTypeAdvancedDDoSAttackL7Alert, PolicyAlertTypeAdvancedHTTPAlertError, PolicyAlertTypeBGPHijackNotification, PolicyAlertTypeBillingUsageAlert, PolicyAlertTypeBlockNotificationBlockRemoved, PolicyAlertTypeBlockNotificationNewBlock, PolicyAlertTypeBlockNotificationReviewRejected, PolicyAlertTypeBotTrafficBasicAlert, PolicyAlertTypeBrandProtectionAlert, PolicyAlertTypeBrandProtectionDigest, PolicyAlertTypeClickhouseAlertFwAnomaly, PolicyAlertTypeClickhouseAlertFwEntAnomaly, PolicyAlertTypeCloudforceOneRequestNotification, PolicyAlertTypeCNIMaintenanceNotification, PolicyAlertTypeCustomAnalytics, PolicyAlertTypeCustomBotDetectionAlert, PolicyAlertTypeCustomSSLCertificateEventType, PolicyAlertTypeDedicatedSSLCertificateEventType, PolicyAlertTypeDeviceConnectivityAnomalyAlert, PolicyAlertTypeDosAttackL4, PolicyAlertTypeDosAttackL7, PolicyAlertTypeExpiringServiceTokenAlert, PolicyAlertTypeFailingLogpushJobDisabledAlert, PolicyAlertTypeFbmAutoAdvertisement, PolicyAlertTypeFbmDosdAttack, PolicyAlertTypeFbmVolumetricAttack, PolicyAlertTypeHealthCheckStatusNotification, PolicyAlertTypeHostnameAopCustomCertificateExpirationType, PolicyAlertTypeHTTPAlertEdgeError, PolicyAlertTypeHTTPAlertOriginError, PolicyAlertTypeImageNotification, PolicyAlertTypeImageResizingNotification, PolicyAlertTypeIncidentAlert, PolicyAlertTypeLoadBalancingHealthAlert, PolicyAlertTypeLoadBalancingPoolEnablementAlert, PolicyAlertTypeLogoMatchAlert, PolicyAlertTypeMagicTunnelHealthCheckEvent, PolicyAlertTypeMagicWANTunnelHealth, PolicyAlertTypeMaintenanceEventNotification, PolicyAlertTypeMTLSCertificateStoreCertificateExpirationType, PolicyAlertTypePagesEventAlert, PolicyAlertTypeRadarNotification, PolicyAlertTypeRealOriginMonitoring, PolicyAlertTypeScriptmonitorAlertNewCodeChangeDetections, PolicyAlertTypeScriptmonitorAlertNewHosts, PolicyAlertTypeScriptmonitorAlertNewMaliciousHosts, PolicyAlertTypeScriptmonitorAlertNewMaliciousScripts, PolicyAlertTypeScriptmonitorAlertNewMaliciousURL, PolicyAlertTypeScriptmonitorAlertNewMaxLengthResourceURL, PolicyAlertTypeScriptmonitorAlertNewResources, PolicyAlertTypeSecondaryDNSAllPrimariesFailing, PolicyAlertTypeSecondaryDNSPrimariesFailing, PolicyAlertTypeSecondaryDNSWarning, PolicyAlertTypeSecondaryDNSZoneSuccessfullyUpdated, PolicyAlertTypeSecondaryDNSZoneValidationWarning, PolicyAlertTypeSecurityInsightsAlert, PolicyAlertTypeSentinelAlert, PolicyAlertTypeStreamLiveNotifications, PolicyAlertTypeSyntheticTestLatencyAlert, PolicyAlertTypeSyntheticTestLowAvailabilityAlert, PolicyAlertTypeTrafficAnomaliesAlert, PolicyAlertTypeTunnelHealthEvent, PolicyAlertTypeTunnelUpdateEvent, PolicyAlertTypeUniversalSSLEventType, PolicyAlertTypeWebAnalyticsMetricsUpdate, PolicyAlertTypeZoneAopCustomCertificateExpirationType:
return true
}
return false
}
// Optional filters that allow you to be alerted only on a subset of events for
// that alert type based on some criteria. This is only available for select alert
// types. See alert type documentation for more details.
type PolicyFilter struct {
// Usage depends on specific alert type
Actions []string `json:"actions"`
// Used for configuring radar_notification
AffectedASNs []string `json:"affected_asns"`
// Used for configuring incident_alert
AffectedComponents []string `json:"affected_components"`
// Used for configuring radar_notification
AffectedLocations []string `json:"affected_locations"`
// Used for configuring maintenance_event_notification
AirportCode []string `json:"airport_code"`
// Usage depends on specific alert type
AlertTriggerPreferences []string `json:"alert_trigger_preferences"`
// Usage depends on specific alert type
AlertTriggerPreferencesValue []string `json:"alert_trigger_preferences_value"`
// Used for configuring load_balancing_pool_enablement_alert
Enabled []string `json:"enabled"`
// Used for configuring pages_event_alert
Environment []string `json:"environment"`
// Used for configuring pages_event_alert
Event []string `json:"event"`
// Used for configuring load_balancing_health_alert
EventSource []string `json:"event_source"`
// Usage depends on specific alert type
EventType []string `json:"event_type"`
// Usage depends on specific alert type
GroupBy []string `json:"group_by"`
// Used for configuring health_check_status_notification
HealthCheckID []string `json:"health_check_id"`
// Used for configuring incident_alert
IncidentImpact []PolicyFilterIncidentImpact `json:"incident_impact"`
// Used for configuring stream_live_notifications
InputID []string `json:"input_id"`
// Used for configuring security_insights_alert
InsightClass []string `json:"insight_class"`
// Used for configuring billing_usage_alert
Limit []string `json:"limit"`
// Used for configuring logo_match_alert
LogoTag []string `json:"logo_tag"`
// Used for configuring advanced_ddos_attack_l4_alert
MegabitsPerSecond []string `json:"megabits_per_second"`
// Used for configuring load_balancing_health_alert
NewHealth []string `json:"new_health"`
// Used for configuring tunnel_health_event
NewStatus []string `json:"new_status"`
// Used for configuring advanced_ddos_attack_l4_alert
PacketsPerSecond []string `json:"packets_per_second"`
// Usage depends on specific alert type
PoolID []string `json:"pool_id"`
// Usage depends on specific alert type
POPNames []string `json:"pop_names"`
// Used for configuring billing_usage_alert
Product []string `json:"product"`
// Used for configuring pages_event_alert
ProjectID []string `json:"project_id"`
// Used for configuring advanced_ddos_attack_l4_alert
Protocol []string `json:"protocol"`
// Usage depends on specific alert type
QueryTag []string `json:"query_tag"`
// Used for configuring advanced_ddos_attack_l7_alert
RequestsPerSecond []string `json:"requests_per_second"`
// Usage depends on specific alert type
Selectors []string `json:"selectors"`
// Used for configuring clickhouse_alert_fw_ent_anomaly
Services []string `json:"services"`
// Usage depends on specific alert type
Slo []string `json:"slo"`
// Used for configuring health_check_status_notification
Status []string `json:"status"`
// Used for configuring advanced_ddos_attack_l7_alert
TargetHostname []string `json:"target_hostname"`
// Used for configuring advanced_ddos_attack_l4_alert
TargetIP []string `json:"target_ip"`
// Used for configuring advanced_ddos_attack_l7_alert
TargetZoneName []string `json:"target_zone_name"`
// Access service token IDs to include for expiring_service_token_alert. Omit this
// property to include all current and future service tokens.
TokenID []string `json:"token_id"`
// Used for configuring traffic_anomalies_alert
TrafficExclusions []PolicyFilterTrafficExclusion `json:"traffic_exclusions"`
// Used for configuring tunnel_health_event
TunnelID []string `json:"tunnel_id"`
// Usage depends on specific alert type
TunnelName []string `json:"tunnel_name"`
// Usage depends on specific alert type
Type []string `json:"type"`
// Usage depends on specific alert type
Where []string `json:"where"`
// Usage depends on specific alert type
Zones []string `json:"zones"`
JSON policyFilterJSON `json:"-"`
}
// policyFilterJSON contains the JSON metadata for the struct [PolicyFilter]
type policyFilterJSON struct {
Actions apijson.Field
AffectedASNs apijson.Field
AffectedComponents apijson.Field
AffectedLocations apijson.Field
AirportCode apijson.Field
AlertTriggerPreferences apijson.Field
AlertTriggerPreferencesValue apijson.Field
Enabled apijson.Field
Environment apijson.Field
Event apijson.Field
EventSource apijson.Field
EventType apijson.Field
GroupBy apijson.Field
HealthCheckID apijson.Field
IncidentImpact apijson.Field
InputID apijson.Field
InsightClass apijson.Field
Limit apijson.Field
LogoTag apijson.Field
MegabitsPerSecond apijson.Field
NewHealth apijson.Field
NewStatus apijson.Field
PacketsPerSecond apijson.Field
PoolID apijson.Field
POPNames apijson.Field
Product apijson.Field
ProjectID apijson.Field
Protocol apijson.Field
QueryTag apijson.Field
RequestsPerSecond apijson.Field
Selectors apijson.Field
Services apijson.Field
Slo apijson.Field
Status apijson.Field
TargetHostname apijson.Field
TargetIP apijson.Field
TargetZoneName apijson.Field
TokenID apijson.Field
TrafficExclusions apijson.Field
TunnelID apijson.Field
TunnelName apijson.Field
Type apijson.Field
Where apijson.Field
Zones apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PolicyFilter) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyFilterJSON) RawJSON() string {
return r.raw
}
type PolicyFilterIncidentImpact string
const (
PolicyFilterIncidentImpactIncidentImpactNone PolicyFilterIncidentImpact = "INCIDENT_IMPACT_NONE"
PolicyFilterIncidentImpactIncidentImpactMinor PolicyFilterIncidentImpact = "INCIDENT_IMPACT_MINOR"
PolicyFilterIncidentImpactIncidentImpactMajor PolicyFilterIncidentImpact = "INCIDENT_IMPACT_MAJOR"
PolicyFilterIncidentImpactIncidentImpactCritical PolicyFilterIncidentImpact = "INCIDENT_IMPACT_CRITICAL"
)
func (r PolicyFilterIncidentImpact) IsKnown() bool {
switch r {
case PolicyFilterIncidentImpactIncidentImpactNone, PolicyFilterIncidentImpactIncidentImpactMinor, PolicyFilterIncidentImpactIncidentImpactMajor, PolicyFilterIncidentImpactIncidentImpactCritical:
return true
}
return false
}
type PolicyFilterTrafficExclusion string
const (
PolicyFilterTrafficExclusionSecurityEvents PolicyFilterTrafficExclusion = "security_events"
)
func (r PolicyFilterTrafficExclusion) IsKnown() bool {
switch r {
case PolicyFilterTrafficExclusionSecurityEvents:
return true
}
return false
}
// Optional filters that allow you to be alerted only on a subset of events for
// that alert type based on some criteria. This is only available for select alert
// types. See alert type documentation for more details.
type PolicyFilterParam struct {
// Usage depends on specific alert type
Actions param.Field[[]string] `json:"actions"`
// Used for configuring radar_notification
AffectedASNs param.Field[[]string] `json:"affected_asns"`
// Used for configuring incident_alert
AffectedComponents param.Field[[]string] `json:"affected_components"`
// Used for configuring radar_notification
AffectedLocations param.Field[[]string] `json:"affected_locations"`
// Used for configuring maintenance_event_notification
AirportCode param.Field[[]string] `json:"airport_code"`
// Usage depends on specific alert type
AlertTriggerPreferences param.Field[[]string] `json:"alert_trigger_preferences"`
// Usage depends on specific alert type
AlertTriggerPreferencesValue param.Field[[]string] `json:"alert_trigger_preferences_value"`
// Used for configuring load_balancing_pool_enablement_alert
Enabled param.Field[[]string] `json:"enabled"`
// Used for configuring pages_event_alert
Environment param.Field[[]string] `json:"environment"`
// Used for configuring pages_event_alert
Event param.Field[[]string] `json:"event"`
// Used for configuring load_balancing_health_alert
EventSource param.Field[[]string] `json:"event_source"`
// Usage depends on specific alert type
EventType param.Field[[]string] `json:"event_type"`
// Usage depends on specific alert type
GroupBy param.Field[[]string] `json:"group_by"`
// Used for configuring health_check_status_notification
HealthCheckID param.Field[[]string] `json:"health_check_id"`
// Used for configuring incident_alert
IncidentImpact param.Field[[]PolicyFilterIncidentImpact] `json:"incident_impact"`
// Used for configuring stream_live_notifications
InputID param.Field[[]string] `json:"input_id"`
// Used for configuring security_insights_alert
InsightClass param.Field[[]string] `json:"insight_class"`
// Used for configuring billing_usage_alert
Limit param.Field[[]string] `json:"limit"`
// Used for configuring logo_match_alert
LogoTag param.Field[[]string] `json:"logo_tag"`
// Used for configuring advanced_ddos_attack_l4_alert
MegabitsPerSecond param.Field[[]string] `json:"megabits_per_second"`
// Used for configuring load_balancing_health_alert
NewHealth param.Field[[]string] `json:"new_health"`
// Used for configuring tunnel_health_event
NewStatus param.Field[[]string] `json:"new_status"`
// Used for configuring advanced_ddos_attack_l4_alert
PacketsPerSecond param.Field[[]string] `json:"packets_per_second"`
// Usage depends on specific alert type
PoolID param.Field[[]string] `json:"pool_id"`
// Usage depends on specific alert type
POPNames param.Field[[]string] `json:"pop_names"`
// Used for configuring billing_usage_alert
Product param.Field[[]string] `json:"product"`
// Used for configuring pages_event_alert
ProjectID param.Field[[]string] `json:"project_id"`
// Used for configuring advanced_ddos_attack_l4_alert
Protocol param.Field[[]string] `json:"protocol"`
// Usage depends on specific alert type
QueryTag param.Field[[]string] `json:"query_tag"`
// Used for configuring advanced_ddos_attack_l7_alert
RequestsPerSecond param.Field[[]string] `json:"requests_per_second"`
// Usage depends on specific alert type
Selectors param.Field[[]string] `json:"selectors"`
// Used for configuring clickhouse_alert_fw_ent_anomaly
Services param.Field[[]string] `json:"services"`
// Usage depends on specific alert type
Slo param.Field[[]string] `json:"slo"`
// Used for configuring health_check_status_notification
Status param.Field[[]string] `json:"status"`
// Used for configuring advanced_ddos_attack_l7_alert
TargetHostname param.Field[[]string] `json:"target_hostname"`
// Used for configuring advanced_ddos_attack_l4_alert
TargetIP param.Field[[]string] `json:"target_ip"`
// Used for configuring advanced_ddos_attack_l7_alert
TargetZoneName param.Field[[]string] `json:"target_zone_name"`
// Access service token IDs to include for expiring_service_token_alert. Omit this
// property to include all current and future service tokens.
TokenID param.Field[[]string] `json:"token_id"`
// Used for configuring traffic_anomalies_alert
TrafficExclusions param.Field[[]PolicyFilterTrafficExclusion] `json:"traffic_exclusions"`
// Used for configuring tunnel_health_event
TunnelID param.Field[[]string] `json:"tunnel_id"`
// Usage depends on specific alert type
TunnelName param.Field[[]string] `json:"tunnel_name"`
// Usage depends on specific alert type
Type param.Field[[]string] `json:"type"`
// Usage depends on specific alert type
Where param.Field[[]string] `json:"where"`
// Usage depends on specific alert type
Zones param.Field[[]string] `json:"zones"`
}
func (r PolicyFilterParam) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
type PolicyNewResponse struct {
// UUID
ID string `json:"id"`
JSON policyNewResponseJSON `json:"-"`
}
// policyNewResponseJSON contains the JSON metadata for the struct
// [PolicyNewResponse]
type policyNewResponseJSON struct {
ID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PolicyNewResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyNewResponseJSON) RawJSON() string {
return r.raw
}
type PolicyUpdateResponse struct {
// UUID
ID string `json:"id"`
JSON policyUpdateResponseJSON `json:"-"`
}
// policyUpdateResponseJSON contains the JSON metadata for the struct
// [PolicyUpdateResponse]
type policyUpdateResponseJSON struct {
ID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PolicyUpdateResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyUpdateResponseJSON) RawJSON() string {
return r.raw
}
type PolicyDeleteResponse struct {
Errors []PolicyDeleteResponseError `json:"errors" api:"required"`
Messages []PolicyDeleteResponseMessage `json:"messages" api:"required"`
// Whether the API call was successful
Success PolicyDeleteResponseSuccess `json:"success" api:"required"`
ResultInfo PolicyDeleteResponseResultInfo `json:"result_info"`
JSON policyDeleteResponseJSON `json:"-"`
}
// policyDeleteResponseJSON contains the JSON metadata for the struct
// [PolicyDeleteResponse]
type policyDeleteResponseJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
ResultInfo apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PolicyDeleteResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyDeleteResponseJSON) RawJSON() string {
return r.raw
}
type PolicyDeleteResponseError struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON policyDeleteResponseErrorJSON `json:"-"`
}
// policyDeleteResponseErrorJSON contains the JSON metadata for the struct
// [PolicyDeleteResponseError]
type policyDeleteResponseErrorJSON struct {
Message apijson.Field
Code apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PolicyDeleteResponseError) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyDeleteResponseErrorJSON) RawJSON() string {
return r.raw
}
type PolicyDeleteResponseMessage struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON policyDeleteResponseMessageJSON `json:"-"`
}
// policyDeleteResponseMessageJSON contains the JSON metadata for the struct
// [PolicyDeleteResponseMessage]
type policyDeleteResponseMessageJSON struct {
Message apijson.Field
Code apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PolicyDeleteResponseMessage) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyDeleteResponseMessageJSON) RawJSON() string {
return r.raw
}
// Whether the API call was successful
type PolicyDeleteResponseSuccess bool
const (
PolicyDeleteResponseSuccessTrue PolicyDeleteResponseSuccess = true
)
func (r PolicyDeleteResponseSuccess) IsKnown() bool {
switch r {
case PolicyDeleteResponseSuccessTrue:
return true
}
return false
}
type PolicyDeleteResponseResultInfo struct {
// Total number of results for the requested service
Count float64 `json:"count"`
// Current page within paginated list of results
Page float64 `json:"page"`
// Number of results per page of results
PerPage float64 `json:"per_page"`
// Total results available without any search parameters
TotalCount float64 `json:"total_count"`
JSON policyDeleteResponseResultInfoJSON `json:"-"`
}
// policyDeleteResponseResultInfoJSON contains the JSON metadata for the struct
// [PolicyDeleteResponseResultInfo]
type policyDeleteResponseResultInfoJSON struct {
Count apijson.Field
Page apijson.Field
PerPage apijson.Field
TotalCount apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PolicyDeleteResponseResultInfo) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyDeleteResponseResultInfoJSON) RawJSON() string {
return r.raw
}
type PolicyNewParams struct {
// The account id
AccountID param.Field[string] `path:"account_id" api:"required"`
// Refers to which event will trigger a Notification dispatch. You can use the
// endpoint to get available alert types which then will give you a list of
// possible values.
AlertType param.Field[PolicyNewParamsAlertType] `json:"alert_type" api:"required"`
// Whether or not the Notification policy is enabled.
Enabled param.Field[bool] `json:"enabled" api:"required"`
// List of IDs that will be used when dispatching a notification. IDs for email
// type will be the email address.
Mechanisms param.Field[MechanismParam] `json:"mechanisms" api:"required"`
// Name of the policy.
Name param.Field[string] `json:"name" api:"required"`
// Optional specification of how often to re-alert from the same incident, not
// support on all alert types.
AlertInterval param.Field[string] `json:"alert_interval"`
// Optional description for the Notification policy.
Description param.Field[string] `json:"description"`
// Optional filters that allow you to be alerted only on a subset of events for
// that alert type based on some criteria. This is only available for select alert
// types. See alert type documentation for more details.
Filters param.Field[PolicyFilterParam] `json:"filters"`
}
func (r PolicyNewParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Refers to which event will trigger a Notification dispatch. You can use the
// endpoint to get available alert types which then will give you a list of
// possible values.
type PolicyNewParamsAlertType string
const (
PolicyNewParamsAlertTypeAbuseReportAlert PolicyNewParamsAlertType = "abuse_report_alert"
PolicyNewParamsAlertTypeAccessCustomCertificateExpirationType PolicyNewParamsAlertType = "access_custom_certificate_expiration_type"
PolicyNewParamsAlertTypeAdvancedDDoSAttackL4Alert PolicyNewParamsAlertType = "advanced_ddos_attack_l4_alert"
PolicyNewParamsAlertTypeAdvancedDDoSAttackL7Alert PolicyNewParamsAlertType = "advanced_ddos_attack_l7_alert"
PolicyNewParamsAlertTypeAdvancedHTTPAlertError PolicyNewParamsAlertType = "advanced_http_alert_error"
PolicyNewParamsAlertTypeBGPHijackNotification PolicyNewParamsAlertType = "bgp_hijack_notification"
PolicyNewParamsAlertTypeBillingUsageAlert PolicyNewParamsAlertType = "billing_usage_alert"
PolicyNewParamsAlertTypeBlockNotificationBlockRemoved PolicyNewParamsAlertType = "block_notification_block_removed"
PolicyNewParamsAlertTypeBlockNotificationNewBlock PolicyNewParamsAlertType = "block_notification_new_block"
PolicyNewParamsAlertTypeBlockNotificationReviewRejected PolicyNewParamsAlertType = "block_notification_review_rejected"
PolicyNewParamsAlertTypeBotTrafficBasicAlert PolicyNewParamsAlertType = "bot_traffic_basic_alert"
PolicyNewParamsAlertTypeBrandProtectionAlert PolicyNewParamsAlertType = "brand_protection_alert"
PolicyNewParamsAlertTypeBrandProtectionDigest PolicyNewParamsAlertType = "brand_protection_digest"
PolicyNewParamsAlertTypeClickhouseAlertFwAnomaly PolicyNewParamsAlertType = "clickhouse_alert_fw_anomaly"
PolicyNewParamsAlertTypeClickhouseAlertFwEntAnomaly PolicyNewParamsAlertType = "clickhouse_alert_fw_ent_anomaly"
PolicyNewParamsAlertTypeCloudforceOneRequestNotification PolicyNewParamsAlertType = "cloudforce_one_request_notification"
PolicyNewParamsAlertTypeCNIMaintenanceNotification PolicyNewParamsAlertType = "cni_maintenance_notification"
PolicyNewParamsAlertTypeCustomAnalytics PolicyNewParamsAlertType = "custom_analytics"
PolicyNewParamsAlertTypeCustomBotDetectionAlert PolicyNewParamsAlertType = "custom_bot_detection_alert"
PolicyNewParamsAlertTypeCustomSSLCertificateEventType PolicyNewParamsAlertType = "custom_ssl_certificate_event_type"
PolicyNewParamsAlertTypeDedicatedSSLCertificateEventType PolicyNewParamsAlertType = "dedicated_ssl_certificate_event_type"
PolicyNewParamsAlertTypeDeviceConnectivityAnomalyAlert PolicyNewParamsAlertType = "device_connectivity_anomaly_alert"
PolicyNewParamsAlertTypeDosAttackL4 PolicyNewParamsAlertType = "dos_attack_l4"
PolicyNewParamsAlertTypeDosAttackL7 PolicyNewParamsAlertType = "dos_attack_l7"
PolicyNewParamsAlertTypeExpiringServiceTokenAlert PolicyNewParamsAlertType = "expiring_service_token_alert"
PolicyNewParamsAlertTypeFailingLogpushJobDisabledAlert PolicyNewParamsAlertType = "failing_logpush_job_disabled_alert"
PolicyNewParamsAlertTypeFbmAutoAdvertisement PolicyNewParamsAlertType = "fbm_auto_advertisement"
PolicyNewParamsAlertTypeFbmDosdAttack PolicyNewParamsAlertType = "fbm_dosd_attack"
PolicyNewParamsAlertTypeFbmVolumetricAttack PolicyNewParamsAlertType = "fbm_volumetric_attack"
PolicyNewParamsAlertTypeHealthCheckStatusNotification PolicyNewParamsAlertType = "health_check_status_notification"
PolicyNewParamsAlertTypeHostnameAopCustomCertificateExpirationType PolicyNewParamsAlertType = "hostname_aop_custom_certificate_expiration_type"
PolicyNewParamsAlertTypeHTTPAlertEdgeError PolicyNewParamsAlertType = "http_alert_edge_error"
PolicyNewParamsAlertTypeHTTPAlertOriginError PolicyNewParamsAlertType = "http_alert_origin_error"
PolicyNewParamsAlertTypeImageNotification PolicyNewParamsAlertType = "image_notification"
PolicyNewParamsAlertTypeImageResizingNotification PolicyNewParamsAlertType = "image_resizing_notification"
PolicyNewParamsAlertTypeIncidentAlert PolicyNewParamsAlertType = "incident_alert"
PolicyNewParamsAlertTypeLoadBalancingHealthAlert PolicyNewParamsAlertType = "load_balancing_health_alert"
PolicyNewParamsAlertTypeLoadBalancingPoolEnablementAlert PolicyNewParamsAlertType = "load_balancing_pool_enablement_alert"
PolicyNewParamsAlertTypeLogoMatchAlert PolicyNewParamsAlertType = "logo_match_alert"
PolicyNewParamsAlertTypeMagicTunnelHealthCheckEvent PolicyNewParamsAlertType = "magic_tunnel_health_check_event"
PolicyNewParamsAlertTypeMagicWANTunnelHealth PolicyNewParamsAlertType = "magic_wan_tunnel_health"
PolicyNewParamsAlertTypeMaintenanceEventNotification PolicyNewParamsAlertType = "maintenance_event_notification"
PolicyNewParamsAlertTypeMTLSCertificateStoreCertificateExpirationType PolicyNewParamsAlertType = "mtls_certificate_store_certificate_expiration_type"
PolicyNewParamsAlertTypePagesEventAlert PolicyNewParamsAlertType = "pages_event_alert"
PolicyNewParamsAlertTypeRadarNotification PolicyNewParamsAlertType = "radar_notification"
PolicyNewParamsAlertTypeRealOriginMonitoring PolicyNewParamsAlertType = "real_origin_monitoring"
PolicyNewParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections PolicyNewParamsAlertType = "scriptmonitor_alert_new_code_change_detections"
PolicyNewParamsAlertTypeScriptmonitorAlertNewHosts PolicyNewParamsAlertType = "scriptmonitor_alert_new_hosts"
PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousHosts PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_hosts"
PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousScripts PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_scripts"
PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousURL PolicyNewParamsAlertType = "scriptmonitor_alert_new_malicious_url"
PolicyNewParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL PolicyNewParamsAlertType = "scriptmonitor_alert_new_max_length_resource_url"
PolicyNewParamsAlertTypeScriptmonitorAlertNewResources PolicyNewParamsAlertType = "scriptmonitor_alert_new_resources"
PolicyNewParamsAlertTypeSecondaryDNSAllPrimariesFailing PolicyNewParamsAlertType = "secondary_dns_all_primaries_failing"
PolicyNewParamsAlertTypeSecondaryDNSPrimariesFailing PolicyNewParamsAlertType = "secondary_dns_primaries_failing"
PolicyNewParamsAlertTypeSecondaryDNSWarning PolicyNewParamsAlertType = "secondary_dns_warning"
PolicyNewParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated PolicyNewParamsAlertType = "secondary_dns_zone_successfully_updated"
PolicyNewParamsAlertTypeSecondaryDNSZoneValidationWarning PolicyNewParamsAlertType = "secondary_dns_zone_validation_warning"
PolicyNewParamsAlertTypeSecurityInsightsAlert PolicyNewParamsAlertType = "security_insights_alert"
PolicyNewParamsAlertTypeSentinelAlert PolicyNewParamsAlertType = "sentinel_alert"
PolicyNewParamsAlertTypeStreamLiveNotifications PolicyNewParamsAlertType = "stream_live_notifications"
PolicyNewParamsAlertTypeSyntheticTestLatencyAlert PolicyNewParamsAlertType = "synthetic_test_latency_alert"
PolicyNewParamsAlertTypeSyntheticTestLowAvailabilityAlert PolicyNewParamsAlertType = "synthetic_test_low_availability_alert"
PolicyNewParamsAlertTypeTrafficAnomaliesAlert PolicyNewParamsAlertType = "traffic_anomalies_alert"
PolicyNewParamsAlertTypeTunnelHealthEvent PolicyNewParamsAlertType = "tunnel_health_event"
PolicyNewParamsAlertTypeTunnelUpdateEvent PolicyNewParamsAlertType = "tunnel_update_event"
PolicyNewParamsAlertTypeUniversalSSLEventType PolicyNewParamsAlertType = "universal_ssl_event_type"
PolicyNewParamsAlertTypeWebAnalyticsMetricsUpdate PolicyNewParamsAlertType = "web_analytics_metrics_update"
PolicyNewParamsAlertTypeZoneAopCustomCertificateExpirationType PolicyNewParamsAlertType = "zone_aop_custom_certificate_expiration_type"
)
func (r PolicyNewParamsAlertType) IsKnown() bool {
switch r {
case PolicyNewParamsAlertTypeAbuseReportAlert, PolicyNewParamsAlertTypeAccessCustomCertificateExpirationType, PolicyNewParamsAlertTypeAdvancedDDoSAttackL4Alert, PolicyNewParamsAlertTypeAdvancedDDoSAttackL7Alert, PolicyNewParamsAlertTypeAdvancedHTTPAlertError, PolicyNewParamsAlertTypeBGPHijackNotification, PolicyNewParamsAlertTypeBillingUsageAlert, PolicyNewParamsAlertTypeBlockNotificationBlockRemoved, PolicyNewParamsAlertTypeBlockNotificationNewBlock, PolicyNewParamsAlertTypeBlockNotificationReviewRejected, PolicyNewParamsAlertTypeBotTrafficBasicAlert, PolicyNewParamsAlertTypeBrandProtectionAlert, PolicyNewParamsAlertTypeBrandProtectionDigest, PolicyNewParamsAlertTypeClickhouseAlertFwAnomaly, PolicyNewParamsAlertTypeClickhouseAlertFwEntAnomaly, PolicyNewParamsAlertTypeCloudforceOneRequestNotification, PolicyNewParamsAlertTypeCNIMaintenanceNotification, PolicyNewParamsAlertTypeCustomAnalytics, PolicyNewParamsAlertTypeCustomBotDetectionAlert, PolicyNewParamsAlertTypeCustomSSLCertificateEventType, PolicyNewParamsAlertTypeDedicatedSSLCertificateEventType, PolicyNewParamsAlertTypeDeviceConnectivityAnomalyAlert, PolicyNewParamsAlertTypeDosAttackL4, PolicyNewParamsAlertTypeDosAttackL7, PolicyNewParamsAlertTypeExpiringServiceTokenAlert, PolicyNewParamsAlertTypeFailingLogpushJobDisabledAlert, PolicyNewParamsAlertTypeFbmAutoAdvertisement, PolicyNewParamsAlertTypeFbmDosdAttack, PolicyNewParamsAlertTypeFbmVolumetricAttack, PolicyNewParamsAlertTypeHealthCheckStatusNotification, PolicyNewParamsAlertTypeHostnameAopCustomCertificateExpirationType, PolicyNewParamsAlertTypeHTTPAlertEdgeError, PolicyNewParamsAlertTypeHTTPAlertOriginError, PolicyNewParamsAlertTypeImageNotification, PolicyNewParamsAlertTypeImageResizingNotification, PolicyNewParamsAlertTypeIncidentAlert, PolicyNewParamsAlertTypeLoadBalancingHealthAlert, PolicyNewParamsAlertTypeLoadBalancingPoolEnablementAlert, PolicyNewParamsAlertTypeLogoMatchAlert, PolicyNewParamsAlertTypeMagicTunnelHealthCheckEvent, PolicyNewParamsAlertTypeMagicWANTunnelHealth, PolicyNewParamsAlertTypeMaintenanceEventNotification, PolicyNewParamsAlertTypeMTLSCertificateStoreCertificateExpirationType, PolicyNewParamsAlertTypePagesEventAlert, PolicyNewParamsAlertTypeRadarNotification, PolicyNewParamsAlertTypeRealOriginMonitoring, PolicyNewParamsAlertTypeScriptmonitorAlertNewCodeChangeDetections, PolicyNewParamsAlertTypeScriptmonitorAlertNewHosts, PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousHosts, PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousScripts, PolicyNewParamsAlertTypeScriptmonitorAlertNewMaliciousURL, PolicyNewParamsAlertTypeScriptmonitorAlertNewMaxLengthResourceURL, PolicyNewParamsAlertTypeScriptmonitorAlertNewResources, PolicyNewParamsAlertTypeSecondaryDNSAllPrimariesFailing, PolicyNewParamsAlertTypeSecondaryDNSPrimariesFailing, PolicyNewParamsAlertTypeSecondaryDNSWarning, PolicyNewParamsAlertTypeSecondaryDNSZoneSuccessfullyUpdated, PolicyNewParamsAlertTypeSecondaryDNSZoneValidationWarning, PolicyNewParamsAlertTypeSecurityInsightsAlert, PolicyNewParamsAlertTypeSentinelAlert, PolicyNewParamsAlertTypeStreamLiveNotifications, PolicyNewParamsAlertTypeSyntheticTestLatencyAlert, PolicyNewParamsAlertTypeSyntheticTestLowAvailabilityAlert, PolicyNewParamsAlertTypeTrafficAnomaliesAlert, PolicyNewParamsAlertTypeTunnelHealthEvent, PolicyNewParamsAlertTypeTunnelUpdateEvent, PolicyNewParamsAlertTypeUniversalSSLEventType, PolicyNewParamsAlertTypeWebAnalyticsMetricsUpdate, PolicyNewParamsAlertTypeZoneAopCustomCertificateExpirationType:
return true
}
return false
}
type PolicyNewResponseEnvelope struct {
Errors []PolicyNewResponseEnvelopeErrors `json:"errors" api:"required"`
Messages []PolicyNewResponseEnvelopeMessages `json:"messages" api:"required"`
// Whether the API call was successful
Success PolicyNewResponseEnvelopeSuccess `json:"success" api:"required"`
Result PolicyNewResponse `json:"result"`
JSON policyNewResponseEnvelopeJSON `json:"-"`
}
// policyNewResponseEnvelopeJSON contains the JSON metadata for the struct
// [PolicyNewResponseEnvelope]
type policyNewResponseEnvelopeJSON struct {
Errors apijson.Field
Messages apijson.Field
Success apijson.Field
Result apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *PolicyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r policyNewResponseEnvelopeJSON) RawJSON() string {
return r.raw
}
type PolicyNewResponseEnvelopeErrors struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`

