cloudflare/cloudflare-typescript
Publicmirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/addressing/services.ts
41lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. |
| 2 | |
| 3 | import * as Core from 'cloudflare/core'; |
| 4 | import { APIResource } from 'cloudflare/resource'; |
| 5 | import * as ServicesAPI from 'cloudflare/resources/addressing/services'; |
| 6 | |
| 7 | export 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 | |
| 23 | export type ServiceListResponse = Array<ServiceListResponse.ServiceListResponseItem>; |
| 24 | |
| 25 | export 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 | |
| 39 | export namespace Services { |
| 40 | export import ServiceListResponse = ServicesAPI.ServiceListResponse; |
| 41 | } |
| 42 | |