cloudflare
Version:
The official TypeScript library for the Cloudflare API
111 lines • 4.36 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import { SinglePage } from "../../../../core/pagination.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export var BaseIntegrations = /* @__PURE__ */ (() => {
class BaseIntegrations extends 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(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(path `/accounts/${account_id}/devices/posture/integration`, (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(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(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(path `/accounts/${account_id}/devices/posture/integration/${integrationID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseIntegrations._key = Object.freeze(['zeroTrust', 'devices', 'posture', 'integrations']);
return BaseIntegrations;
})();
export class Integrations extends BaseIntegrations {
}
//# sourceMappingURL=integrations.mjs.map