"use strict";
// File generated from our OpenAPI spec by Stainless.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Delegations = void 0;
const resource_1 = require("cloudflare/resource");
class Delegations extends resource_1.APIResource {
    /**
     * Create a new account delegation for a given IP prefix.
     */
    create(prefixId, params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * List all delegations for a given account IP prefix.
     */
    list(prefixId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Delete an account delegation for a given IP prefix.
     */
    delete(prefixId, delegationId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations/${delegationId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
exports.Delegations = Delegations;
(function (Delegations) {
})(Delegations = exports.Delegations || (exports.Delegations = {}));
//# sourceMappingURL=delegations.js.map