// 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 { buildHeaders } from '../internal/headers'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; export class CustomPages extends APIResource { /** * A list of CustomPage. * * - Requires: `Custom Apps Platform API` * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-pages/ 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", * "name": "string", * "function_id": "string", * "created_by": "string", * "updated_by": "string", * "created_at": "string", * "updated_at": "string" * } * ], * "next_link": "string" * } * ``` */ list(options?: RequestOptions): PagePromise { return this._client.getAPIList('/custom-pages/', PageCursorURL, options); } /** * Create a new CustomPage * * @example HTTP * Representative request and response shapes. * ``` * POST /custom-pages/ 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", * "name": "string", * "function_id": "string", * "created_by": "string", * "updated_by": "string", * "created_at": "string", * "updated_at": "string" * } * ``` */ create( body: CustomPageCreateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.post('/custom-pages/', { body, ...options }); } /** * Retrieve a specific CustomPage * * @example HTTP * Representative request and response shapes. * ``` * GET /custom-pages/{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`/custom-pages/${id}/`, options); } /** * Update a specific CustomPage. * * @example HTTP * Representative request and response shapes. * ``` * PATCH /custom-pages/{id}/ 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", * "name": "string", * "function_id": "string", * "created_by": "string", * "updated_by": "string", * "created_at": "string", * "updated_at": "string" * } * ``` */ update( id: string, body: CustomPageUpdateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/custom-pages/${id}/`, { body, ...options }); } /** * Delete a CustomPage * * @example HTTP * Representative request and response shapes. * ``` * DELETE /custom-pages/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 204 No Content * ``` */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/custom-pages/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type CustomPageListResponsesPageCursorURL = PageCursorURL; export interface CustomPageListResponse { /** * Identifier field */ id?: string; /** * Record creation date */ created_at?: string; /** * The ID of the role that created the page */ created_by?: string; /** * The ID of the Rippling Function that renders this page */ function_id?: string; /** * The display name of the custom page */ name?: string; /** * Record update date */ updated_at?: string; /** * The ID of the role that last modified the page */ updated_by?: string; } export interface CustomPageCreateResponse { /** * Identifier field */ id?: string; /** * Record creation date */ created_at?: string; /** * The ID of the role that created the page */ created_by?: string; /** * The ID of the Rippling Function that renders this page */ function_id?: string; /** * The display name of the custom page */ name?: string; /** * Record update date */ updated_at?: string; /** * The ID of the role that last modified the page */ updated_by?: string; } /** * Meta information for the response. */ export interface CustomPageRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id?: string; /** * Record creation date */ created_at?: string; /** * The ID of the role that created the page */ created_by?: string; /** * The ID of the Rippling Function that renders this page */ function_id?: string; /** * The display name of the custom page */ name?: string; /** * Record update date */ updated_at?: string; /** * The ID of the role that last modified the page */ updated_by?: string; } export interface CustomPageUpdateResponse { /** * Identifier field */ id?: string; /** * Record creation date */ created_at?: string; /** * The ID of the role that created the page */ created_by?: string; /** * The ID of the Rippling Function that renders this page */ function_id?: string; /** * The display name of the custom page */ name?: string; /** * Record update date */ updated_at?: string; /** * The ID of the role that last modified the page */ updated_by?: string; } export interface CustomPageCreateParams { /** * The ID of the Rippling Function that renders this page */ function_id?: string; /** * The display name of the custom page */ name?: string; } export interface CustomPageUpdateParams { /** * The ID of the Rippling Function that renders this page */ function_id?: string; /** * The display name of the custom page */ name?: string; } export declare namespace CustomPages { export { type CustomPageListResponse as CustomPageListResponse, type CustomPageCreateResponse as CustomPageCreateResponse, type CustomPageRetrieveResponse as CustomPageRetrieveResponse, type CustomPageUpdateResponse as CustomPageUpdateResponse, type CustomPageListResponsesPageCursorURL as CustomPageListResponsesPageCursorURL, type CustomPageCreateParams as CustomPageCreateParams, type CustomPageUpdateParams as CustomPageUpdateParams, }; }