cloudflare/cloudflare-typescript

Public

mirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v3.0.0-beta.13

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/alerting/available-alerts.ts

36lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import * as Core from 'cloudflare/core';
4import { APIResource } from 'cloudflare/resource';
5import * as AvailableAlertsAPI from 'cloudflare/resources/alerting/available-alerts';
6
7export 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
24export type AvailableAlertListResponse = unknown | Array<unknown> | string;
25
26export interface AvailableAlertListParams {
27 /**
28 * The account id
29 */
30 account_id: string;
31}
32
33export namespace AvailableAlerts {
34 export import AvailableAlertListResponse = AvailableAlertsAPI.AvailableAlertListResponse;
35 export import AvailableAlertListParams = AvailableAlertsAPI.AvailableAlertListParams;
36}
37