UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

110 lines • 5.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Gateway = exports.BaseGateway = void 0; const tslib_1 = require("../../../internal/tslib.js"); // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const AppTypesAPI = tslib_1.__importStar(require("./app-types.js")); const app_types_1 = require("./app-types.js"); const AuditSSHSettingsAPI = tslib_1.__importStar(require("./audit-ssh-settings.js")); const audit_ssh_settings_1 = require("./audit-ssh-settings.js"); const CategoriesAPI = tslib_1.__importStar(require("./categories.js")); const categories_1 = require("./categories.js"); const CertificatesAPI = tslib_1.__importStar(require("./certificates.js")); const certificates_1 = require("./certificates.js"); const LocationsAPI = tslib_1.__importStar(require("./locations.js")); const locations_1 = require("./locations.js"); const LoggingAPI = tslib_1.__importStar(require("./logging.js")); const logging_1 = require("./logging.js"); const PacfilesAPI = tslib_1.__importStar(require("./pacfiles.js")); const pacfiles_1 = require("./pacfiles.js"); const ProxyEndpointsAPI = tslib_1.__importStar(require("./proxy-endpoints.js")); const proxy_endpoints_1 = require("./proxy-endpoints.js"); const RulesAPI = tslib_1.__importStar(require("./rules.js")); const rules_1 = require("./rules.js"); const ConfigurationsAPI = tslib_1.__importStar(require("./configurations/configurations.js")); const configurations_1 = require("./configurations/configurations.js"); const ListsAPI = tslib_1.__importStar(require("./lists/lists.js")); const lists_1 = require("./lists/lists.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseGateway = /* @__PURE__ */ (() => { class BaseGateway extends resource_1.APIResource { /** * Create a Zero Trust account for an existing Cloudflare account. * * @example * ```ts * const gateway = await client.zeroTrust.gateway.create({ * account_id: '699d98642c564d2e855e9661899b7252', * }); * ``` */ create(params, options) { const { account_id } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/gateway`, options)._thenUnwrap((obj) => obj.result); } /** * Retrieve information about the current Zero Trust account. * * @example * ```ts * const gateways = await client.zeroTrust.gateway.list({ * account_id: '699d98642c564d2e855e9661899b7252', * }); * ``` */ list(params, options) { const { account_id } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/gateway`, options)._thenUnwrap((obj) => obj.result); } } BaseGateway._key = Object.freeze([ 'zeroTrust', 'gateway', ]); return BaseGateway; })(); exports.BaseGateway = BaseGateway; var Gateway = /* @__PURE__ */ (() => { class Gateway extends BaseGateway { constructor() { super(...arguments); this.auditSSHSettings = new AuditSSHSettingsAPI.AuditSSHSettings(this._client); this.categories = new CategoriesAPI.Categories(this._client); this.appTypes = new AppTypesAPI.AppTypes(this._client); this.configurations = new ConfigurationsAPI.Configurations(this._client); this.lists = new ListsAPI.Lists(this._client); this.locations = new LocationsAPI.Locations(this._client); this.logging = new LoggingAPI.Logging(this._client); this.proxyEndpoints = new ProxyEndpointsAPI.ProxyEndpoints(this._client); this.rules = new RulesAPI.Rules(this._client); this.certificates = new CertificatesAPI.Certificates(this._client); this.pacfiles = new PacfilesAPI.Pacfiles(this._client); } } Gateway.AuditSSHSettings = audit_ssh_settings_1.AuditSSHSettings; Gateway.BaseAuditSSHSettings = audit_ssh_settings_1.BaseAuditSSHSettings; Gateway.Categories = categories_1.Categories; Gateway.BaseCategories = categories_1.BaseCategories; Gateway.AppTypes = app_types_1.AppTypes; Gateway.BaseAppTypes = app_types_1.BaseAppTypes; Gateway.Configurations = configurations_1.Configurations; Gateway.BaseConfigurations = configurations_1.BaseConfigurations; Gateway.Lists = lists_1.Lists; Gateway.BaseLists = lists_1.BaseLists; Gateway.Locations = locations_1.Locations; Gateway.BaseLocations = locations_1.BaseLocations; Gateway.Logging = logging_1.Logging; Gateway.BaseLogging = logging_1.BaseLogging; Gateway.ProxyEndpoints = proxy_endpoints_1.ProxyEndpoints; Gateway.BaseProxyEndpoints = proxy_endpoints_1.BaseProxyEndpoints; Gateway.Rules = rules_1.Rules; Gateway.BaseRules = rules_1.BaseRules; Gateway.Certificates = certificates_1.Certificates; Gateway.BaseCertificates = certificates_1.BaseCertificates; Gateway.Pacfiles = pacfiles_1.Pacfiles; Gateway.BasePacfiles = pacfiles_1.BasePacfiles; return Gateway; })(); exports.Gateway = Gateway; //# sourceMappingURL=gateway.js.map