import { APIResource } from "../../../../core/resource.js"; import { APIPromise } from "../../../../core/api-promise.js"; import { PagePromise, ResponsesPage } from "../../../../core/pagination.js"; import { RequestOptions } from "../../../../internal/request-options.js"; export declare class Rules extends APIResource { /** * Custom rules can be created to associate specific attributes to pay statement * items depending on the use case. For example, pay statement items that meet * certain conditions can be labeled as a pre-tax 401k. This metadata can be * retrieved where pay statement item information is available. * * @example * ```ts * const rule = * await client.hris.company.payStatementItem.rules.create(); * ``` */ create(params?: RuleCreateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Update a rule for a pay statement item. * * @example * ```ts * const rule = * await client.hris.company.payStatementItem.rules.update( * 'rule_id', * ); * ``` */ update(ruleID: string, params?: RuleUpdateParams | null | undefined, options?: RequestOptions): APIPromise; /** * List all rules of a connection account. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const ruleListResponse of client.hris.company.payStatementItem.rules.list()) { * // ... * } * ``` */ list(query?: RuleListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Delete a rule for a pay statement item. * * @example * ```ts * const rule = * await client.hris.company.payStatementItem.rules.delete( * 'rule_id', * ); * ``` */ delete(ruleID: string, params?: RuleDeleteParams | null | undefined, options?: RequestOptions): APIPromise; } export type RuleListResponsesPage = ResponsesPage; export interface RuleCreateResponse { /** * Finch id (uuidv4) for the rule. */ id?: string; /** * Specifies the fields to be applied when the condition is met. */ attributes?: RuleCreateResponse.Attributes; conditions?: Array; /** * The datetime when the rule was created. */ created_at?: string; /** * Specifies when the rules should stop applying rules based on the date. */ effective_end_date?: string | null; /** * Specifies when the rule should begin applying based on the date. */ effective_start_date?: string | null; /** * The entity type to which the rule is applied. */ entity_type?: 'pay_statement_item'; /** * The priority of the rule. */ priority?: number; /** * The datetime when the rule was last updated. */ updated_at?: string; } export declare namespace RuleCreateResponse { /** * Specifies the fields to be applied when the condition is met. */ interface Attributes { /** * The metadata to be attached in the entity. It is a key-value pairs where the * values can be of any type (string, number, boolean, object, array, etc.). */ metadata?: { [key: string]: unknown; }; } interface Condition { /** * The field to be checked in the rule. */ field?: string; /** * The operator to be used in the rule. */ operator?: 'equals'; /** * The value of the field to be checked in the rule. */ value?: string; } } export interface RuleUpdateResponse { /** * Finch id (uuidv4) for the rule. */ id?: string; /** * Specifies the fields to be applied when the condition is met. */ attributes?: RuleUpdateResponse.Attributes; conditions?: Array; /** * The datetime when the rule was created. */ created_at?: string; /** * Specifies when the rules should stop applying rules based on the date. */ effective_end_date?: string | null; /** * Specifies when the rule should begin applying based on the date. */ effective_start_date?: string | null; /** * The entity type to which the rule is applied. */ entity_type?: 'pay_statement_item'; /** * The priority of the rule. */ priority?: number; /** * The datetime when the rule was last updated. */ updated_at?: string; } export declare namespace RuleUpdateResponse { /** * Specifies the fields to be applied when the condition is met. */ interface Attributes { /** * The metadata to be attached in the entity. It is a key-value pairs where the * values can be of any type (string, number, boolean, object, array, etc.). */ metadata?: { [key: string]: unknown; }; } interface Condition { /** * The field to be checked in the rule. */ field?: string; /** * The operator to be used in the rule. */ operator?: 'equals'; /** * The value of the field to be checked in the rule. */ value?: string; } } export interface RuleListResponse { /** * Finch id (uuidv4) for the rule. */ id?: string; /** * Specifies the fields to be applied when the condition is met. */ attributes?: RuleListResponse.Attributes; conditions?: Array; /** * The datetime when the rule was created. */ created_at?: string; /** * Specifies when the rules should stop applying rules based on the date. */ effective_end_date?: string | null; /** * Specifies when the rule should begin applying based on the date. */ effective_start_date?: string | null; /** * The entity type to which the rule is applied. */ entity_type?: 'pay_statement_item'; /** * The priority of the rule. */ priority?: number; /** * The datetime when the rule was last updated. */ updated_at?: string; } export declare namespace RuleListResponse { /** * Specifies the fields to be applied when the condition is met. */ interface Attributes { /** * The metadata to be attached in the entity. It is a key-value pairs where the * values can be of any type (string, number, boolean, object, array, etc.). */ metadata?: { [key: string]: unknown; }; } interface Condition { /** * The field to be checked in the rule. */ field?: string; /** * The operator to be used in the rule. */ operator?: 'equals'; /** * The value of the field to be checked in the rule. */ value?: string; } } export interface RuleDeleteResponse { /** * Finch id (uuidv4) for the rule. */ id?: string; /** * Specifies the fields to be applied when the condition is met. */ attributes?: RuleDeleteResponse.Attributes; conditions?: Array; /** * The datetime when the rule was created. */ created_at?: string; /** * The datetime when the rule was deleted. */ deleted_at?: string; /** * Specifies when the rules should stop applying rules based on the date. */ effective_end_date?: string | null; /** * Specifies when the rule should begin applying based on the date. */ effective_start_date?: string | null; /** * The entity type to which the rule is applied. */ entity_type?: 'pay_statement_item'; /** * The priority of the rule. */ priority?: number; /** * The datetime when the rule was last updated. */ updated_at?: string; } export declare namespace RuleDeleteResponse { /** * Specifies the fields to be applied when the condition is met. */ interface Attributes { /** * The metadata to be attached in the entity. It is a key-value pairs where the * values can be of any type (string, number, boolean, object, array, etc.). */ metadata?: { [key: string]: unknown; }; } interface Condition { /** * The field to be checked in the rule. */ field?: string; /** * The operator to be used in the rule. */ operator?: 'equals'; /** * The value of the field to be checked in the rule. */ value?: string; } } export interface RuleCreateParams { /** * Query param: The entity IDs to create the rule for. */ entity_ids?: Array; /** * Body param: Specifies the fields to be applied when the condition is met. */ attributes?: RuleCreateParams.Attributes; /** * Body param */ conditions?: Array; /** * Body param: Specifies when the rules should stop applying rules based on the * date. */ effective_end_date?: string | null; /** * Body param: Specifies when the rule should begin applying based on the date. */ effective_start_date?: string | null; /** * Body param: The entity type to which the rule is applied. */ entity_type?: 'pay_statement_item'; } export declare namespace RuleCreateParams { /** * Specifies the fields to be applied when the condition is met. */ interface Attributes { /** * The metadata to be attached in the entity. It is a key-value pairs where the * values can be of any type (string, number, boolean, object, array, etc.). */ metadata?: { [key: string]: unknown; }; } interface Condition { /** * The field to be checked in the rule. */ field?: string; /** * The operator to be used in the rule. */ operator?: 'equals'; /** * The value of the field to be checked in the rule. */ value?: string; } } export interface RuleUpdateParams { /** * Query param: The entity IDs to update the rule for. */ entity_ids?: Array; /** * Body param */ optionalProperty?: unknown; } export interface RuleListParams { /** * The entity IDs to retrieve rules for. */ entity_ids?: Array; } export interface RuleDeleteParams { /** * The entity IDs to delete the rule for. */ entity_ids?: Array; } export declare namespace Rules { export { type RuleCreateResponse as RuleCreateResponse, type RuleUpdateResponse as RuleUpdateResponse, type RuleListResponse as RuleListResponse, type RuleDeleteResponse as RuleDeleteResponse, type RuleListResponsesPage as RuleListResponsesPage, type RuleCreateParams as RuleCreateParams, type RuleUpdateParams as RuleUpdateParams, type RuleListParams as RuleListParams, type RuleDeleteParams as RuleDeleteParams, }; } //# sourceMappingURL=rules.d.ts.map