// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../core/resource'; import { APIPromise } from '../../../core/api-promise'; import { RequestOptions } from '../../../internal/request-options'; import { path } from '../../../internal/utils/path'; /** * Custom object datarows defined by the company */ export class Capabilities extends APIResource { /** * Check whether you can create a record in this Custom Object, including when it * has no records. If you can read the object but cannot create records, the * response is 200 with can_create:false and a reason. Creation still validates * submitted values, access, business rules and approval requirements. * * @example SDK usage * ```ts * const capabilities = * await client.customObjects.records.capabilities.list( * 'custom_object_api_name', * ); * ``` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-objects/{custom_object_api_name}/records/capabilities/ 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 * * { * "can_create": false, * "create_unavailable_reason": "TOKEN_WRITE_NOT_GRANTED" * } * ``` */ list(customObjectAPIName: string, options?: RequestOptions): APIPromise { return this._client.get(path`/custom-objects/${customObjectAPIName}/records/capabilities/`, options); } } /** * Whether new records can be created in this Custom Object. */ export interface CapabilityListResponse { /** * Whether you can attempt to create a record. Submitted values and business rules * are checked when creating it. */ can_create: boolean; /** * Why creation is unavailable: TOKEN_WRITE_NOT_GRANTED means your API credential * does not grant creation on this object; PERMISSION_DENIED means you do not have * write access; MANAGED_WRITE_RESTRICTED means creation is restricted to the * application managing the object. Null when can_create is true. */ create_unavailable_reason: | 'TOKEN_WRITE_NOT_GRANTED' | 'PERMISSION_DENIED' | 'MANAGED_WRITE_RESTRICTED' | null; } export declare namespace Capabilities { export { type CapabilityListResponse as CapabilityListResponse }; }