// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import { isRequestOptions } from 'cloudflaredev/core';
import * as ActivationCheckAPI from 'cloudflaredev/resources/zones/activation-check';
import * as CustomNameserversAPI from 'cloudflaredev/resources/zones/custom-nameservers';
import * as DNSSettingsAPI from 'cloudflaredev/resources/zones/dns-settings';
import * as HoldsAPI from 'cloudflaredev/resources/zones/holds';
import * as SubscriptionsAPI from 'cloudflaredev/resources/zones/subscriptions';
import * as SettingsAPI from 'cloudflaredev/resources/zones/settings/settings';
import { V4PagePaginationArray } from 'cloudflaredev/pagination';
export class Zones extends APIResource {
    constructor() {
        super(...arguments);
        this.activationCheck = new ActivationCheckAPI.ActivationCheck(this._client);
        this.dnsSettings = new DNSSettingsAPI.DNSSettings(this._client);
        this.settings = new SettingsAPI.Settings(this._client);
        this.customNameservers = new CustomNameserversAPI.CustomNameservers(this._client);
        this.holds = new HoldsAPI.Holds(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 (isRequestOptions(query)) {
            return this.list({}, query);
        }
        return this._client.getAPIList('/zones', ZonesV4PagePaginationArray, { 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);
    }
}
export class ZonesV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Zones) {
    Zones.ActivationCheck = ActivationCheckAPI.ActivationCheck;
    Zones.DNSSettings = DNSSettingsAPI.DNSSettings;
    Zones.Settings = SettingsAPI.Settings;
    Zones.CustomNameservers = CustomNameserversAPI.CustomNameservers;
    Zones.Holds = HoldsAPI.Holds;
    Zones.Subscriptions = SubscriptionsAPI.Subscriptions;
})(Zones || (Zones = {}));
//# sourceMappingURL=zones.mjs.map