// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as BusinessPartnersAPI from './business-partners'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Break types configured by the company for time tracking */ export class BreakPolicies extends APIResource { /** * A list of break policies. * * - Requires: `API Tier 2` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: BreakPolicyListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/break-policies/', PageCursorURL, { query, ...options, }); } /** * Retrieve a specific break policy */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/break-policies/${id}/`, options); } } export type BreakPolicyListResponsesPageCursorURL = PageCursorURL; export interface BreakPolicyListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The display name of the break policy. For default policies this is the * system-generated label (e.g. 'Default Break policy: All Workers | California'); * for custom policies this is the admin-provided description. */ name: string; /** * Record update date */ updated_at: string; /** * ISO 3166-1 alpha-2 country code the policy applies to (e.g. 'US', 'CA', 'GB'). */ country_code?: string; /** * Whether this is a system-seeded default policy (true) or a custom policy created * by an admin (false). */ is_default?: boolean; } /** * Meta information for the response. */ export interface BreakPolicyRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The display name of the break policy. For default policies this is the * system-generated label (e.g. 'Default Break policy: All Workers | California'); * for custom policies this is the admin-provided description. */ name: string; /** * Record update date */ updated_at: string; /** * ISO 3166-1 alpha-2 country code the policy applies to (e.g. 'US', 'CA', 'GB'). */ country_code?: string; /** * Whether this is a system-seeded default policy (true) or a custom policy created * by an admin (false). */ is_default?: boolean; } export interface BreakPolicyListParams { cursor?: string; order_by?: string; } export declare namespace BreakPolicies { export { type BreakPolicyListResponse as BreakPolicyListResponse, type BreakPolicyRetrieveResponse as BreakPolicyRetrieveResponse, type BreakPolicyListResponsesPageCursorURL as BreakPolicyListResponsesPageCursorURL, type BreakPolicyListParams as BreakPolicyListParams, }; }