import { NullableResultPromise } from "../base-types"; import { IPolicy } from "../contracts/policies/policy"; import { IUserGroupPolicy } from "../contracts/policies/user-group-policy"; import { IUserPolicy } from "../contracts/policies/user-policy"; import { IExtendedContentHubClient } from "./extended-client"; /** * Contains functionality to get and update policies. */ export interface IPoliciesClient { /** * Gets the policy from specified user. * * @remarks * The specified user group id must be a strictly positive number. * * @param userGroupId - Id of the user group to get the policy from * @returns The policy or null when it was not found. */ getUserGroupPolicyAsync(userGroupId: number): NullableResultPromise; /** * Gets the policy from specified user. * * @remarks * The specified user id must be a strictly positive number. * * @param userId - Id of the user to get the policy from * @returns The policy or null when it was not found. */ getUserPolicyAsync(userId: number): NullableResultPromise; /** * Updates the specified policy. * * @remarks * Throws an error when the policy could not be saved because a validation error occurred. * * @param policy - The policy to update */ updateAsync(policy: IPolicy): Promise; } export declare class PoliciesClient implements IPoliciesClient { private readonly _client; constructor(client: IExtendedContentHubClient); getUserGroupPolicyAsync(userGroupId: number): NullableResultPromise; getUserPolicyAsync(userId: number): NullableResultPromise; updateAsync(policy: IPolicy): Promise; private getPolicyResourceAsync; }