UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

70 lines • 2.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GatewayCA = exports.BaseGatewayCA = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const pagination_1 = require("../../../core/pagination.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseGatewayCA = /* @__PURE__ */ (() => { class BaseGatewayCA extends resource_1.APIResource { /** * Adds a new SSH Certificate Authority (CA). * * @example * ```ts * const gatewayCA = * await client.zeroTrust.access.gatewayCA.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ create(params, options) { const { account_id } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/access/gateway_ca`, options)._thenUnwrap((obj) => obj.result); } /** * Lists SSH Certificate Authorities (CA). * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const gatewayCAListResponse of client.zeroTrust.access.gatewayCA.list( * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(params, options) { const { account_id } = params; return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/access/gateway_ca`, (pagination_1.SinglePage), options); } /** * Deletes an SSH Certificate Authority. * * @example * ```ts * const gatewayCA = * await client.zeroTrust.access.gatewayCA.delete( * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete(certificateID, params, options) { const { account_id } = params; return this._client.delete((0, path_1.path) `/accounts/${account_id}/access/gateway_ca/${certificateID}`, options)._thenUnwrap((obj) => obj.result); } } BaseGatewayCA._key = Object.freeze([ 'zeroTrust', 'access', 'gatewayCA', ]); return BaseGatewayCA; })(); exports.BaseGatewayCA = BaseGatewayCA; class GatewayCA extends BaseGatewayCA { } exports.GatewayCA = GatewayCA; //# sourceMappingURL=gateway-ca.js.map