// 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 { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Job related information for the company */ export class JobDimensions extends APIResource { /** * A list of job dimensions. * * - Requires: `API Tier 2` * - Filterable fields: `name` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: JobDimensionListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/job-dimensions/', PageCursorURL, { query, ...options }); } /** * Create a new job dimension */ create(body: JobDimensionCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/job-dimensions/', { body, ...options }); } /** * Retrieve a specific job dimension */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/job-dimensions/${id}/`, options); } /** * Update a specific job dimension. */ update(id: string, body: JobDimensionUpdateParams, options?: RequestOptions): APIPromise { return this._client.patch(path`/job-dimensions/${id}/`, { body, ...options }); } /** * Delete a job dimension */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/job-dimensions/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type JobDimensionsPageCursorURL = PageCursorURL; export interface JobDimension { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The name of the job dimension */ name: string; /** * Record update date */ updated_at: string; /** * The unique identifier of the job dimension in a third party system */ external_id?: string; /** * The ID of the dimension roster group. */ group_id?: string; /** * Whether the job dimension includes codes related to a custom location. Only one * dimension can have this set to true. */ includes_custom_location?: boolean; /** * Organizational attributes associated with the job dimension. Only 'PAY_RATE' can * be set or modified using POST or PATCH requests. */ org_attribute_associations?: Array<'DEPARTMENT' | 'WORK_LOCATION' | 'PAY_RATE' | 'ENTITY'>; /** * The roster type of the dimension. PER_DIMENSION means that there is a group on * the dimension level and employees within that group have access to all job codes * in the dimension. PER_JOB_CODE means that each job code has its own group. */ roster_type?: 'PER_DIMENSION' | 'PER_JOB_CODE'; } export interface JobDimensionRequest { /** * The name of the job dimension */ name: string; /** * The unique identifier of the job dimension in a third party system */ external_id?: string; /** * Whether the job dimension includes codes related to a custom location. Only one * dimension can have this set to true. */ includes_custom_location?: boolean; /** * Organizational attributes associated with the job dimension. Only 'PAY_RATE' can * be set or modified using POST or PATCH requests. */ org_attribute_associations?: Array<'DEPARTMENT' | 'WORK_LOCATION' | 'PAY_RATE' | 'ENTITY'>; /** * The roster type of the dimension. PER_DIMENSION means that there is a group on * the dimension level and employees within that group have access to all job codes * in the dimension. PER_JOB_CODE means that each job code has its own group. */ roster_type?: 'PER_DIMENSION' | 'PER_JOB_CODE'; } /** * Meta information for the response. */ export interface JobDimensionRetrieveResponse extends BusinessPartnersAPI.Meta, JobDimension {} export interface JobDimensionListParams { cursor?: string; filter?: string; order_by?: string; } export interface JobDimensionCreateParams { /** * The name of the job dimension */ name: string; /** * The unique identifier of the job dimension in a third party system */ external_id?: string; /** * Whether the job dimension includes codes related to a custom location. Only one * dimension can have this set to true. */ includes_custom_location?: boolean; /** * Organizational attributes associated with the job dimension. Only 'PAY_RATE' can * be set or modified using POST or PATCH requests. */ org_attribute_associations?: Array<'DEPARTMENT' | 'WORK_LOCATION' | 'PAY_RATE' | 'ENTITY'>; /** * The roster type of the dimension. PER_DIMENSION means that there is a group on * the dimension level and employees within that group have access to all job codes * in the dimension. PER_JOB_CODE means that each job code has its own group. */ roster_type?: 'PER_DIMENSION' | 'PER_JOB_CODE'; } export interface JobDimensionUpdateParams { /** * The name of the job dimension */ name: string; /** * The unique identifier of the job dimension in a third party system */ external_id?: string; /** * Whether the job dimension includes codes related to a custom location. Only one * dimension can have this set to true. */ includes_custom_location?: boolean; /** * Organizational attributes associated with the job dimension. Only 'PAY_RATE' can * be set or modified using POST or PATCH requests. */ org_attribute_associations?: Array<'DEPARTMENT' | 'WORK_LOCATION' | 'PAY_RATE' | 'ENTITY'>; /** * The roster type of the dimension. PER_DIMENSION means that there is a group on * the dimension level and employees within that group have access to all job codes * in the dimension. PER_JOB_CODE means that each job code has its own group. */ roster_type?: 'PER_DIMENSION' | 'PER_JOB_CODE'; } export declare namespace JobDimensions { export { type JobDimension as JobDimension, type JobDimensionRequest as JobDimensionRequest, type JobDimensionRetrieveResponse as JobDimensionRetrieveResponse, type JobDimensionsPageCursorURL as JobDimensionsPageCursorURL, type JobDimensionListParams as JobDimensionListParams, type JobDimensionCreateParams as JobDimensionCreateParams, type JobDimensionUpdateParams as JobDimensionUpdateParams, }; }