import { APIResource } from "../../../core/resource.mjs"; import * as AdvertisementStatusAPI from "./advertisement-status.mjs"; import { AdvertisementStatus, AdvertisementStatusEditParams, AdvertisementStatusEditResponse, AdvertisementStatusGetParams, AdvertisementStatusGetResponse, BaseAdvertisementStatus } from "./advertisement-status.mjs"; import * as BGPPrefixesAPI from "./bgp-prefixes.mjs"; import { BGPPrefix, BGPPrefixCreateParams, BGPPrefixEditParams, BGPPrefixGetParams, BGPPrefixListParams, BGPPrefixes, BGPPrefixesSinglePage, BaseBGPPrefixes } from "./bgp-prefixes.mjs"; import * as DelegationsAPI from "./delegations.mjs"; import { BaseDelegations, DelegationCreateParams, DelegationDeleteParams, DelegationDeleteResponse, DelegationListParams, Delegations, DelegationsSinglePage } from "./delegations.mjs"; import * as ServiceBindingsAPI from "./service-bindings.mjs"; import { BaseServiceBindings, ServiceBinding, ServiceBindingCreateParams, ServiceBindingDeleteParams, ServiceBindingDeleteResponse, ServiceBindingGetParams, ServiceBindingListParams, ServiceBindings, ServiceBindingsSinglePage } from "./service-bindings.mjs"; import { APIPromise } from "../../../core/api-promise.mjs"; import { PagePromise, SinglePage } from "../../../core/pagination.mjs"; import { RequestOptions } from "../../../internal/request-options.mjs"; export declare class BasePrefixes extends APIResource { static readonly _key: readonly ['addressing', 'prefixes']; /** * Add a new prefix under the account. * * @example * ```ts * const prefix = await client.addressing.prefixes.create({ * account_id: '258def64c72dae45f3e4c8516e2111f2', * asn: 13335, * cidr: '192.0.2.0/24', * }); * ``` */ create(params: PrefixCreateParams, options?: RequestOptions): APIPromise; /** * List all prefixes owned by the account. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const prefix of client.addressing.prefixes.list({ * account_id: '258def64c72dae45f3e4c8516e2111f2', * })) { * // ... * } * ``` */ list(params: PrefixListParams, options?: RequestOptions): PagePromise; /** * Delete an unapproved prefix owned by the account. * * @example * ```ts * const prefix = await client.addressing.prefixes.delete( * '2af39739cc4e3b5910c918468bb89828', * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, * ); * ``` */ delete(prefixID: string, params: PrefixDeleteParams, options?: RequestOptions): APIPromise; /** * Modify the description for a prefix owned by the account. * * @example * ```ts * const prefix = await client.addressing.prefixes.edit( * '2af39739cc4e3b5910c918468bb89828', * { * account_id: '258def64c72dae45f3e4c8516e2111f2', * description: 'Internal test prefix', * }, * ); * ``` */ edit(prefixID: string, params: PrefixEditParams, options?: RequestOptions): APIPromise; /** * List a particular prefix owned by the account. * * @example * ```ts * const prefix = await client.addressing.prefixes.get( * '2af39739cc4e3b5910c918468bb89828', * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, * ); * ``` */ get(prefixID: string, params: PrefixGetParams, options?: RequestOptions): APIPromise; } export declare class Prefixes extends BasePrefixes { serviceBindings: ServiceBindingsAPI.ServiceBindings; bgpPrefixes: BGPPrefixesAPI.BGPPrefixes; advertisementStatus: AdvertisementStatusAPI.AdvertisementStatus; delegations: DelegationsAPI.Delegations; } export type PrefixesSinglePage = SinglePage; export interface Prefix { /** * Identifier of an IP Prefix. */ id?: string; /** * Identifier of a Cloudflare account. */ account_id?: string; /** * @deprecated Prefer the * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) * instead, which allows for advertising multiple BGP routes within a single IP * Prefix. */ advertised?: boolean | null; /** * @deprecated Prefer the * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) * instead, which allows for advertising multiple BGP routes within a single IP * Prefix. */ advertised_modified_at?: string | null; /** * Approval state of the prefix (P = pending, V = active). */ approved?: string; /** * Autonomous System Number (ASN) the prefix will be advertised under. */ asn?: number; /** * IP Prefix in Classless Inter-Domain Routing format. */ cidr?: string; created_at?: string; /** * Whether Cloudflare is allowed to generate the LOA document on behalf of the * prefix owner. */ delegate_loa_creation?: boolean; /** * Description of the prefix. */ description?: string; /** * State of one kind of validation for an IP prefix. */ irr_validation_state?: string; /** * Identifier for the uploaded LOA document. */ loa_document_id?: string | null; modified_at?: string; /** * @deprecated Prefer the * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) * instead, which allows for advertising multiple BGP routes within a single IP * Prefix. */ on_demand_enabled?: boolean; /** * @deprecated Prefer the * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) * instead, which allows for advertising multiple BGP routes within a single IP * Prefix. */ on_demand_locked?: boolean; /** * State of one kind of validation for an IP prefix. */ ownership_validation_state?: string; /** * Token provided to demonstrate ownership of the prefix. */ ownership_validation_token?: string; /** * State of one kind of validation for an IP prefix. */ rpki_validation_state?: string; } export interface PrefixDeleteResponse { errors: Array; messages: Array; /** * Whether the API call was successful. */ success: true; } export declare namespace PrefixDeleteResponse { interface Error { code: number; message: string; documentation_url?: string; source?: Error.Source; } namespace Error { interface Source { pointer?: string; } } interface Message { code: number; message: string; documentation_url?: string; source?: Message.Source; } namespace Message { interface Source { pointer?: string; } } } export interface PrefixCreateParams { /** * Path param: Identifier of a Cloudflare account. */ account_id: string; /** * Body param: Autonomous System Number (ASN) the prefix will be advertised under. */ asn: number; /** * Body param: IP Prefix in Classless Inter-Domain Routing format. */ cidr: string; /** * Body param: Whether Cloudflare is allowed to generate the LOA document on behalf * of the prefix owner. */ delegate_loa_creation?: boolean; /** * Body param: Description of the prefix. */ description?: string; /** * Body param: Identifier for the uploaded LOA document. */ loa_document_id?: string | null; } export interface PrefixListParams { /** * Identifier of a Cloudflare account. */ account_id: string; } export interface PrefixDeleteParams { /** * Identifier of a Cloudflare account. */ account_id: string; } export interface PrefixEditParams { /** * Path param: Identifier of a Cloudflare account. */ account_id: string; /** * Body param: Description of the prefix. */ description: string; } export interface PrefixGetParams { /** * Identifier of a Cloudflare account. */ account_id: string; } export declare namespace Prefixes { export { type Prefix as Prefix, type PrefixDeleteResponse as PrefixDeleteResponse, type PrefixesSinglePage as PrefixesSinglePage, type PrefixCreateParams as PrefixCreateParams, type PrefixListParams as PrefixListParams, type PrefixDeleteParams as PrefixDeleteParams, type PrefixEditParams as PrefixEditParams, type PrefixGetParams as PrefixGetParams, }; export { ServiceBindings as ServiceBindings, BaseServiceBindings as BaseServiceBindings, type ServiceBinding as ServiceBinding, type ServiceBindingDeleteResponse as ServiceBindingDeleteResponse, type ServiceBindingsSinglePage as ServiceBindingsSinglePage, type ServiceBindingCreateParams as ServiceBindingCreateParams, type ServiceBindingListParams as ServiceBindingListParams, type ServiceBindingDeleteParams as ServiceBindingDeleteParams, type ServiceBindingGetParams as ServiceBindingGetParams, }; export { BGPPrefixes as BGPPrefixes, BaseBGPPrefixes as BaseBGPPrefixes, type BGPPrefix as BGPPrefix, type BGPPrefixesSinglePage as BGPPrefixesSinglePage, type BGPPrefixCreateParams as BGPPrefixCreateParams, type BGPPrefixListParams as BGPPrefixListParams, type BGPPrefixEditParams as BGPPrefixEditParams, type BGPPrefixGetParams as BGPPrefixGetParams, }; export { AdvertisementStatus as AdvertisementStatus, BaseAdvertisementStatus as BaseAdvertisementStatus, type AdvertisementStatusEditResponse as AdvertisementStatusEditResponse, type AdvertisementStatusGetResponse as AdvertisementStatusGetResponse, type AdvertisementStatusEditParams as AdvertisementStatusEditParams, type AdvertisementStatusGetParams as AdvertisementStatusGetParams, }; export { type Delegations as Delegations, BaseDelegations as BaseDelegations, type DelegationDeleteResponse as DelegationDeleteResponse, type DelegationsSinglePage as DelegationsSinglePage, type DelegationCreateParams as DelegationCreateParams, type DelegationListParams as DelegationListParams, type DelegationDeleteParams as DelegationDeleteParams, }; } //# sourceMappingURL=prefixes.d.mts.map