// 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 WorkersAPI from './workers'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Compensation associated with workers */ export class Compensations extends APIResource { /** * Paginates through the compensation the authenticated user has access to. * * - Requires: `API Tier 1` * - Expandable fields: `worker` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /compensations/?expand=expand&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", * "worker_id": "string", * "worker": { * "id": "string", * "created_at": "string", * "updated_at": "string", * "user_id": "string", * "user": {}, * "is_manager": "string", * "manager_id": "string", * "manager": {}, * "legal_entity_id": "string", * "legal_entity": {}, * "country": "AF", * "start_date": "string", * "end_date": "string", * "number": "string", * "work_email": "string", * "personal_email": "string", * "status": "INIT", * "location": {}, * "employment_type_id": "string", * "employment_type": {}, * "gender": "MALE", * "date_of_birth": "string", * "race": "BLACK", * "ethnicity": "HISPANIC_OR_LATINO", * "citizenship": "AF", * "compensation_id": "string", * "compensation": {}, * "overtime_exemption": "EXEMPT", * "department_id": "string", * "department": {}, * "teams_id": [], * "teams": [], * "title": "string", * "title_effective_date": "string", * "level_id": "string", * "level": {}, * "job_function_id": "string", * "job_function": {}, * "termination_details": {}, * "pay_schedule_id": "string", * "work_schedule": {}, * "compensation_grade": {}, * "original_start_date": "string", * "custom_fields": [], * "country_fields": {}, * "business_partners_id": [], * "business_partners": [] * }, * "annual_compensation": { * "currency_type": "string", * "value": "string" * }, * "annual_salary_equivalent": { * "currency_type": "string", * "value": "string" * }, * "hourly_wage": { * "currency_type": "string", * "value": "string" * }, * "monthly_compensation": { * "currency_type": "string", * "value": "string" * }, * "on_target_commission": { * "currency_type": "string", * "value": "string" * }, * "relocation_reimbursement": { * "currency_type": "string", * "value": "string" * }, * "signing_bonus": { * "currency_type": "string", * "value": "string" * }, * "target_annual_bonus": { * "currency_type": "string", * "value": "string" * }, * "weekly_compensation": { * "currency_type": "string", * "value": "string" * }, * "target_annual_bonus_percent": 0, * "bonus_schedule": "string", * "payment_type": "string", * "payment_terms": "string", * "salary_effective_date": "string" * } * ], * "next_link": "string" * } * ``` */ list( query: CompensationListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/compensations/', PageCursorURL, { query, ...options }); } /** * Retrieves the Compensation for the Worker with the ID provided in the URL path. * * @example HTTP * Representative request and response shapes. * ``` * GET /compensations/{id}/?expand=expand 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, query: CompensationRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get(path`/compensations/${id}/`, { query, ...options }); } } export type CompensationsPageCursorURL = PageCursorURL; export interface Compensation { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The worker's annual compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ annual_compensation?: Compensation.AnnualCompensation; /** * The worker's annual salary equivalent, for insurance purposes. It will be equal * to the worker's annual compensation, except for owners that are receiving no * cashcompensation. */ annual_salary_equivalent?: Compensation.AnnualSalaryEquivalent; /** * The worker's bonus schedule. */ bonus_schedule?: string; /** * The worker's hourly wage. This calculation assumes 40-hour work weeks for * workers with fixed compensation. */ hourly_wage?: Compensation.HourlyWage; /** * The worker's monthly compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ monthly_compensation?: Compensation.MonthlyCompensation; /** * The worker's on-target commission. */ on_target_commission?: Compensation.OnTargetCommission; /** * The payment terms for an worker's compensation. */ payment_terms?: string; /** * The payment type for an worker's compensation. */ payment_type?: string; /** * The worker's hourly wage. This calculation assumes 40-hour work weeks for * workers with fixed compensation. */ relocation_reimbursement?: Compensation.RelocationReimbursement; /** * Salary effective date */ salary_effective_date?: string; /** * The worker's signing bonus. */ signing_bonus?: Compensation.SigningBonus; /** * The worker's target annual bonus amount. */ target_annual_bonus?: Compensation.TargetAnnualBonus; /** * The worker's target annual bonus as a percent of annual compensation. */ target_annual_bonus_percent?: number; /** * The worker's weekly compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ weekly_compensation?: Compensation.WeeklyCompensation; /** * The worker's details. * * Expandable field */ worker?: WorkersAPI.Worker; /** * The worker's ID. */ worker_id?: string; } export namespace Compensation { /** * The worker's annual compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ export interface AnnualCompensation { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's annual salary equivalent, for insurance purposes. It will be equal * to the worker's annual compensation, except for owners that are receiving no * cashcompensation. */ export interface AnnualSalaryEquivalent { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's hourly wage. This calculation assumes 40-hour work weeks for * workers with fixed compensation. */ export interface HourlyWage { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's monthly compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ export interface MonthlyCompensation { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's on-target commission. */ export interface OnTargetCommission { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's hourly wage. This calculation assumes 40-hour work weeks for * workers with fixed compensation. */ export interface RelocationReimbursement { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's signing bonus. */ export interface SigningBonus { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's target annual bonus amount. */ export interface TargetAnnualBonus { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } /** * The worker's weekly compensation. This calculation assumes 40-hour work weeks * for workers with an hourly wage. */ export interface WeeklyCompensation { /** * The currency type, ex: USD, EUR, etc. */ currency_type?: string; /** * The decimal amount for the currency. */ value?: number; } } /** * Meta information for the response. */ export interface CompensationRetrieveResponse extends BusinessPartnersAPI.Meta, Compensation {} export interface CompensationListParams { cursor?: string; expand?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } export interface CompensationRetrieveParams { expand?: string; } export declare namespace Compensations { export { type Compensation as Compensation, type CompensationRetrieveResponse as CompensationRetrieveResponse, type CompensationsPageCursorURL as CompensationsPageCursorURL, type CompensationListParams as CompensationListParams, type CompensationRetrieveParams as CompensationRetrieveParams, }; }