// 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 Shared from './shared'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Legal entities registered by the company */ export class CompanyLegalEntities extends APIResource { /** * A list of company legal entities. * * - Requires: `API Tier 1` * - Filterable fields: `country_code` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /company-legal-entities/?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", * "country_code": "string", * "legal_name": "string", * "entity_level": "PARENT", * "registration_date": "string", * "mailing_address": { * "type": "HOME", * "formatted": "string", * "street_address": "string", * "locality": "string", * "region": "string", * "postal_code": "string", * "country": "AF" * }, * "physical_address": { * "type": "HOME", * "formatted": "string", * "street_address": "string", * "locality": "string", * "region": "string", * "postal_code": "string", * "country": "AF" * }, * "is_eor": false, * "is_cor": false, * "is_peo": false, * "is_archived": false, * "tax_identifier": "string", * "management_type": "PEO", * "company_id": "string" * } * ], * "next_link": "string" * } * ``` */ list( query: CompanyLegalEntityListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList( '/company-legal-entities/', PageCursorURL, { query, ...options }, ); } /** * Retrieve a specific company legal entity * * @example HTTP * Representative request and response shapes. * ``` * GET /company-legal-entities/{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-entities/${id}/`, options); } } export type CompanyLegalEntityListResponsesPageCursorURL = PageCursorURL; export interface CompanyLegalEntityListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The company associated with this entity relationship. */ company_id?: string; /** * The ISO country code for the entity. */ country_code?: string; /** * The entity's level in a hierarchy. _ `PARENT`: The legal entity is considered * the ultimate holding entity. _ `SUBSIDIARY`: The legal entity is considered a * subsidiary, fully or partially held by another. \* `BRANCH`: The legal entity is * considered a branch, associated with a parent legal entity. */ entity_level?: 'PARENT' | 'SUBSIDIARY' | 'BRANCH'; /** * True if this entity relationship has been archived. */ is_archived?: boolean; /** * True if this entity is managed as a Contractor of Record. */ is_cor?: boolean; /** * True if this entity is managed as an Employer of Record. */ is_eor?: boolean; /** * True if this entity is managed as a Professional Employment Organization. */ is_peo?: boolean; /** * The legal name of the entity. */ legal_name?: string; /** * The mailing address of the entity. */ mailing_address?: Shared.Address; /** * The entity management type. _ `EOR`: The entity is managed as an Employer of * Record. _ `COR`: The entity is managed as a Contractor of Record. _ `PEO`: The * entity is managed as a Professional Employment Organization. _ `null`: The * entity is a direct hire with no managed employment type. */ management_type?: 'PEO' | 'EOR' | 'COR'; /** * The physical address of the entity, if it differs from the mailing address. */ physical_address?: Shared.Address; /** * The registration date of the entity. */ registration_date?: string; /** * The tax identifier for this entity. */ tax_identifier?: string; } /** * Meta information for the response. */ export interface CompanyLegalEntityRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The company associated with this entity relationship. */ company_id?: string; /** * The ISO country code for the entity. */ country_code?: string; /** * The entity's level in a hierarchy. _ `PARENT`: The legal entity is considered * the ultimate holding entity. _ `SUBSIDIARY`: The legal entity is considered a * subsidiary, fully or partially held by another. \* `BRANCH`: The legal entity is * considered a branch, associated with a parent legal entity. */ entity_level?: 'PARENT' | 'SUBSIDIARY' | 'BRANCH'; /** * True if this entity relationship has been archived. */ is_archived?: boolean; /** * True if this entity is managed as a Contractor of Record. */ is_cor?: boolean; /** * True if this entity is managed as an Employer of Record. */ is_eor?: boolean; /** * True if this entity is managed as a Professional Employment Organization. */ is_peo?: boolean; /** * The legal name of the entity. */ legal_name?: string; /** * The mailing address of the entity. */ mailing_address?: Shared.Address; /** * The entity management type. _ `EOR`: The entity is managed as an Employer of * Record. _ `COR`: The entity is managed as a Contractor of Record. _ `PEO`: The * entity is managed as a Professional Employment Organization. _ `null`: The * entity is a direct hire with no managed employment type. */ management_type?: 'PEO' | 'EOR' | 'COR'; /** * The physical address of the entity, if it differs from the mailing address. */ physical_address?: Shared.Address; /** * The registration date of the entity. */ registration_date?: string; /** * The tax identifier for this entity. */ tax_identifier?: string; } export interface CompanyLegalEntityListParams { 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 CompanyLegalEntities { export { type CompanyLegalEntityListResponse as CompanyLegalEntityListResponse, type CompanyLegalEntityRetrieveResponse as CompanyLegalEntityRetrieveResponse, type CompanyLegalEntityListResponsesPageCursorURL as CompanyLegalEntityListResponsesPageCursorURL, type CompanyLegalEntityListParams as CompanyLegalEntityListParams, }; }