cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v3.5.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/addressing/services.ts

53lines · 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 * as ServicesAPI from './services';
6import { SinglePage } from '../../pagination';
7
8export class Services extends APIResource {
9 /**
10 * Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a
11 * service running on the Cloudflare network to enable a Cloudflare product on the
12 * IP addresses. This endpoint can be used as a reference of available services on
13 * the Cloudflare network, and their service IDs.
14 */
15 list(
16 params: ServiceListParams,
17 options?: Core.RequestOptions,
18 ): Core.PagePromise<ServiceListResponsesSinglePage, ServiceListResponse> {
19 const { account_id } = params;
20 return this._client.getAPIList(
21 `/accounts/${account_id}/addressing/services`,
22 ServiceListResponsesSinglePage,
23 options,
24 );
25 }
26}
27
28export class ServiceListResponsesSinglePage extends SinglePage<ServiceListResponse> {}
29
30export interface ServiceListResponse {
31 /**
32 * Identifier
33 */
34 id?: string;
35
36 /**
37 * Name of a service running on the Cloudflare network
38 */
39 name?: string;
40}
41
42export interface ServiceListParams {
43 /**
44 * Identifier
45 */
46 account_id: string;
47}
48
49export namespace Services {
50 export import ServiceListResponse = ServicesAPI.ServiceListResponse;
51 export import ServiceListResponsesSinglePage = ServicesAPI.ServiceListResponsesSinglePage;
52 export import ServiceListParams = ServicesAPI.ServiceListParams;
53}