cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v3.3.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/alerting/available-alerts.ts

64lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import * as Core from '../../core';
4import { APIResource } from '../../resource';
5import * as AvailableAlertsAPI from './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> {
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
24export type AvailableAlertListResponse = Record<
25 string,
26 Array<AvailableAlertListResponse.UnnamedSchemaWithMapParent1>
27>;
28
29export 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
54export interface AvailableAlertListParams {
55 /**
56 * The account id
57 */
58 account_id: string;
59}
60
61export namespace AvailableAlerts {
62 export import AvailableAlertListResponse = AvailableAlertsAPI.AvailableAlertListResponse;
63 export import AvailableAlertListParams = AvailableAlertsAPI.AvailableAlertListParams;
64}
65