cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.2.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/addressing/services.ts

57lines · 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 list(
15 params: ServiceListParams,
16 options?: Core.RequestOptions,
17 ): Core.PagePromise<ServiceListResponsesSinglePage, ServiceListResponse> {
18 const { account_id } = params;
19 return this._client.getAPIList(
20 `/accounts/${account_id}/addressing/services`,
21 ServiceListResponsesSinglePage,
22 options,
23 );
24 }
25}
26
27export class ServiceListResponsesSinglePage extends SinglePage<ServiceListResponse> {}
28
29export interface ServiceListResponse {
30 /**
31 * Identifier of a Service on the Cloudflare network. Available services and their
32 * IDs may be found in the **List Services** endpoint.
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 of a Cloudflare account.
45 */
46 account_id: string;
47}
48
49Services.ServiceListResponsesSinglePage = ServiceListResponsesSinglePage;
50
51export declare namespace Services {
52 export {
53 type ServiceListResponse as ServiceListResponse,
54 ServiceListResponsesSinglePage as ServiceListResponsesSinglePage,
55 type ServiceListParams as ServiceListParams,
56 };
57}
58