// 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'; import { path } from '../../internal/utils/path'; /** * Custom object datarows defined by the company */ export class RecordActions extends APIResource { /** * Lists callable native actions for this Custom Object. Execution remains * separately authorized. * * @example SDK usage * ```ts * // Automatically fetches more pages as needed. * for await (const recordActionListResponse of client.customObjects.recordActions.list( * 'custom_object_api_name', * )) { * // ... * } * ``` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-objects/{custom_object_api_name}/record-actions/?limit=100&cursor=cursor&visibility_preference=LIST_VIEW 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", * "api_name": "string", * "name": "string", * "function_api_name": "string", * "visibility_preferences": [ * "LIST_VIEW" * ] * } * ], * "next_link": "string" * } * ``` */ list( customObjectAPIName: string, query: RecordActionListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList( path`/custom-objects/${customObjectAPIName}/record-actions/`, PageCursorURL, { query, ...options }, ); } } export type RecordActionListResponsesPageCursorURL = PageCursorURL; /** * A configured action the caller can attempt through the existing Function * execution API. */ export interface RecordActionListResponse { /** * Stable native ObjectAction identifier. */ id: string; /** * Action API name; null for legacy actions. */ api_name: string | null; /** * Associated Function API name for the unchanged Function execution endpoints. * Discovery does not grant execution or execution-read permission. */ function_api_name: string; /** * Action display label. */ name: string; /** * Configured action placements: LIST_VIEW appears in an object grid; DETAIL_VIEW * appears on a record page. */ visibility_preferences: Array<'LIST_VIEW' | 'DETAIL_VIEW'>; } export interface RecordActionListParams { /** * Opaque cursor from the previous response next_link. */ cursor?: string; /** * Maximum number of authorized actions to return. Defaults to 100. */ limit?: number; /** * Match a configured placement: LIST_VIEW appears in an object grid; DETAIL_VIEW * appears on a record page. Omit to return all authorized actions for this object. */ visibility_preference?: 'LIST_VIEW' | 'DETAIL_VIEW'; } export declare namespace RecordActions { export { type RecordActionListResponse as RecordActionListResponse, type RecordActionListResponsesPageCursorURL as RecordActionListResponsesPageCursorURL, type RecordActionListParams as RecordActionListParams, }; }