UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

48 lines • 2.12 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseOverrideCodes = /* @__PURE__ */ (() => { class BaseOverrideCodes extends APIResource { /** * Fetches a one-time use admin override code for a device. This relies on the * **Admin Override** setting being enabled in your device configuration. Not * supported when * [multi-user mode](https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp/deployment/mdm-deployment/windows-multiuser/) * is enabled for the account. **Deprecated:** please use GET * /accounts/{account_id}/devices/registrations/{registration_id}/override_codes * instead. * * @deprecated */ list(deviceID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/devices/${deviceID}/override_codes`, options)._thenUnwrap((obj) => obj.result); } /** * Fetches one-time use admin override codes for a registration. This relies on the * **Admin Override** setting being enabled in your device configuration. * * @example * ```ts * const overrideCode = * await client.zeroTrust.devices.overrideCodes.get( * 'registration_id', * { account_id: 'account_id' }, * ); * ``` */ get(registrationID, params, options) { const { account_id } = params; return this._client.get(path `/accounts/${account_id}/devices/registrations/${registrationID}/override_codes`, options)._thenUnwrap((obj) => obj.result); } } BaseOverrideCodes._key = Object.freeze([ 'zeroTrust', 'devices', 'overrideCodes', ]); return BaseOverrideCodes; })(); export class OverrideCodes extends BaseOverrideCodes { } //# sourceMappingURL=override-codes.mjs.map