// 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'; /** * Compensation associated with workers */ export class VariableCompensationPayoutLabels extends APIResource { /** * List payout source and group labels. Paginated with limit and cursor. Filters * use the documented query parameters only (not OData filter). * * - Requires: `Variable Compensation Scheduled Payouts API` * * @example HTTP * Representative request and response shapes. * ``` * GET /variable-compensation-payout-labels/?limit=0&cursor=cursor&client=client&external_id=external_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": [ * { * "name": "date_of_birth", * "reason": "Insufficient entitlements" * } * ] * }, * "results": [ * { * "id": "string", * "client": "string", * "external_id": "string", * "name": "string" * } * ], * "next_link": "string" * } * ``` */ list( query: VariableCompensationPayoutLabelListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise< VariableCompensationPayoutLabelListResponsesPageCursorURL, VariableCompensationPayoutLabelListResponse > { return this._client.getAPIList( '/variable-compensation-payout-labels/', PageCursorURL, { query, ...options }, ); } /** * Get or create a source or group label. Identity is (client, external_id). New * identities return 201; an existing match returns 200. * * @example HTTP * Representative request and response shapes. * ``` * POST /variable-compensation-payout-labels/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "client": "client", * "external_id": "external_id", * "name": "name" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "client": "string", * "external_id": "string", * "name": "string" * } * ``` */ create( body: VariableCompensationPayoutLabelCreateParams, options?: RequestOptions, ): APIPromise { return this._client.post('/variable-compensation-payout-labels/', { body, ...options }); } /** * Retrieve a specific payout source or group label. * * @example HTTP * Representative request and response shapes. * ``` * GET /variable-compensation-payout-labels/{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`/variable-compensation-payout-labels/${id}/`, options); } /** * Update a specific variable compensation payout label. * * @example HTTP * Representative request and response shapes. * ``` * PATCH /variable-compensation-payout-labels/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * { * "client": "client", * "external_id": "external_id", * "name": "name" * } * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "client": "string", * "external_id": "string", * "name": "string" * } * ``` */ update( id: string, body: VariableCompensationPayoutLabelUpdateParams, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/variable-compensation-payout-labels/${id}/`, { body, ...options }); } } export type VariableCompensationPayoutLabelListResponsesPageCursorURL = PageCursorURL; export interface VariableCompensationPayoutLabelListResponse { /** * Unique identifier of the payout label. */ id: string; /** * Client system that created the label. */ client: string; /** * External identifier unique per company and client. */ external_id: string; /** * Display name of the label. */ name: string; } export interface VariableCompensationPayoutLabelCreateResponse { /** * Unique identifier of the payout label. */ id: string; /** * Client system that created the label. */ client: string; /** * External identifier unique per company and client. */ external_id: string; /** * Display name of the label. */ name: string; } /** * Meta information for the response. */ export interface VariableCompensationPayoutLabelRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Unique identifier of the payout label. */ id: string; /** * Client system that created the label. */ client: string; /** * External identifier unique per company and client. */ external_id: string; /** * Display name of the label. */ name: string; } export interface VariableCompensationPayoutLabelUpdateResponse { /** * Unique identifier of the payout label. */ id: string; /** * Client system that created the label. */ client: string; /** * External identifier unique per company and client. */ external_id: string; /** * Display name of the label. */ name: string; } export interface VariableCompensationPayoutLabelListParams { /** * Client system that created the label. */ client?: string; /** * Opaque pagination cursor from the previous page's next_link. */ cursor?: string; /** * External identifier unique per company and client. */ external_id?: string; /** * Page size. Defaults to 50. Maximum 100. */ limit?: number; } export interface VariableCompensationPayoutLabelCreateParams { /** * Client system that created the label. */ client: string; /** * External identifier unique per company and client. */ external_id: string; /** * Display name of the label. */ name: string; } export interface VariableCompensationPayoutLabelUpdateParams { /** * Client system that created the label. */ client: string; /** * External identifier unique per company and client. */ external_id: string; /** * Display name of the label. */ name: string; } export declare namespace VariableCompensationPayoutLabels { export { type VariableCompensationPayoutLabelListResponse as VariableCompensationPayoutLabelListResponse, type VariableCompensationPayoutLabelCreateResponse as VariableCompensationPayoutLabelCreateResponse, type VariableCompensationPayoutLabelRetrieveResponse as VariableCompensationPayoutLabelRetrieveResponse, type VariableCompensationPayoutLabelUpdateResponse as VariableCompensationPayoutLabelUpdateResponse, type VariableCompensationPayoutLabelListResponsesPageCursorURL as VariableCompensationPayoutLabelListResponsesPageCursorURL, type VariableCompensationPayoutLabelListParams as VariableCompensationPayoutLabelListParams, type VariableCompensationPayoutLabelCreateParams as VariableCompensationPayoutLabelCreateParams, type VariableCompensationPayoutLabelUpdateParams as VariableCompensationPayoutLabelUpdateParams, }; }