cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/alerting/available-alerts.ts
64lines · 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 AvailableAlertsAPI from './available-alerts'; |
| 6 | |
| 7 | export class AvailableAlerts extends APIResource { |
| 8 | /** |
| 9 | * Gets a list of all alert types for which an account is eligible. |
| 10 | */ |
| 11 | list( |
| 12 | params: AvailableAlertListParams, |
| 13 | options?: Core.RequestOptions, |
| 14 | ): Core.APIPromise<AvailableAlertListResponse> { |
| 15 | const { account_id } = params; |
| 16 | return ( |
| 17 | this._client.get(`/accounts/${account_id}/alerting/v3/available_alerts`, options) as Core.APIPromise<{ |
| 18 | result: AvailableAlertListResponse; |
| 19 | }> |
| 20 | )._thenUnwrap((obj) => obj.result); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | export type AvailableAlertListResponse = Record< |
| 25 | string, |
| 26 | Array<AvailableAlertListResponse.UnnamedSchemaWithMapParent1> |
| 27 | >; |
| 28 | |
| 29 | export namespace AvailableAlertListResponse { |
| 30 | export interface UnnamedSchemaWithMapParent1 { |
| 31 | /** |
| 32 | * Describes the alert type. |
| 33 | */ |
| 34 | description?: string; |
| 35 | |
| 36 | /** |
| 37 | * Alert type name. |
| 38 | */ |
| 39 | display_name?: string; |
| 40 | |
| 41 | /** |
| 42 | * Format of additional configuration options (filters) for the alert type. Data |
| 43 | * type of filters during policy creation: Array of strings. |
| 44 | */ |
| 45 | filter_options?: Array<unknown>; |
| 46 | |
| 47 | /** |
| 48 | * Use this value when creating and updating a notification policy. |
| 49 | */ |
| 50 | type?: string; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | export interface AvailableAlertListParams { |
| 55 | /** |
| 56 | * The account id |
| 57 | */ |
| 58 | account_id: string; |
| 59 | } |
| 60 | |
| 61 | export namespace AvailableAlerts { |
| 62 | export import AvailableAlertListResponse = AvailableAlertsAPI.AvailableAlertListResponse; |
| 63 | export import AvailableAlertListParams = AvailableAlertsAPI.AvailableAlertListParams; |
| 64 | } |
| 65 | |