cloudflare
Version:
The official TypeScript library for the Cloudflare API
116 lines • 4.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Integrations = exports.BaseIntegrations = 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 BaseIntegrations = /* @__PURE__ */ (() => {
class BaseIntegrations extends resource_1.APIResource {
/**
* Create a new device posture integration.
*
* @example
* ```ts
* const integration =
* await client.zeroTrust.devices.posture.integrations.create(
* {
* account_id: '699d98642c564d2e855e9661899b7252',
* config: {
* api_url: 'https://as123.awmdm.com/API',
* auth_url:
* 'https://na.uemauth.workspaceone.com/connect/token',
* client_id: 'example client id',
* client_secret: 'example client secret',
* },
* interval: '10m',
* name: 'My Workspace One Integration',
* type: 'workspace_one',
* },
* );
* ```
*/
create(params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/devices/posture/integration`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Fetches the list of device posture integrations for an account.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const integration of client.zeroTrust.devices.posture.integrations.list(
* { account_id: '699d98642c564d2e855e9661899b7252' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { account_id } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/devices/posture/integration`, (pagination_1.SinglePage), options);
}
/**
* Delete a configured device posture integration.
*
* @example
* ```ts
* const integration =
* await client.zeroTrust.devices.posture.integrations.delete(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '699d98642c564d2e855e9661899b7252' },
* );
* ```
*/
delete(integrationID, params, options) {
const { account_id } = params;
return this._client.delete((0, path_1.path) `/accounts/${account_id}/devices/posture/integration/${integrationID}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Updates a configured device posture integration.
*
* @example
* ```ts
* const integration =
* await client.zeroTrust.devices.posture.integrations.edit(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '699d98642c564d2e855e9661899b7252' },
* );
* ```
*/
edit(integrationID, params, options) {
const { account_id, ...body } = params;
return this._client.patch((0, path_1.path) `/accounts/${account_id}/devices/posture/integration/${integrationID}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Fetches details for a single device posture integration.
*
* @example
* ```ts
* const integration =
* await client.zeroTrust.devices.posture.integrations.get(
* 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
* { account_id: '699d98642c564d2e855e9661899b7252' },
* );
* ```
*/
get(integrationID, params, options) {
const { account_id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/devices/posture/integration/${integrationID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseIntegrations._key = Object.freeze(['zeroTrust', 'devices', 'posture', 'integrations']);
return BaseIntegrations;
})();
exports.BaseIntegrations = BaseIntegrations;
class Integrations extends BaseIntegrations {
}
exports.Integrations = Integrations;
//# sourceMappingURL=integrations.js.map