cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/addressing/services.ts
57lines · 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 { SinglePage } from '../../pagination'; |
| 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( |
| 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 | |
| 27 | export class ServiceListResponsesSinglePage extends SinglePage<ServiceListResponse> {} |
| 28 | |
| 29 | export 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 | |
| 42 | export interface ServiceListParams { |
| 43 | /** |
| 44 | * Identifier of a Cloudflare account. |
| 45 | */ |
| 46 | account_id: string; |
| 47 | } |
| 48 | |
| 49 | Services.ServiceListResponsesSinglePage = ServiceListResponsesSinglePage; |
| 50 | |
| 51 | export declare namespace Services { |
| 52 | export { |
| 53 | type ServiceListResponse as ServiceListResponse, |
| 54 | ServiceListResponsesSinglePage as ServiceListResponsesSinglePage, |
| 55 | type ServiceListParams as ServiceListParams, |
| 56 | }; |
| 57 | } |
| 58 | |