// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; /** * Custom fields defined by the company */ export class CustomFields extends APIResource { /** * A list of custom fields. * * - Requires: `API Tier 1` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-fields/?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", * "name": "string", * "description": "string", * "required": false, * "type": "TEXT", * "options": [ * "string" * ] * } * ], * "next_link": "string" * } * ``` */ list( query: CustomFieldListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/custom-fields/', PageCursorURL, { query, ...options, }); } } export type CustomFieldListResponsesPageCursorURL = PageCursorURL; export interface CustomFieldListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * The name of the custom field. */ name: string; /** * The data type of the custom field. */ type: | 'TEXT' | 'DATE' | 'NUMBER' | 'CURRENCY' | 'PERCENTAGE' | 'SELECT' | 'FILE' | 'ID' | 'RADIO' | 'TEXTAREA' | 'RANGE' | 'REFERENCE_ID' | 'BOOLEAN' | 'ADDRESS' | 'OG_REFERENCE_FIELD' | 'NATIVE_EDGE' | 'DATETIME' | 'EMAIL' | 'URL'; /** * Record update date */ updated_at: string; /** * The description of the custom field. */ description?: string; /** * The available choice values for SELECT and RADIO custom fields. Null for other * field types. */ options?: Array; /** * Whether the custom field is required. */ required?: boolean; } export interface CustomFieldListParams { cursor?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } export declare namespace CustomFields { export { type CustomFieldListResponse as CustomFieldListResponse, type CustomFieldListResponsesPageCursorURL as CustomFieldListResponsesPageCursorURL, type CustomFieldListParams as CustomFieldListParams, }; }