"use strict";
// File generated from our OpenAPI spec by Stainless.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZoneListResponsesV4PagePaginationArray = exports.Zones = void 0;
const resource_1 = require("cloudflare/resource");
const core_1 = require("cloudflare/core");
const ZonesAPI = __importStar(require("cloudflare/resources/zones/zones"));
const ActivationCheckAPI = __importStar(require("cloudflare/resources/zones/activation-check"));
const CustomNameserversAPI = __importStar(require("cloudflare/resources/zones/custom-nameservers"));
const HoldsAPI = __importStar(require("cloudflare/resources/zones/holds"));
const SubscriptionsAPI = __importStar(require("cloudflare/resources/zones/subscriptions"));
const SettingsAPI = __importStar(require("cloudflare/resources/zones/settings/settings"));
const WorkersAPI = __importStar(require("cloudflare/resources/zones/workers/workers"));
const pagination_1 = require("cloudflare/pagination");
class Zones extends resource_1.APIResource {
    constructor() {
        super(...arguments);
        this.activationCheck = new ActivationCheckAPI.ActivationCheck(this._client);
        this.settings = new SettingsAPI.Settings(this._client);
        this.customNameservers = new CustomNameserversAPI.CustomNameservers(this._client);
        this.holds = new HoldsAPI.Holds(this._client);
        this.workers = new WorkersAPI.Workers(this._client);
        this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
    }
    /**
     * Create Zone
     */
    create(body, options) {
        return this._client.post('/zones', { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    list(query = {}, options) {
        if ((0, core_1.isRequestOptions)(query)) {
            return this.list({}, query);
        }
        return this._client.getAPIList('/zones', ZoneListResponsesV4PagePaginationArray, { query, ...options });
    }
    /**
     * Deletes an existing zone.
     */
    delete(params, options) {
        const { zone_id } = params;
        return this._client.delete(`/zones/${zone_id}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Edits a zone. Only one zone property can be changed at a time.
     */
    edit(params, options) {
        const { zone_id, ...body } = params;
        return this._client.patch(`/zones/${zone_id}`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Zone Details
     */
    get(params, options) {
        const { zone_id } = params;
        return this._client.get(`/zones/${zone_id}`, options)._thenUnwrap((obj) => obj.result);
    }
}
exports.Zones = Zones;
class ZoneListResponsesV4PagePaginationArray extends pagination_1.V4PagePaginationArray {
}
exports.ZoneListResponsesV4PagePaginationArray = ZoneListResponsesV4PagePaginationArray;
(function (Zones) {
    Zones.ZoneListResponsesV4PagePaginationArray = ZonesAPI.ZoneListResponsesV4PagePaginationArray;
    Zones.ActivationCheck = ActivationCheckAPI.ActivationCheck;
    Zones.Settings = SettingsAPI.Settings;
    Zones.CustomNameservers = CustomNameserversAPI.CustomNameservers;
    Zones.Holds = HoldsAPI.Holds;
    Zones.Workers = WorkersAPI.Workers;
    Zones.Subscriptions = SubscriptionsAPI.Subscriptions;
})(Zones = exports.Zones || (exports.Zones = {}));
//# sourceMappingURL=zones.js.map