// 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 1` * - Filterable fields: `status`, `company_entity_id` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /company-legal-entity-workers/?filter=filter&order_by=order_by&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * { * "name": "date_of_birth", * "reason": "Insufficient entitlements" * } * ] * }, * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "company_entity_id": "string", * "status": "INIT" * } * ], * "next_link": "string" * } * ``` */ 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 * * @example HTTP * Representative request and response shapes. * ``` * GET /company-legal-entity-workers/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * {} * ] * } * } * ``` */ 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; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } export declare namespace CompanyLegalEntityWorkers { export { type CompanyLegalEntityWorkerListResponse as CompanyLegalEntityWorkerListResponse, type CompanyLegalEntityWorkerRetrieveResponse as CompanyLegalEntityWorkerRetrieveResponse, type CompanyLegalEntityWorkerListResponsesPageCursorURL as CompanyLegalEntityWorkerListResponsesPageCursorURL, type CompanyLegalEntityWorkerListParams as CompanyLegalEntityWorkerListParams, }; }