// 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 * as TracksAPI from './tracks'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Levels and tracks used by the company for workers */ export class Levels extends APIResource { /** * A list of levels. * * - Requires: `API Tier 2` * - Expandable fields: `parent`, `track` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: LevelListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/levels/', PageCursorURL, { query, ...options }); } /** * Retrieve a specific level */ retrieve( id: string, query: LevelRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/levels/${id}/`, { query, ...options }); } } export type LevelsPageCursorURL = PageCursorURL; export interface Level { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The name of the level. Must be unique within the company or organization. */ name: string; /** * Record update date */ updated_at: string; /** * The description of the level. */ description?: string; /** * Global level is used to track the seniority of levels. The higher up a level is * placed on the page, the more senior and higher-ranked the level. Global level is * used in workflows, policies, and reports that use the level attribute (e.g., you * can use Level Lookup to set up a workflow that notifies the nearest person in an * worker's management chain at or above the specified level). */ global_level?: number; /** * The parent level. * * Expandable field */ parent?: Level; /** * The parent level. */ parent_id?: string; /** * The rank of the level within its track. */ rank?: number; /** * The track associated with the level, if it's not a global level. * * Expandable field */ track?: TracksAPI.Track; /** * The track associated with the level, if it's not a global level. */ track_id?: string; } /** * Meta information for the response. */ export interface LevelRetrieveResponse extends BusinessPartnersAPI.Meta, Level {} export interface LevelListParams { cursor?: string; expand?: string; order_by?: string; } export interface LevelRetrieveParams { expand?: string; } export declare namespace Levels { export { type Level as Level, type LevelRetrieveResponse as LevelRetrieveResponse, type LevelsPageCursorURL as LevelsPageCursorURL, type LevelListParams as LevelListParams, type LevelRetrieveParams as LevelRetrieveParams, }; }