// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as ZonesAPI from 'cloudflare/resources/zones/zones';
import * as ActivationCheckAPI from 'cloudflare/resources/zones/activation-check';
import * as CustomNameserversAPI from 'cloudflare/resources/zones/custom-nameservers';
import * as HoldsAPI from 'cloudflare/resources/zones/holds';
import * as SubscriptionsAPI from 'cloudflare/resources/zones/subscriptions';
import * as SettingsAPI from 'cloudflare/resources/zones/settings/settings';
import * as WorkersAPI from 'cloudflare/resources/zones/workers/workers';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Zones extends 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 (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);
    }
}
export class ZoneListResponsesV4PagePaginationArray extends V4PagePaginationArray {
}
(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 || (Zones = {}));
//# sourceMappingURL=zones.mjs.map