UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

104 lines • 4.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CloudIntegrations = exports.BaseCloudIntegrations = 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 headers_1 = require("../../internal/headers.js"); const path_1 = require("../../internal/utils/path.js"); var BaseCloudIntegrations = /* @__PURE__ */ (() => { class BaseCloudIntegrations extends resource_1.APIResource { /** * Create a new Cloud Integration (Closed Beta). */ create(params, options) { const { account_id, forwarded, ...body } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers`, { body, ...options, headers: (0, headers_1.buildHeaders)([ { ...(forwarded != null ? { forwarded: forwarded } : undefined) }, options?.headers, ]), })._thenUnwrap((obj) => obj.result); } /** * Update a Cloud Integration (Closed Beta). */ update(providerID, params, options) { const { account_id, ...body } = params; return this._client.put((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers/${providerID}`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * List Cloud Integrations (Closed Beta). */ list(params, options) { const { account_id, ...query } = params; return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers`, (pagination_1.SinglePage), { query, ...options }); } /** * Delete a Cloud Integration (Closed Beta). */ delete(providerID, params, options) { const { account_id } = params; return this._client.delete((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers/${providerID}`, options)._thenUnwrap((obj) => obj.result); } /** * Run discovery for a Cloud Integration (Closed Beta). */ discover(providerID, params, options) { const { account_id, v2 } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers/${providerID}/discover`, { query: { v2 }, ...options, }); } /** * Run discovery for all Cloud Integrations in an account (Closed Beta). */ discoverAll(params, options) { const { account_id } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers/discover`, options); } /** * Update a Cloud Integration (Closed Beta). */ edit(providerID, params, options) { const { account_id, ...body } = params; return this._client.patch((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers/${providerID}`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Read a Cloud Integration (Closed Beta). */ get(providerID, params, options) { const { account_id, ...query } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers/${providerID}`, { query, ...options, })._thenUnwrap((obj) => obj.result); } /** * Get initial configuration to complete Cloud Integration setup (Closed Beta). */ initialSetup(providerID, params, options) { const { account_id } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/magic/cloud/providers/${providerID}/initial_setup`, options)._thenUnwrap((obj) => obj.result); } } BaseCloudIntegrations._key = Object.freeze([ 'magicCloudNetworking', 'cloudIntegrations', ]); return BaseCloudIntegrations; })(); exports.BaseCloudIntegrations = BaseCloudIntegrations; class CloudIntegrations extends BaseCloudIntegrations { } exports.CloudIntegrations = CloudIntegrations; //# sourceMappingURL=cloud-integrations.js.map