// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as PreviewsAPI from 'cloudflare/resources/healthchecks/previews';
export class Healthchecks extends 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);
    }
}
(function (Healthchecks) {
    Healthchecks.Previews = PreviewsAPI.Previews;
})(Healthchecks || (Healthchecks = {}));
//# sourceMappingURL=healthchecks.mjs.map