// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
export class IPSECTunnels extends APIResource {
    /**
     * Creates new IPsec tunnels associated with an account. Use `?validate_only=true`
     * as an optional query parameter to only run validation without persisting
     * changes.
     */
    create(accountIdentifier, body, options) {
        return this._client.post(`/accounts/${accountIdentifier}/magic/ipsec_tunnels`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Updates a specific IPsec tunnel associated with an account. Use
     * `?validate_only=true` as an optional query parameter to only run validation
     * without persisting changes.
     */
    update(accountIdentifier, tunnelIdentifier, body, options) {
        return this._client.put(`/accounts/${accountIdentifier}/magic/ipsec_tunnels/${tunnelIdentifier}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Lists IPsec tunnels associated with an account.
     */
    list(accountIdentifier, options) {
        return this._client.get(`/accounts/${accountIdentifier}/magic/ipsec_tunnels`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Disables and removes a specific static IPsec Tunnel associated with an account.
     * Use `?validate_only=true` as an optional query parameter to only run validation
     * without persisting changes.
     */
    delete(accountIdentifier, tunnelIdentifier, options) {
        return this._client.delete(`/accounts/${accountIdentifier}/magic/ipsec_tunnels/${tunnelIdentifier}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Lists details for a specific IPsec tunnel.
     */
    get(accountIdentifier, tunnelIdentifier, options) {
        return this._client.get(`/accounts/${accountIdentifier}/magic/ipsec_tunnels/${tunnelIdentifier}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Generates a Pre Shared Key for a specific IPsec tunnel used in the IKE session.
     * Use `?validate_only=true` as an optional query parameter to only run validation
     * without persisting changes. After a PSK is generated, the PSK is immediately
     * persisted to Cloudflare's edge and cannot be retrieved later. Note the PSK in a
     * safe place.
     */
    pskGenerate(accountIdentifier, tunnelIdentifier, options) {
        return this._client.post(`/accounts/${accountIdentifier}/magic/ipsec_tunnels/${tunnelIdentifier}/psk_generate`, options)._thenUnwrap((obj) => obj.result);
    }
}
(function (IPSECTunnels) {
})(IPSECTunnels || (IPSECTunnels = {}));
//# sourceMappingURL=ipsec-tunnels.mjs.map