cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v6.5.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/resources/alerting/policies.ts

1100lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import * as Core from '../../core';
5import { SinglePage } from '../../pagination';
6
7export class Policies extends APIResource {
8 /**
9 * Creates a new Notification policy.
10 *
11 * @example
12 * ```ts
13 * const policy = await client.alerting.policies.create({
14 * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
15 * alert_type: 'universal_ssl_event_type',
16 * enabled: true,
17 * mechanisms: {},
18 * name: 'SSL Notification Event Policy',
19 * });
20 * ```
21 */
22 create(params: PolicyCreateParams, options?: Core.RequestOptions): Core.APIPromise<PolicyCreateResponse> {
23 const { account_id, ...body } = params;
24 return (
25 this._client.post(`/accounts/${account_id}/alerting/v3/policies`, {
26 body,
27 ...options,
28 }) as Core.APIPromise<{ result: PolicyCreateResponse }>
29 )._thenUnwrap((obj) => obj.result);
30 }
31
32 /**
33 * Update a Notification policy.
34 *
35 * @example
36 * ```ts
37 * const policy = await client.alerting.policies.update(
38 * '0da2b59ef118439d8097bdfb215203c9',
39 * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
40 * );
41 * ```
42 */
43 update(
44 policyId: string,
45 params: PolicyUpdateParams,
46 options?: Core.RequestOptions,
47 ): Core.APIPromise<PolicyUpdateResponse> {
48 const { account_id, ...body } = params;
49 return (
50 this._client.put(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, {
51 body,
52 ...options,
53 }) as Core.APIPromise<{ result: PolicyUpdateResponse }>
54 )._thenUnwrap((obj) => obj.result);
55 }
56
57 /**
58 * Get a list of all Notification policies.
59 *
60 * @example
61 * ```ts
62 * // Automatically fetches more pages as needed.
63 * for await (const policy of client.alerting.policies.list({
64 * account_id: '023e105f4ecef8ad9ca31a8372d0c353',
65 * })) {
66 * // ...
67 * }
68 * ```
69 */
70 list(
71 params: PolicyListParams,
72 options?: Core.RequestOptions,
73 ): Core.PagePromise<PoliciesSinglePage, Policy> {
74 const { account_id } = params;
75 return this._client.getAPIList(
76 `/accounts/${account_id}/alerting/v3/policies`,
77 PoliciesSinglePage,
78 options,
79 );
80 }
81
82 /**
83 * Delete a Notification policy.
84 *
85 * @example
86 * ```ts
87 * const policy = await client.alerting.policies.delete(
88 * '0da2b59ef118439d8097bdfb215203c9',
89 * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
90 * );
91 * ```
92 */
93 delete(
94 policyId: string,
95 params: PolicyDeleteParams,
96 options?: Core.RequestOptions,
97 ): Core.APIPromise<PolicyDeleteResponse> {
98 const { account_id } = params;
99 return this._client.delete(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, options);
100 }
101
102 /**
103 * Get details for a single policy.
104 *
105 * @example
106 * ```ts
107 * const policy = await client.alerting.policies.get(
108 * '0da2b59ef118439d8097bdfb215203c9',
109 * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
110 * );
111 * ```
112 */
113 get(policyId: string, params: PolicyGetParams, options?: Core.RequestOptions): Core.APIPromise<Policy> {
114 const { account_id } = params;
115 return (
116 this._client.get(
117 `/accounts/${account_id}/alerting/v3/policies/${policyId}`,
118 options,
119 ) as Core.APIPromise<{ result: Policy }>
120 )._thenUnwrap((obj) => obj.result);
121 }
122}
123
124export class PoliciesSinglePage extends SinglePage<Policy> {}
125
126/**
127 * List of IDs that will be used when dispatching a notification. IDs for email
128 * type will be the email address.
129 */
130export interface Mechanism {
131 email?: Array<Mechanism.Email>;
132
133 pagerduty?: Array<Mechanism.Pagerduty>;
134
135 webhooks?: Array<Mechanism.Webhook>;
136}
137
138export namespace Mechanism {
139 export interface Email {
140 /**
141 * The email address
142 */
143 id?: string;
144 }
145
146 export interface Pagerduty {
147 /**
148 * UUID
149 */
150 id?: string;
151 }
152
153 export interface Webhook {
154 /**
155 * UUID
156 */
157 id?: string;
158 }
159}
160
161/**
162 * List of IDs that will be used when dispatching a notification. IDs for email
163 * type will be the email address.
164 */
165export interface MechanismParam {
166 email?: Array<MechanismParam.Email>;
167
168 pagerduty?: Array<MechanismParam.Pagerduty>;
169
170 webhooks?: Array<MechanismParam.Webhook>;
171}
172
173export namespace MechanismParam {
174 export interface Email {
175 /**
176 * The email address
177 */
178 id?: string;
179 }
180
181 export interface Pagerduty {
182 /**
183 * UUID
184 */
185 id?: string;
186 }
187
188 export interface Webhook {
189 /**
190 * UUID
191 */
192 id?: string;
193 }
194}
195
196export interface Policy {
197 /**
198 * The unique identifier of a notification policy
199 */
200 id?: string;
201
202 /**
203 * Optional specification of how often to re-alert from the same incident, not
204 * support on all alert types.
205 */
206 alert_interval?: string;
207
208 /**
209 * Refers to which event will trigger a Notification dispatch. You can use the
210 * endpoint to get available alert types which then will give you a list of
211 * possible values.
212 */
213 alert_type?:
214 | 'abuse_report_alert'
215 | 'access_custom_certificate_expiration_type'
216 | 'advanced_ddos_attack_l4_alert'
217 | 'advanced_ddos_attack_l7_alert'
218 | 'advanced_http_alert_error'
219 | 'bgp_hijack_notification'
220 | 'billing_usage_alert'
221 | 'block_notification_block_removed'
222 | 'block_notification_new_block'
223 | 'block_notification_review_rejected'
224 | 'bot_traffic_basic_alert'
225 | 'brand_protection_alert'
226 | 'brand_protection_digest'
227 | 'clickhouse_alert_fw_anomaly'
228 | 'clickhouse_alert_fw_ent_anomaly'
229 | 'cloudforce_one_request_notification'
230 | 'cni_maintenance_notification'
231 | 'custom_analytics'
232 | 'custom_bot_detection_alert'
233 | 'custom_ssl_certificate_event_type'
234 | 'dedicated_ssl_certificate_event_type'
235 | 'device_connectivity_anomaly_alert'
236 | 'dos_attack_l4'
237 | 'dos_attack_l7'
238 | 'expiring_service_token_alert'
239 | 'failing_logpush_job_disabled_alert'
240 | 'fbm_auto_advertisement'
241 | 'fbm_dosd_attack'
242 | 'fbm_volumetric_attack'
243 | 'health_check_status_notification'
244 | 'hostname_aop_custom_certificate_expiration_type'
245 | 'http_alert_edge_error'
246 | 'http_alert_origin_error'
247 | 'image_notification'
248 | 'image_resizing_notification'
249 | 'incident_alert'
250 | 'load_balancing_health_alert'
251 | 'load_balancing_pool_enablement_alert'
252 | 'logo_match_alert'
253 | 'magic_tunnel_health_check_event'
254 | 'magic_wan_tunnel_health'
255 | 'maintenance_event_notification'
256 | 'mtls_certificate_store_certificate_expiration_type'
257 | 'pages_event_alert'
258 | 'radar_notification'
259 | 'real_origin_monitoring'
260 | 'scriptmonitor_alert_new_code_change_detections'
261 | 'scriptmonitor_alert_new_hosts'
262 | 'scriptmonitor_alert_new_malicious_hosts'
263 | 'scriptmonitor_alert_new_malicious_scripts'
264 | 'scriptmonitor_alert_new_malicious_url'
265 | 'scriptmonitor_alert_new_max_length_resource_url'
266 | 'scriptmonitor_alert_new_resources'
267 | 'secondary_dns_all_primaries_failing'
268 | 'secondary_dns_primaries_failing'
269 | 'secondary_dns_warning'
270 | 'secondary_dns_zone_successfully_updated'
271 | 'secondary_dns_zone_validation_warning'
272 | 'security_insights_alert'
273 | 'sentinel_alert'
274 | 'stream_live_notifications'
275 | 'synthetic_test_latency_alert'
276 | 'synthetic_test_low_availability_alert'
277 | 'traffic_anomalies_alert'
278 | 'tunnel_health_event'
279 | 'tunnel_update_event'
280 | 'universal_ssl_event_type'
281 | 'web_analytics_metrics_update'
282 | 'zone_aop_custom_certificate_expiration_type';
283
284 created?: string;
285
286 /**
287 * Optional description for the Notification policy.
288 */
289 description?: string;
290
291 /**
292 * Whether or not the Notification policy is enabled.
293 */
294 enabled?: boolean;
295
296 /**
297 * Optional filters that allow you to be alerted only on a subset of events for
298 * that alert type based on some criteria. This is only available for select alert
299 * types. See alert type documentation for more details.
300 */
301 filters?: PolicyFilter;
302
303 /**
304 * List of IDs that will be used when dispatching a notification. IDs for email
305 * type will be the email address.
306 */
307 mechanisms?: Mechanism;
308
309 modified?: string;
310
311 /**
312 * Name of the policy.
313 */
314 name?: string;
315}
316
317/**
318 * Optional filters that allow you to be alerted only on a subset of events for
319 * that alert type based on some criteria. This is only available for select alert
320 * types. See alert type documentation for more details.
321 */
322export interface PolicyFilter {
323 /**
324 * Usage depends on specific alert type
325 */
326 actions?: Array<string>;
327
328 /**
329 * Used for configuring radar_notification
330 */
331 affected_asns?: Array<string>;
332
333 /**
334 * Used for configuring incident_alert
335 */
336 affected_components?: Array<string>;
337
338 /**
339 * Used for configuring radar_notification
340 */
341 affected_locations?: Array<string>;
342
343 /**
344 * Used for configuring maintenance_event_notification
345 */
346 airport_code?: Array<string>;
347
348 /**
349 * Usage depends on specific alert type
350 */
351 alert_trigger_preferences?: Array<string>;
352
353 /**
354 * Usage depends on specific alert type
355 */
356 alert_trigger_preferences_value?: Array<string>;
357
358 /**
359 * Used for configuring load_balancing_pool_enablement_alert
360 */
361 enabled?: Array<string>;
362
363 /**
364 * Used for configuring pages_event_alert
365 */
366 environment?: Array<string>;
367
368 /**
369 * Used for configuring pages_event_alert
370 */
371 event?: Array<string>;
372
373 /**
374 * Used for configuring load_balancing_health_alert
375 */
376 event_source?: Array<string>;
377
378 /**
379 * Usage depends on specific alert type
380 */
381 event_type?: Array<string>;
382
383 /**
384 * Usage depends on specific alert type
385 */
386 group_by?: Array<string>;
387
388 /**
389 * Used for configuring health_check_status_notification
390 */
391 health_check_id?: Array<string>;
392
393 /**
394 * Used for configuring incident_alert
395 */
396 incident_impact?: Array<
397 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL'
398 >;
399
400 /**
401 * Used for configuring stream_live_notifications
402 */
403 input_id?: Array<string>;
404
405 /**
406 * Used for configuring security_insights_alert
407 */
408 insight_class?: Array<string>;
409
410 /**
411 * Used for configuring billing_usage_alert
412 */
413 limit?: Array<string>;
414
415 /**
416 * Used for configuring logo_match_alert
417 */
418 logo_tag?: Array<string>;
419
420 /**
421 * Used for configuring advanced_ddos_attack_l4_alert
422 */
423 megabits_per_second?: Array<string>;
424
425 /**
426 * Used for configuring load_balancing_health_alert
427 */
428 new_health?: Array<string>;
429
430 /**
431 * Used for configuring tunnel_health_event
432 */
433 new_status?: Array<string>;
434
435 /**
436 * Used for configuring advanced_ddos_attack_l4_alert
437 */
438 packets_per_second?: Array<string>;
439
440 /**
441 * Usage depends on specific alert type
442 */
443 pool_id?: Array<string>;
444
445 /**
446 * Usage depends on specific alert type
447 */
448 pop_names?: Array<string>;
449
450 /**
451 * Used for configuring billing_usage_alert
452 */
453 product?: Array<string>;
454
455 /**
456 * Used for configuring pages_event_alert
457 */
458 project_id?: Array<string>;
459
460 /**
461 * Used for configuring advanced_ddos_attack_l4_alert
462 */
463 protocol?: Array<string>;
464
465 /**
466 * Usage depends on specific alert type
467 */
468 query_tag?: Array<string>;
469
470 /**
471 * Used for configuring advanced_ddos_attack_l7_alert
472 */
473 requests_per_second?: Array<string>;
474
475 /**
476 * Usage depends on specific alert type
477 */
478 selectors?: Array<string>;
479
480 /**
481 * Used for configuring clickhouse_alert_fw_ent_anomaly
482 */
483 services?: Array<string>;
484
485 /**
486 * Usage depends on specific alert type
487 */
488 slo?: Array<string>;
489
490 /**
491 * Used for configuring health_check_status_notification
492 */
493 status?: Array<string>;
494
495 /**
496 * Used for configuring advanced_ddos_attack_l7_alert
497 */
498 target_hostname?: Array<string>;
499
500 /**
501 * Used for configuring advanced_ddos_attack_l4_alert
502 */
503 target_ip?: Array<string>;
504
505 /**
506 * Used for configuring advanced_ddos_attack_l7_alert
507 */
508 target_zone_name?: Array<string>;
509
510 /**
511 * Used for configuring traffic_anomalies_alert
512 */
513 traffic_exclusions?: Array<'security_events'>;
514
515 /**
516 * Used for configuring tunnel_health_event
517 */
518 tunnel_id?: Array<string>;
519
520 /**
521 * Usage depends on specific alert type
522 */
523 tunnel_name?: Array<string>;
524
525 /**
526 * Usage depends on specific alert type
527 */
528 type?: Array<string>;
529
530 /**
531 * Usage depends on specific alert type
532 */
533 where?: Array<string>;
534
535 /**
536 * Usage depends on specific alert type
537 */
538 zones?: Array<string>;
539}
540
541/**
542 * Optional filters that allow you to be alerted only on a subset of events for
543 * that alert type based on some criteria. This is only available for select alert
544 * types. See alert type documentation for more details.
545 */
546export interface PolicyFilterParam {
547 /**
548 * Usage depends on specific alert type
549 */
550 actions?: Array<string>;
551
552 /**
553 * Used for configuring radar_notification
554 */
555 affected_asns?: Array<string>;
556
557 /**
558 * Used for configuring incident_alert
559 */
560 affected_components?: Array<string>;
561
562 /**
563 * Used for configuring radar_notification
564 */
565 affected_locations?: Array<string>;
566
567 /**
568 * Used for configuring maintenance_event_notification
569 */
570 airport_code?: Array<string>;
571
572 /**
573 * Usage depends on specific alert type
574 */
575 alert_trigger_preferences?: Array<string>;
576
577 /**
578 * Usage depends on specific alert type
579 */
580 alert_trigger_preferences_value?: Array<string>;
581
582 /**
583 * Used for configuring load_balancing_pool_enablement_alert
584 */
585 enabled?: Array<string>;
586
587 /**
588 * Used for configuring pages_event_alert
589 */
590 environment?: Array<string>;
591
592 /**
593 * Used for configuring pages_event_alert
594 */
595 event?: Array<string>;
596
597 /**
598 * Used for configuring load_balancing_health_alert
599 */
600 event_source?: Array<string>;
601
602 /**
603 * Usage depends on specific alert type
604 */
605 event_type?: Array<string>;
606
607 /**
608 * Usage depends on specific alert type
609 */
610 group_by?: Array<string>;
611
612 /**
613 * Used for configuring health_check_status_notification
614 */
615 health_check_id?: Array<string>;
616
617 /**
618 * Used for configuring incident_alert
619 */
620 incident_impact?: Array<
621 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL'
622 >;
623
624 /**
625 * Used for configuring stream_live_notifications
626 */
627 input_id?: Array<string>;
628
629 /**
630 * Used for configuring security_insights_alert
631 */
632 insight_class?: Array<string>;
633
634 /**
635 * Used for configuring billing_usage_alert
636 */
637 limit?: Array<string>;
638
639 /**
640 * Used for configuring logo_match_alert
641 */
642 logo_tag?: Array<string>;
643
644 /**
645 * Used for configuring advanced_ddos_attack_l4_alert
646 */
647 megabits_per_second?: Array<string>;
648
649 /**
650 * Used for configuring load_balancing_health_alert
651 */
652 new_health?: Array<string>;
653
654 /**
655 * Used for configuring tunnel_health_event
656 */
657 new_status?: Array<string>;
658
659 /**
660 * Used for configuring advanced_ddos_attack_l4_alert
661 */
662 packets_per_second?: Array<string>;
663
664 /**
665 * Usage depends on specific alert type
666 */
667 pool_id?: Array<string>;
668
669 /**
670 * Usage depends on specific alert type
671 */
672 pop_names?: Array<string>;
673
674 /**
675 * Used for configuring billing_usage_alert
676 */
677 product?: Array<string>;
678
679 /**
680 * Used for configuring pages_event_alert
681 */
682 project_id?: Array<string>;
683
684 /**
685 * Used for configuring advanced_ddos_attack_l4_alert
686 */
687 protocol?: Array<string>;
688
689 /**
690 * Usage depends on specific alert type
691 */
692 query_tag?: Array<string>;
693
694 /**
695 * Used for configuring advanced_ddos_attack_l7_alert
696 */
697 requests_per_second?: Array<string>;
698
699 /**
700 * Usage depends on specific alert type
701 */
702 selectors?: Array<string>;
703
704 /**
705 * Used for configuring clickhouse_alert_fw_ent_anomaly
706 */
707 services?: Array<string>;
708
709 /**
710 * Usage depends on specific alert type
711 */
712 slo?: Array<string>;
713
714 /**
715 * Used for configuring health_check_status_notification
716 */
717 status?: Array<string>;
718
719 /**
720 * Used for configuring advanced_ddos_attack_l7_alert
721 */
722 target_hostname?: Array<string>;
723
724 /**
725 * Used for configuring advanced_ddos_attack_l4_alert
726 */
727 target_ip?: Array<string>;
728
729 /**
730 * Used for configuring advanced_ddos_attack_l7_alert
731 */
732 target_zone_name?: Array<string>;
733
734 /**
735 * Used for configuring traffic_anomalies_alert
736 */
737 traffic_exclusions?: Array<'security_events'>;
738
739 /**
740 * Used for configuring tunnel_health_event
741 */
742 tunnel_id?: Array<string>;
743
744 /**
745 * Usage depends on specific alert type
746 */
747 tunnel_name?: Array<string>;
748
749 /**
750 * Usage depends on specific alert type
751 */
752 type?: Array<string>;
753
754 /**
755 * Usage depends on specific alert type
756 */
757 where?: Array<string>;
758
759 /**
760 * Usage depends on specific alert type
761 */
762 zones?: Array<string>;
763}
764
765export interface PolicyCreateResponse {
766 /**
767 * UUID
768 */
769 id?: string;
770}
771
772export interface PolicyUpdateResponse {
773 /**
774 * UUID
775 */
776 id?: string;
777}
778
779export interface PolicyDeleteResponse {
780 errors: Array<PolicyDeleteResponse.Error>;
781
782 messages: Array<PolicyDeleteResponse.Message>;
783
784 /**
785 * Whether the API call was successful
786 */
787 success: true;
788
789 result_info?: PolicyDeleteResponse.ResultInfo;
790}
791
792export namespace PolicyDeleteResponse {
793 export interface Error {
794 message: string;
795
796 code?: number;
797 }
798
799 export interface Message {
800 message: string;
801
802 code?: number;
803 }
804
805 export interface ResultInfo {
806 /**
807 * Total number of results for the requested service
808 */
809 count?: number;
810
811 /**
812 * Current page within paginated list of results
813 */
814 page?: number;
815
816 /**
817 * Number of results per page of results
818 */
819 per_page?: number;
820
821 /**
822 * Total results available without any search parameters
823 */
824 total_count?: number;
825 }
826}
827
828export interface PolicyCreateParams {
829 /**
830 * Path param: The account id
831 */
832 account_id: string;
833
834 /**
835 * Body param: Refers to which event will trigger a Notification dispatch. You can
836 * use the endpoint to get available alert types which then will give you a list of
837 * possible values.
838 */
839 alert_type:
840 | 'abuse_report_alert'
841 | 'access_custom_certificate_expiration_type'
842 | 'advanced_ddos_attack_l4_alert'
843 | 'advanced_ddos_attack_l7_alert'
844 | 'advanced_http_alert_error'
845 | 'bgp_hijack_notification'
846 | 'billing_usage_alert'
847 | 'block_notification_block_removed'
848 | 'block_notification_new_block'
849 | 'block_notification_review_rejected'
850 | 'bot_traffic_basic_alert'
851 | 'brand_protection_alert'
852 | 'brand_protection_digest'
853 | 'clickhouse_alert_fw_anomaly'
854 | 'clickhouse_alert_fw_ent_anomaly'
855 | 'cloudforce_one_request_notification'
856 | 'cni_maintenance_notification'
857 | 'custom_analytics'
858 | 'custom_bot_detection_alert'
859 | 'custom_ssl_certificate_event_type'
860 | 'dedicated_ssl_certificate_event_type'
861 | 'device_connectivity_anomaly_alert'
862 | 'dos_attack_l4'
863 | 'dos_attack_l7'
864 | 'expiring_service_token_alert'
865 | 'failing_logpush_job_disabled_alert'
866 | 'fbm_auto_advertisement'
867 | 'fbm_dosd_attack'
868 | 'fbm_volumetric_attack'
869 | 'health_check_status_notification'
870 | 'hostname_aop_custom_certificate_expiration_type'
871 | 'http_alert_edge_error'
872 | 'http_alert_origin_error'
873 | 'image_notification'
874 | 'image_resizing_notification'
875 | 'incident_alert'
876 | 'load_balancing_health_alert'
877 | 'load_balancing_pool_enablement_alert'
878 | 'logo_match_alert'
879 | 'magic_tunnel_health_check_event'
880 | 'magic_wan_tunnel_health'
881 | 'maintenance_event_notification'
882 | 'mtls_certificate_store_certificate_expiration_type'
883 | 'pages_event_alert'
884 | 'radar_notification'
885 | 'real_origin_monitoring'
886 | 'scriptmonitor_alert_new_code_change_detections'
887 | 'scriptmonitor_alert_new_hosts'
888 | 'scriptmonitor_alert_new_malicious_hosts'
889 | 'scriptmonitor_alert_new_malicious_scripts'
890 | 'scriptmonitor_alert_new_malicious_url'
891 | 'scriptmonitor_alert_new_max_length_resource_url'
892 | 'scriptmonitor_alert_new_resources'
893 | 'secondary_dns_all_primaries_failing'
894 | 'secondary_dns_primaries_failing'
895 | 'secondary_dns_warning'
896 | 'secondary_dns_zone_successfully_updated'
897 | 'secondary_dns_zone_validation_warning'
898 | 'security_insights_alert'
899 | 'sentinel_alert'
900 | 'stream_live_notifications'
901 | 'synthetic_test_latency_alert'
902 | 'synthetic_test_low_availability_alert'
903 | 'traffic_anomalies_alert'
904 | 'tunnel_health_event'
905 | 'tunnel_update_event'
906 | 'universal_ssl_event_type'
907 | 'web_analytics_metrics_update'
908 | 'zone_aop_custom_certificate_expiration_type';
909
910 /**
911 * Body param: Whether or not the Notification policy is enabled.
912 */
913 enabled: boolean;
914
915 /**
916 * Body param: List of IDs that will be used when dispatching a notification. IDs
917 * for email type will be the email address.
918 */
919 mechanisms: MechanismParam;
920
921 /**
922 * Body param: Name of the policy.
923 */
924 name: string;
925
926 /**
927 * Body param: Optional specification of how often to re-alert from the same
928 * incident, not support on all alert types.
929 */
930 alert_interval?: string;
931
932 /**
933 * Body param: Optional description for the Notification policy.
934 */
935 description?: string;
936
937 /**
938 * Body param: Optional filters that allow you to be alerted only on a subset of
939 * events for that alert type based on some criteria. This is only available for
940 * select alert types. See alert type documentation for more details.
941 */
942 filters?: PolicyFilterParam;
943}
944
945export interface PolicyUpdateParams {
946 /**
947 * Path param: The account id
948 */
949 account_id: string;
950
951 /**
952 * Body param: Optional specification of how often to re-alert from the same
953 * incident, not support on all alert types.
954 */
955 alert_interval?: string;
956
957 /**
958 * Body param: Refers to which event will trigger a Notification dispatch. You can
959 * use the endpoint to get available alert types which then will give you a list of
960 * possible values.
961 */
962 alert_type?:
963 | 'abuse_report_alert'
964 | 'access_custom_certificate_expiration_type'
965 | 'advanced_ddos_attack_l4_alert'
966 | 'advanced_ddos_attack_l7_alert'
967 | 'advanced_http_alert_error'
968 | 'bgp_hijack_notification'
969 | 'billing_usage_alert'
970 | 'block_notification_block_removed'
971 | 'block_notification_new_block'
972 | 'block_notification_review_rejected'
973 | 'bot_traffic_basic_alert'
974 | 'brand_protection_alert'
975 | 'brand_protection_digest'
976 | 'clickhouse_alert_fw_anomaly'
977 | 'clickhouse_alert_fw_ent_anomaly'
978 | 'cloudforce_one_request_notification'
979 | 'cni_maintenance_notification'
980 | 'custom_analytics'
981 | 'custom_bot_detection_alert'
982 | 'custom_ssl_certificate_event_type'
983 | 'dedicated_ssl_certificate_event_type'
984 | 'device_connectivity_anomaly_alert'
985 | 'dos_attack_l4'
986 | 'dos_attack_l7'
987 | 'expiring_service_token_alert'
988 | 'failing_logpush_job_disabled_alert'
989 | 'fbm_auto_advertisement'
990 | 'fbm_dosd_attack'
991 | 'fbm_volumetric_attack'
992 | 'health_check_status_notification'
993 | 'hostname_aop_custom_certificate_expiration_type'
994 | 'http_alert_edge_error'
995 | 'http_alert_origin_error'
996 | 'image_notification'
997 | 'image_resizing_notification'
998 | 'incident_alert'
999 | 'load_balancing_health_alert'
1000 | 'load_balancing_pool_enablement_alert'
1001 | 'logo_match_alert'
1002 | 'magic_tunnel_health_check_event'
1003 | 'magic_wan_tunnel_health'
1004 | 'maintenance_event_notification'
1005 | 'mtls_certificate_store_certificate_expiration_type'
1006 | 'pages_event_alert'
1007 | 'radar_notification'
1008 | 'real_origin_monitoring'
1009 | 'scriptmonitor_alert_new_code_change_detections'
1010 | 'scriptmonitor_alert_new_hosts'
1011 | 'scriptmonitor_alert_new_malicious_hosts'
1012 | 'scriptmonitor_alert_new_malicious_scripts'
1013 | 'scriptmonitor_alert_new_malicious_url'
1014 | 'scriptmonitor_alert_new_max_length_resource_url'
1015 | 'scriptmonitor_alert_new_resources'
1016 | 'secondary_dns_all_primaries_failing'
1017 | 'secondary_dns_primaries_failing'
1018 | 'secondary_dns_warning'
1019 | 'secondary_dns_zone_successfully_updated'
1020 | 'secondary_dns_zone_validation_warning'
1021 | 'security_insights_alert'
1022 | 'sentinel_alert'
1023 | 'stream_live_notifications'
1024 | 'synthetic_test_latency_alert'
1025 | 'synthetic_test_low_availability_alert'
1026 | 'traffic_anomalies_alert'
1027 | 'tunnel_health_event'
1028 | 'tunnel_update_event'
1029 | 'universal_ssl_event_type'
1030 | 'web_analytics_metrics_update'
1031 | 'zone_aop_custom_certificate_expiration_type';
1032
1033 /**
1034 * Body param: Optional description for the Notification policy.
1035 */
1036 description?: string;
1037
1038 /**
1039 * Body param: Whether or not the Notification policy is enabled.
1040 */
1041 enabled?: boolean;
1042
1043 /**
1044 * Body param: Optional filters that allow you to be alerted only on a subset of
1045 * events for that alert type based on some criteria. This is only available for
1046 * select alert types. See alert type documentation for more details.
1047 */
1048 filters?: PolicyFilterParam;
1049
1050 /**
1051 * Body param: List of IDs that will be used when dispatching a notification. IDs
1052 * for email type will be the email address.
1053 */
1054 mechanisms?: MechanismParam;
1055
1056 /**
1057 * Body param: Name of the policy.
1058 */
1059 name?: string;
1060}
1061
1062export interface PolicyListParams {
1063 /**
1064 * The account id
1065 */
1066 account_id: string;
1067}
1068
1069export interface PolicyDeleteParams {
1070 /**
1071 * The account id
1072 */
1073 account_id: string;
1074}
1075
1076export interface PolicyGetParams {
1077 /**
1078 * The account id
1079 */
1080 account_id: string;
1081}
1082
1083Policies.PoliciesSinglePage = PoliciesSinglePage;
1084
1085export declare namespace Policies {
1086 export {
1087 type Mechanism as Mechanism,
1088 type Policy as Policy,
1089 type PolicyFilter as PolicyFilter,
1090 type PolicyCreateResponse as PolicyCreateResponse,
1091 type PolicyUpdateResponse as PolicyUpdateResponse,
1092 type PolicyDeleteResponse as PolicyDeleteResponse,
1093 PoliciesSinglePage as PoliciesSinglePage,
1094 type PolicyCreateParams as PolicyCreateParams,
1095 type PolicyUpdateParams as PolicyUpdateParams,
1096 type PolicyListParams as PolicyListParams,
1097 type PolicyDeleteParams as PolicyDeleteParams,
1098 type PolicyGetParams as PolicyGetParams,
1099 };
1100}
1101