cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
generated-70ac2e4e1c

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/addressing/services.ts

50lines · 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 ServicesAPI from 'cloudflare/resources/addressing/services';
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(params: ServiceListParams, options?: Core.RequestOptions): Core.APIPromise<ServiceListResponse> {
15 const { account_id } = params;
16 return (
17 this._client.get(`/accounts/${account_id}/addressing/services`, options) as Core.APIPromise<{
18 result: ServiceListResponse;
19 }>
20 )._thenUnwrap((obj) => obj.result);
21 }
22}
23
24export type ServiceListResponse = Array<ServiceListResponse.ServiceListResponseItem>;
25
26export namespace ServiceListResponse {
27 export interface ServiceListResponseItem {
28 /**
29 * Identifier
30 */
31 id?: string;
32
33 /**
34 * Name of a service running on the Cloudflare network
35 */
36 name?: string;
37 }
38}
39
40export interface ServiceListParams {
41 /**
42 * Identifier
43 */
44 account_id: string;
45}
46
47export namespace Services {
48 export import ServiceListResponse = ServicesAPI.ServiceListResponse;
49 export import ServiceListParams = ServicesAPI.ServiceListParams;
50}
51