cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/alerting/available-alerts.ts
36lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | |
| 3 | import * as Core from 'cloudflare/core'; |
| 4 | import { APIResource } from 'cloudflare/resource'; |
| 5 | import * as AvailableAlertsAPI from 'cloudflare/resources/alerting/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 | null> { |
| 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 | null; |
| 19 | }> |
| 20 | )._thenUnwrap((obj) => obj.result); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | export type AvailableAlertListResponse = unknown | Array<unknown> | string; |
| 25 | |
| 26 | export interface AvailableAlertListParams { |
| 27 | /** |
| 28 | * The account id |
| 29 | */ |
| 30 | account_id: string; |
| 31 | } |
| 32 | |
| 33 | export namespace AvailableAlerts { |
| 34 | export import AvailableAlertListResponse = AvailableAlertsAPI.AvailableAlertListResponse; |
| 35 | export import AvailableAlertListParams = AvailableAlertsAPI.AvailableAlertListParams; |
| 36 | } |
| 37 | |