// 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 JobCodesAPI from './job-codes'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Business structure used for defining hierarchy of company's org attributes */ export class BusinessStructurePaths extends APIResource { /** * A list of business-structure-paths. * * - Requires: `API Tier 2` * - Expandable fields: `parent`, `job_codes` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: BusinessStructurePathListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList( '/business-structure-paths/', PageCursorURL, { query, ...options }, ); } /** * Retrieve a specific business-structure-path */ retrieve( id: string, query: BusinessStructurePathRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/business-structure-paths/${id}/`, { query, ...options }); } } export type BusinessStructurePathListResponsesPageCursorURL = PageCursorURL; export interface BusinessStructurePathListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Ordered list of full JobCode objects for each job in the path, top to bottom. * Populate via ?expand=job_codes. Requires both business-structure-paths.read and * job-codes.read scopes. * * Expandable field */ job_codes?: Array; /** * Ordered list of Job code IDs from top to bottom. */ job_codes_id?: Array; /** * Name of the path (e.g. 'SF Office > Coffee > Barista'). */ name?: string; parent?: unknown; /** * Id of the parent BusinessStructurePath. None for root path. */ parent_id?: string; } /** * Meta information for the response. */ export interface BusinessStructurePathRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Ordered list of full JobCode objects for each job in the path, top to bottom. * Populate via ?expand=job_codes. Requires both business-structure-paths.read and * job-codes.read scopes. * * Expandable field */ job_codes?: Array; /** * Ordered list of Job code IDs from top to bottom. */ job_codes_id?: Array; /** * Name of the path (e.g. 'SF Office > Coffee > Barista'). */ name?: string; parent?: unknown; /** * Id of the parent BusinessStructurePath. None for root path. */ parent_id?: string; } export interface BusinessStructurePathListParams { cursor?: string; expand?: string; order_by?: string; } export interface BusinessStructurePathRetrieveParams { expand?: string; } export declare namespace BusinessStructurePaths { export { type BusinessStructurePathListResponse as BusinessStructurePathListResponse, type BusinessStructurePathRetrieveResponse as BusinessStructurePathRetrieveResponse, type BusinessStructurePathListResponsesPageCursorURL as BusinessStructurePathListResponsesPageCursorURL, type BusinessStructurePathListParams as BusinessStructurePathListParams, type BusinessStructurePathRetrieveParams as BusinessStructurePathRetrieveParams, }; }