// 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 CustomSettings extends APIResource { /** * A list of Setting. * * - Requires: `Functions API` * - Sortable fields: `id`, `created_at`, `updated_at` */ list( query: CustomSettingListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/custom-settings/', PageCursorURL, { query, ...options, }); } /** * Create a new Setting */ create( body: CustomSettingCreateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.post('/custom-settings/', { body, ...options }); } /** * Retrieve a specific Setting */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/custom-settings/${id}/`, options); } /** * Update a specific Setting. */ update( id: string, body: CustomSettingUpdateParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.patch(path`/custom-settings/${id}/`, { body, ...options }); } /** * Delete a Setting */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/custom-settings/${id}/`, { ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]), }); } } export type CustomSettingListResponsesPageCursorURL = PageCursorURL; export interface CustomSettingListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The unique api name of the setting */ api_name?: string; /** * Boolean value of the setting, if it has boolean data type */ boolean_value?: boolean; /** * Data type of the setting */ data_type?: string; /** * The display name of setting */ display_name?: string; /** * Number value of the setting, if it has number data type */ number_value?: number; /** * Secret value of the setting, if it has secret data type */ secret_value?: string; /** * String value of the setting, if it has string data type */ string_value?: string; } export interface CustomSettingCreateResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The unique api name of the setting */ api_name?: string; /** * Boolean value of the setting, if it has boolean data type */ boolean_value?: boolean; /** * Data type of the setting */ data_type?: string; /** * The display name of setting */ display_name?: string; /** * Number value of the setting, if it has number data type */ number_value?: number; /** * Secret value of the setting, if it has secret data type */ secret_value?: string; /** * String value of the setting, if it has string data type */ string_value?: string; } /** * Meta information for the response. */ export interface CustomSettingRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The unique api name of the setting */ api_name?: string; /** * Boolean value of the setting, if it has boolean data type */ boolean_value?: boolean; /** * Data type of the setting */ data_type?: string; /** * The display name of setting */ display_name?: string; /** * Number value of the setting, if it has number data type */ number_value?: number; /** * Secret value of the setting, if it has secret data type */ secret_value?: string; /** * String value of the setting, if it has string data type */ string_value?: string; } export interface CustomSettingUpdateResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * The unique api name of the setting */ api_name?: string; /** * Boolean value of the setting, if it has boolean data type */ boolean_value?: boolean; /** * Data type of the setting */ data_type?: string; /** * The display name of setting */ display_name?: string; /** * Number value of the setting, if it has number data type */ number_value?: number; /** * Secret value of the setting, if it has secret data type */ secret_value?: string; /** * String value of the setting, if it has string data type */ string_value?: string; } export interface CustomSettingListParams { cursor?: string; order_by?: string; } export interface CustomSettingCreateParams { /** * The unique api name of the setting */ api_name?: string; /** * Boolean value of the setting, if it has boolean data type */ boolean_value?: boolean; /** * Data type of the setting */ data_type?: string; /** * The display name of setting */ display_name?: string; /** * Number value of the setting, if it has number data type */ number_value?: number; /** * Secret value of the setting, if it has secret data type */ secret_value?: string; /** * String value of the setting, if it has string data type */ string_value?: string; } export interface CustomSettingUpdateParams { /** * The unique api name of the setting */ api_name?: string; /** * Boolean value of the setting, if it has boolean data type */ boolean_value?: boolean; /** * Data type of the setting */ data_type?: string; /** * The display name of setting */ display_name?: string; /** * Number value of the setting, if it has number data type */ number_value?: number; /** * Secret value of the setting, if it has secret data type */ secret_value?: string; /** * String value of the setting, if it has string data type */ string_value?: string; } export declare namespace CustomSettings { export { type CustomSettingListResponse as CustomSettingListResponse, type CustomSettingCreateResponse as CustomSettingCreateResponse, type CustomSettingRetrieveResponse as CustomSettingRetrieveResponse, type CustomSettingUpdateResponse as CustomSettingUpdateResponse, type CustomSettingListResponsesPageCursorURL as CustomSettingListResponsesPageCursorURL, type CustomSettingListParams as CustomSettingListParams, type CustomSettingCreateParams as CustomSettingCreateParams, type CustomSettingUpdateParams as CustomSettingUpdateParams, }; }