// 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'; /** * Workers who work or have worked at the company */ export class CompanyLegalEntityWorkers extends APIResource { /** * A list of company-legal-entity-workers. * * - Requires: `API Tier 2` * - Filterable fields: `status`, `company_entity_id` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: CompanyLegalEntityWorkerListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList( '/company-legal-entity-workers/', PageCursorURL, { query, ...options }, ); } /** * Retrieve a specific company-legal-entity-worker */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/company-legal-entity-workers/${id}/`, options); } } export type CompanyLegalEntityWorkerListResponsesPageCursorURL = PageCursorURL; export interface CompanyLegalEntityWorkerListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The worker's associated company legal entity (CER ID). */ company_entity_id?: string; /** * The worker's status within the organization. */ status?: 'INIT' | 'HIRED' | 'ACCEPTED' | 'ACTIVE' | 'TERMINATED'; } /** * Meta information for the response. */ export interface CompanyLegalEntityWorkerRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The worker's associated company legal entity (CER ID). */ company_entity_id?: string; /** * The worker's status within the organization. */ status?: 'INIT' | 'HIRED' | 'ACCEPTED' | 'ACTIVE' | 'TERMINATED'; } export interface CompanyLegalEntityWorkerListParams { cursor?: string; filter?: string; order_by?: string; } export declare namespace CompanyLegalEntityWorkers { export { type CompanyLegalEntityWorkerListResponse as CompanyLegalEntityWorkerListResponse, type CompanyLegalEntityWorkerRetrieveResponse as CompanyLegalEntityWorkerRetrieveResponse, type CompanyLegalEntityWorkerListResponsesPageCursorURL as CompanyLegalEntityWorkerListResponsesPageCursorURL, type CompanyLegalEntityWorkerListParams as CompanyLegalEntityWorkerListParams, }; }