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