import { APIResource } from "../../core/resource.js"; import { APIPromise } from "../../core/api-promise.js"; import { PageCursorURL, PagePromise } from "../../core/pagination.js"; import { RequestOptions } from "../../internal/request-options.js"; /** * Custom object fields defined by the company */ export declare class Fields extends APIResource { /** * A list of custom object fields. * * - Requires: `API Tier 1` * * @example SDK usage * ```ts * // Automatically fetches more pages as needed. * for await (const customObjectField of client.customObjects.fields.list( * 'custom_object_api_name', * )) { * // ... * } * ``` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-objects/{custom_object_api_name}/fields/?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 * * { * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "custom_object": "string", * "description": "string", * "api_name": "string", * "data_type": { * "num_of_decimal_places": "string" * }, * "is_unique": false, * "is_immutable": false, * "is_standard": false, * "managed_package_install_id": "string", * "enable_history": false * } * ], * "next_link": "string" * } * ``` */ list(customObjectAPIName: string, query?: FieldListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Create a new custom object field. * * @example SDK usage * ```ts * const customObjectField = * await client.customObjects.fields.create( * 'custom_object_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * POST /custom-objects/{custom_object_api_name}/fields/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "custom_object": "string", * "description": "string", * "api_name": "string", * "data_type": { * "num_of_decimal_places": 0 * }, * "is_unique": false, * "is_immutable": false, * "is_standard": false, * "managed_package_install_id": "string", * "enable_history": false * } * ``` */ create(customObjectAPIName: string, body?: FieldCreateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Retrieve a specific custom object field. * * @example SDK usage * ```ts * const customObjectField = * await client.customObjects.fields.retrieve( * 'custom_object_api_name', * 'field_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-objects/{custom_object_api_name}/fields/{field_api_name}/ 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 * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "custom_object": "string", * "description": "string", * "api_name": "string", * "data_type": { * "num_of_decimal_places": 0 * }, * "is_unique": false, * "is_immutable": false, * "is_standard": false, * "managed_package_install_id": "string", * "enable_history": false * } * ``` */ retrieve(customObjectAPIName: string, fieldAPIName: string, options?: RequestOptions): APIPromise; /** * Update a specific custom object field. * * @example SDK usage * ```ts * const customObjectField = * await client.customObjects.fields.update( * 'custom_object_api_name', * 'field_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * PATCH /custom-objects/{custom_object_api_name}/fields/{field_api_name}/ HTTP/1.1 * Host: rest.ripplingapis.com * Content-Type: application/json * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * {} * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "custom_object": "string", * "description": "string", * "api_name": "string", * "data_type": { * "num_of_decimal_places": 0 * }, * "is_unique": false, * "is_immutable": false, * "is_standard": false, * "managed_package_install_id": "string", * "enable_history": false * } * ``` */ update(customObjectAPIName: string, fieldAPIName: string, body?: FieldUpdateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Delete a custom object field. * * @example SDK usage * ```ts * await client.customObjects.fields.delete( * 'custom_object_api_name', * 'field_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * DELETE /custom-objects/{custom_object_api_name}/fields/{field_api_name}/ HTTP/1.1 * Host: rest.ripplingapis.com * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 204 No Content * ``` */ delete(customObjectAPIName: string, fieldAPIName: string, options?: RequestOptions): APIPromise; } export type CustomObjectFieldsPageCursorURL = PageCursorURL; export interface FieldListParams { cursor?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; } /** Supported wire-level field-type identifiers for custom-object fields. */ export type CustomObjectFieldType = 'TEXT' | 'LONG_TEXT' | 'EMAIL' | 'URL' | 'PHONE_NUMBER' | 'NUMBER' | 'CURRENCY' | 'PERCENTAGE' | 'DATE' | 'DATETIME' | 'TIME' | 'SELECT' | 'RADIO' | 'BOOLEAN' | 'FILE' | 'OG_REFERENCE_FIELD'; /** Structured `data_type` payload for text fields. */ export interface TextCustomObjectFieldDataType { field_type: 'TEXT'; max_length?: number; } /** Structured `data_type` payload for long-text fields. */ export interface LongTextCustomObjectFieldDataType { field_type: 'LONG_TEXT'; max_length?: number; } /** Structured `data_type` payload for email fields. */ export interface EmailCustomObjectFieldDataType { field_type: 'EMAIL'; } /** Structured `data_type` payload for URL fields. */ export interface URLCustomObjectFieldDataType { field_type: 'URL'; } /** Structured `data_type` payload for phone-number fields. */ export interface PhoneNumberCustomObjectFieldDataType { field_type: 'PHONE_NUMBER'; } /** Structured `data_type` payload for numeric fields. */ export interface NumberCustomObjectFieldDataType { field_type: 'NUMBER'; num_of_decimal_places?: number; } /** Structured `data_type` payload for currency fields. */ export interface CurrencyCustomObjectFieldDataType { field_type: 'CURRENCY'; currency?: string; num_of_decimal_places?: number; } /** Structured `data_type` payload for percentage fields. */ export interface PercentageCustomObjectFieldDataType { field_type: 'PERCENTAGE'; num_of_decimal_places?: number; } /** Structured `data_type` payload for date fields. */ export interface DateCustomObjectFieldDataType { field_type: 'DATE'; } /** Structured `data_type` payload for date-time fields. */ export interface DatetimeCustomObjectFieldDataType { field_type: 'DATETIME'; } /** Structured `data_type` payload for time-of-day fields. */ export interface TimeCustomObjectFieldDataType { field_type: 'TIME'; } /** Structured `data_type` payload for choice fields. */ export interface ChoiceCustomObjectFieldDataType { field_type: 'SELECT' | 'RADIO'; options_list: string[]; } /** Structured `data_type` payload for boolean fields. */ export interface BooleanCustomObjectFieldDataType { field_type: 'BOOLEAN'; } /** Structured `data_type` payload for file fields. */ export interface FileCustomObjectFieldDataType { field_type: 'FILE'; supported_types?: string[]; } /** Structured `data_type` payload for relationship fields. */ export interface ReferenceCustomObjectFieldDataType { field_type: 'OG_REFERENCE_FIELD'; og_model_rql_name: string; edge_type?: 'LOOKUP' | 'PARENT_CHILD'; related_data_label?: string; lookup_filter_rql_condition?: string; parent_child_type?: 'PRIMARY' | 'SECONDARY'; enable_parent_owner_inheritance?: boolean; } /** Typed `data_type` union for custom-object field create/update payloads. */ export type CustomObjectFieldDataType = TextCustomObjectFieldDataType | LongTextCustomObjectFieldDataType | EmailCustomObjectFieldDataType | URLCustomObjectFieldDataType | PhoneNumberCustomObjectFieldDataType | NumberCustomObjectFieldDataType | CurrencyCustomObjectFieldDataType | PercentageCustomObjectFieldDataType | DateCustomObjectFieldDataType | DatetimeCustomObjectFieldDataType | TimeCustomObjectFieldDataType | ChoiceCustomObjectFieldDataType | BooleanCustomObjectFieldDataType | FileCustomObjectFieldDataType | ReferenceCustomObjectFieldDataType; /** Filter entry accepted by derived aggregated field metadata. */ export interface CustomObjectFieldDerivedAggregationFilter { field_name: string; filter_value: string; operator: string; } /** Structured payload for derived aggregated field metadata. */ export interface CustomObjectFieldDerivedAggregatedField { aggregation_function?: string; child_model_name?: string; currency_code?: string | null; field_to_aggregate?: string; filters?: CustomObjectFieldDerivedAggregationFilter[]; lookup_field_api_name?: string; [key: string]: unknown; } /** Formula attribute metadata accepted by field create/update APIs. */ export type CustomObjectFieldFormulaAttrMetas = Record; /** Computed-field RQL definition metadata accepted by field create/update APIs. */ export type CustomObjectFieldRqlDefinition = Record; /** Legacy object-shaped field-section payload surfaced by the generated schema. */ export interface CustomObjectFieldSectionConfig { name?: string; section_id?: string; [key: string]: unknown; } /** Field-section value accepted by the custom-object field APIs. */ export type CustomObjectFieldSection = string | CustomObjectFieldSectionConfig; /** Name-field display / autonumber metadata accepted by field update APIs. */ export interface CustomObjectNameFieldDetails { is_autonumber_field?: boolean; autonumber_format?: string; starting_number?: number; [key: string]: unknown; } /** Public custom-object field DTO returned by the REST API. */ export interface CustomObjectField { /** * Identifier field */ id: string; /** * The api name of the custom object field */ api_name: string; /** * Record creation date */ created_at: string; /** * The custom object which the field belongs to */ custom_object: string; /** * The field type */ data_type: CustomObjectFieldDataType | Record; /** * whether the history is enable for the field */ enable_history: boolean; /** * whether the field is imuatable */ is_immutable: boolean; /** * whether the field is standard field */ is_standard: boolean; /** * This field specifies whether a particular column value has unique values */ is_unique: boolean; /** * The name of the custom object field */ name: string; /** * Record update date */ updated_at: string; /** * The description of the custom object field */ description?: string; /** * The id of the package which the custom object field belongs to */ managed_package_install_id?: string; } /** Request payload accepted by `client.customObjects.fields.create(...)`. */ export interface FieldCreateParams { /** * The data type configuration for the field. */ data_type?: CustomObjectFieldDataType | Record; /** * Configuration for derived aggregated fields. */ derived_aggregated_field?: CustomObjectFieldDerivedAggregatedField; /** * The formula for derived fields. */ derived_field_formula?: string; /** * A description of the field. */ description?: string; /** * Whether to track history for this field. */ enable_history?: boolean; /** * Metadata for formula attributes. */ formula_attr_metas?: CustomObjectFieldFormulaAttrMetas; /** * Whether field values must be unique. */ is_unique?: boolean; /** * The name of the field. */ name?: string; /** * Whether this field is required. */ required?: boolean; /** * The RQL definition for computed fields. */ rql_definition?: CustomObjectFieldRqlDefinition; /** * The section identifier or section configuration for the field. */ section?: CustomObjectFieldSection; } /** Request payload accepted by `client.customObjects.fields.update(...)`. */ export interface FieldUpdateParams { /** * The data type configuration for the field. */ data_type?: CustomObjectFieldDataType | Record; /** * The formula for derived fields. */ derived_field_formula?: string; /** * A description of the field. */ description?: string; /** * Whether to track history for this field. */ enable_history?: boolean; /** * Metadata for formula attributes. */ formula_attr_metas?: CustomObjectFieldFormulaAttrMetas; /** * Whether field values must be unique. */ is_unique?: boolean; /** * The name of the field. */ name?: string; /** * Configuration for name field display. */ name_field_details?: CustomObjectNameFieldDetails; /** * Whether this field is required. */ required?: boolean; /** * The RQL definition for computed fields. */ rql_definition?: CustomObjectFieldRqlDefinition; /** * The section identifier or section configuration for the field. */ section?: CustomObjectFieldSection; } export declare namespace Fields { export { type CustomObjectFieldType as CustomObjectFieldType, type CustomObjectFieldDataType as CustomObjectFieldDataType, type CustomObjectFieldDerivedAggregationFilter as CustomObjectFieldDerivedAggregationFilter, type CustomObjectFieldDerivedAggregatedField as CustomObjectFieldDerivedAggregatedField, type CustomObjectFieldFormulaAttrMetas as CustomObjectFieldFormulaAttrMetas, type CustomObjectFieldRqlDefinition as CustomObjectFieldRqlDefinition, type CustomObjectFieldSectionConfig as CustomObjectFieldSectionConfig, type CustomObjectFieldSection as CustomObjectFieldSection, type CustomObjectNameFieldDetails as CustomObjectNameFieldDetails, type CustomObjectField as CustomObjectField, type CustomObjectFieldsPageCursorURL as CustomObjectFieldsPageCursorURL, type FieldListParams as FieldListParams, type FieldCreateParams as FieldCreateParams, type FieldUpdateParams as FieldUpdateParams, }; } //# sourceMappingURL=fields.d.ts.map