// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as PostureAPI from 'cloudflaredev/resources/zero-trust/devices/posture/posture';
import * as IntegrationsAPI from 'cloudflaredev/resources/zero-trust/devices/posture/integrations';
import { SinglePage } from 'cloudflaredev/pagination';
export class Posture extends APIResource {
    constructor() {
        super(...arguments);
        this.integrations = new IntegrationsAPI.Integrations(this._client);
    }
    /**
     * Creates a new device posture rule.
     */
    create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/devices/posture`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Updates a device posture rule.
     */
    update(ruleId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/devices/posture/${ruleId}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetches device posture rules for a Zero Trust account.
     */
    list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/devices/posture`, DevicePostureRulesSinglePage, options);
    }
    /**
     * Deletes a device posture rule.
     */
    delete(ruleId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/devices/posture/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetches a single device posture rule.
     */
    get(ruleId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/devices/posture/${ruleId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class DevicePostureRulesSinglePage extends SinglePage {
}
(function (Posture) {
    Posture.DevicePostureRulesSinglePage = PostureAPI.DevicePostureRulesSinglePage;
    Posture.Integrations = IntegrationsAPI.Integrations;
    Posture.IntegrationsSinglePage = IntegrationsAPI.IntegrationsSinglePage;
})(Posture || (Posture = {}));
//# sourceMappingURL=posture.mjs.map