"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.Healthchecks = void 0;
const resource_1 = require("cloudflare/resource");
const PreviewsAPI = __importStar(require("cloudflare/resources/healthchecks/previews"));
class Healthchecks extends resource_1.APIResource {
    constructor() {
        super(...arguments);
        this.previews = new PreviewsAPI.Previews(this._client);
    }
    /**
     * Create a new health check.
     */
    create(zoneIdentifier, body, options) {
        return this._client.post(`/zones/${zoneIdentifier}/healthchecks`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Update a configured health check.
     */
    update(zoneIdentifier, identifier, body, options) {
        return this._client.put(`/zones/${zoneIdentifier}/healthchecks/${identifier}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * List configured health checks.
     */
    list(zoneIdentifier, options) {
        return this._client.get(`/zones/${zoneIdentifier}/healthchecks`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Delete a health check.
     */
    delete(zoneIdentifier, identifier, options) {
        return this._client.delete(`/zones/${zoneIdentifier}/healthchecks/${identifier}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Patch a configured health check.
     */
    edit(zoneIdentifier, identifier, body, options) {
        return this._client.patch(`/zones/${zoneIdentifier}/healthchecks/${identifier}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetch a single configured health check.
     */
    get(zoneIdentifier, identifier, options) {
        return this._client.get(`/zones/${zoneIdentifier}/healthchecks/${identifier}`, options)._thenUnwrap((obj) => obj.result);
    }
}
exports.Healthchecks = Healthchecks;
(function (Healthchecks) {
    Healthchecks.Previews = PreviewsAPI.Previews;
})(Healthchecks = exports.Healthchecks || (exports.Healthchecks = {}));
//# sourceMappingURL=healthchecks.js.map