cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v5.2.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/addressing/services.ts

67lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import * as Core from '../../core';
5import { SinglePage } from '../../pagination';
6
7export class Services extends APIResource {
8 /**
9 * Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a
10 * service running on the Cloudflare network to enable a Cloudflare product on the
11 * IP addresses. This endpoint can be used as a reference of available services on
12 * the Cloudflare network, and their service IDs.
13 *
14 * @example
15 * ```ts
16 * // Automatically fetches more pages as needed.
17 * for await (const serviceListResponse of client.addressing.services.list(
18 * { account_id: '258def64c72dae45f3e4c8516e2111f2' },
19 * )) {
20 * // ...
21 * }
22 * ```
23 */
24 list(
25 params: ServiceListParams,
26 options?: Core.RequestOptions,
27 ): Core.PagePromise<ServiceListResponsesSinglePage, ServiceListResponse> {
28 const { account_id } = params;
29 return this._client.getAPIList(
30 `/accounts/${account_id}/addressing/services`,
31 ServiceListResponsesSinglePage,
32 options,
33 );
34 }
35}
36
37export class ServiceListResponsesSinglePage extends SinglePage<ServiceListResponse> {}
38
39export interface ServiceListResponse {
40 /**
41 * Identifier of a Service on the Cloudflare network. Available services and their
42 * IDs may be found in the **List Services** endpoint.
43 */
44 id?: string;
45
46 /**
47 * Name of a service running on the Cloudflare network
48 */
49 name?: string;
50}
51
52export interface ServiceListParams {
53 /**
54 * Identifier of a Cloudflare account.
55 */
56 account_id: string;
57}
58
59Services.ServiceListResponsesSinglePage = ServiceListResponsesSinglePage;
60
61export declare namespace Services {
62 export {
63 type ServiceListResponse as ServiceListResponse,
64 ServiceListResponsesSinglePage as ServiceListResponsesSinglePage,
65 type ServiceListParams as ServiceListParams,
66 };
67}
68