cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/addressing/services.ts
53lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | |
| 3 | import { APIResource } from '../../resource'; |
| 4 | import * as Core from '../../core'; |
| 5 | import * as ServicesAPI from './services'; |
| 6 | import { SinglePage } from '../../pagination'; |
| 7 | |
| 8 | export 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 | |
| 28 | export class ServiceListResponsesSinglePage extends SinglePage<ServiceListResponse> {} |
| 29 | |
| 30 | export 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 | |
| 42 | export interface ServiceListParams { |
| 43 | /** |
| 44 | * Identifier |
| 45 | */ |
| 46 | account_id: string; |
| 47 | } |
| 48 | |
| 49 | export namespace Services { |
| 50 | export import ServiceListResponse = ServicesAPI.ServiceListResponse; |
| 51 | export import ServiceListResponsesSinglePage = ServicesAPI.ServiceListResponsesSinglePage; |
| 52 | export import ServiceListParams = ServicesAPI.ServiceListParams; |
| 53 | } |