cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
7609e84ab3db53e79aefce6a112e90cb2a2bbba0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/addressing/services.ts

41lines · modecode

1// File generated from our OpenAPI spec by Stainless.
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(accountId: string, options?: Core.RequestOptions): Core.APIPromise<ServiceListResponse> {
15 return (
16 this._client.get(`/accounts/${accountId}/addressing/services`, options) as Core.APIPromise<{
17 result: ServiceListResponse;
18 }>
19 )._thenUnwrap((obj) => obj.result);
20 }
21}
22
23export type ServiceListResponse = Array<ServiceListResponse.ServiceListResponseItem>;
24
25export namespace ServiceListResponse {
26 export interface ServiceListResponseItem {
27 /**
28 * Identifier
29 */
30 id?: string;
31
32 /**
33 * Name of a service running on the Cloudflare network
34 */
35 name?: string;
36 }
37}
38
39export namespace Services {
40 export import ServiceListResponse = ServicesAPI.ServiceListResponse;
41}
42