Skip to main content
Defined in: client/policies/policies.ts:25 The namespace containing all Policy methods.

Implements

Constructors

Constructor

Returns

PoliciesClient

Methods

createPolicy()

Defined in: client/policies/policies.ts:186 Creates a new policy that can be used to govern the behavior of projects and accounts.

Parameters

options
CreatePolicyOptions Options for creating the policy

Returns

Promise<Policy> The created policy

Throws

When the policy is invalid

Examples

Implementation of


deletePolicy()

Defined in: client/policies/policies.ts:267 Deletes a policy by its unique identifier. If a policy is referenced by an active project or account, this operation will fail.

Parameters

options
DeletePolicyOptions Options containing the policy ID to delete

Returns

Promise<void> Void on successful deletion

Examples

Implementation of


getPolicyById()

Defined in: client/policies/policies.ts:226 Retrieves a policy by its unique identifier.

Parameters

options
GetPolicyByIdOptions Options containing the policy ID to retrieve

Returns

Promise<Policy> The requested policy

Example

Implementation of


listPolicies()

Defined in: client/policies/policies.ts:63 Lists policies belonging to the developer’s CDP Project. Can be filtered by scope (project or account).

Parameters

options?
ListPoliciesOptions = {} Options for filtering and paginating the results

Returns

Promise<ListPoliciesResult> A paginated list of policies

Examples

Implementation of


updatePolicy()

Defined in: client/policies/policies.ts:360 Updates an existing policy by its unique identifier. This will apply the updated policy to any project or accounts that are currently using it.

Parameters

options
UpdatePolicyOptions Options containing the policy ID and updated policy data

Returns

Promise<Policy> The updated policy

Throws

When the updated policy is invalid

Examples

Implementation of