/** * @module Clients / Policies * @category Entities */ import { AxiosResponse } from 'axios'; import { JwtConfig, LedgerIdentifier, LedgerPagedList, LedgerPolicy, LedgerRecord } from "../../../types/src"; import { AccessClient } from '../common/clients/access-client'; import { BaseChangeClient } from '../common/clients/base-change-client'; import { BaseClient, BaseClientOptions } from '../common/clients/base-client'; import { CreateRecordBuilder } from '../common/services/create-record-builder'; import { UpdateRecordBuilder } from '../common/services/update-record-builder'; import { BaseRecordResponse } from '../common/types/base-record-response'; import { BaseListResponse } from '../common/types/list-response'; import { PolicyListParams } from './policy-list-params'; /** * Single policy API response. */ export declare class PolicyResponse extends BaseRecordResponse { /** * Record data extracted from the `data` property of the response body. */ policy: LedgerPolicy; constructor(response: AxiosResponse, LedgerRecord>); } /** * Schemas list API response. */ export declare class PoliciesResponse extends BaseListResponse { policies: LedgerPolicy[]; constructor(response: AxiosResponse, void>); } /** * Allows querying and managing policies. * * @see {LedgerPolicy} */ export declare class PolicyClient extends BaseClient { /** * Allows querying changes. * */ change: BaseChangeClient; /** * Allows checking access. * */ access: AccessClient; constructor(options: BaseClientOptions); /** * Initializes a builder instance that supports chaining to make it * easier to work with ledger records. You can pass the record * payload to this method to use as initial content, this is useful * when you already have an object ready, for example when validating * API responses or modifying an existing record. An empty record is * going to be created if no initial data is provided. * * @see {LedgerPolicy} * @see {CreateRecordBuilder} * @param record initial record payload (optional) * @returns a builder instance */ init(record?: Partial>): CreateRecordBuilder; /** * Initializes a builder instance for updating existing records. * The builder supports chaining to make it easier to work with * ledger records. You need to pass the existing record payload * to this method to use as initial content. * * @see {LedgerPolicy} * @see {UpdateRecordBuilder} * @param record initial record payload * @returns a builder instance */ from(record: LedgerRecord): UpdateRecordBuilder; /** * Gets a ledger policy by identifier (luid or handle). * * @see {LedgerPolicy} * @throws {Error} if the policy doesn't exist or the * current user doesn't have access to this policy * @param id a unique policy handle * @returns a single policy response with the requested policy */ read(id: LedgerIdentifier, authParams?: Partial): Promise; /** * Queries policies from a ledger. * * @see {LedgerPolicy} * @param params query parameters * @returns policies list response with all found policies */ list(params?: PolicyListParams): Promise; }