"use strict";
// File generated from our OpenAPI spec by Stainless.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Prefixes = void 0;
const resource_1 = require("cloudflare/resource");
class Prefixes extends resource_1.APIResource {
    /**
     * List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to
     * control which specific subnets are advertised to the Internet. It is possible to
     * advertise subnets more specific than an IP Prefix by creating more specific BGP
     * Prefixes.
     */
    list(prefixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Update the properties of a BGP Prefix, such as the on demand advertisement
     * status (advertised or withdrawn).
     */
    edit(prefixId, bgpPrefixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Retrieve a single BGP Prefix according to its identifier
     */
    get(prefixId, bgpPrefixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
exports.Prefixes = Prefixes;
(function (Prefixes) {
})(Prefixes = exports.Prefixes || (exports.Prefixes = {}));
//# sourceMappingURL=prefixes.js.map