UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

93 lines • 3.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IdPFederationGrants = exports.BaseIdPFederationGrants = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseIdPFederationGrants = /* @__PURE__ */ (() => { class BaseIdPFederationGrants extends resource_1.APIResource { /** * Creates an IdP federation grant for the specified identity provider, making it * available for federation to other accounts in the same Cloudflare organization. * * The account must belong to a Cloudflare organization. One-time pin and * Cloudflare-managed identity providers cannot be federated. An account can * federate at most five identity providers at a time. * * @example * ```ts * const IdPFederationGrant = * await client.zeroTrust.access.IdPFederationGrants.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * idp_id: 'a79de439-0e7f-4ebb-8a02-222222222222', * }); * ``` */ create(params, options) { const { account_id, ...body } = params; return this._client.post((0, path_1.path) `/accounts/${account_id}/access/idp_federation_grants`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Lists the IdP federation grants owned by the account. * * @example * ```ts * const IdPFederationGrants = * await client.zeroTrust.access.IdPFederationGrants.list({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ list(params, options) { const { account_id } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/access/idp_federation_grants`, options)._thenUnwrap((obj) => obj.result); } /** * Deletes an IdP federation grant. The identity provider remains in the account, * but it is no longer available for federation to other accounts. * * @example * ```ts * const IdPFederationGrant = * await client.zeroTrust.access.IdPFederationGrants.delete( * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete(grantID, params, options) { const { account_id } = params; return this._client.delete((0, path_1.path) `/accounts/${account_id}/access/idp_federation_grants/${grantID}`, options)._thenUnwrap((obj) => obj.result); } /** * Retrieves a single IdP federation grant by its UID. * * @example * ```ts * const IdPFederationGrant = * await client.zeroTrust.access.IdPFederationGrants.get( * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get(grantID, params, options) { const { account_id } = params; return this._client.get((0, path_1.path) `/accounts/${account_id}/access/idp_federation_grants/${grantID}`, options)._thenUnwrap((obj) => obj.result); } } BaseIdPFederationGrants._key = Object.freeze([ 'zeroTrust', 'access', 'IdPFederationGrants', ]); return BaseIdPFederationGrants; })(); exports.BaseIdPFederationGrants = BaseIdPFederationGrants; class IdPFederationGrants extends BaseIdPFederationGrants { } exports.IdPFederationGrants = IdPFederationGrants; //# sourceMappingURL=idp-federation-grants.js.map