// 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 { buildHeaders } from '../../internal/headers'; import { RequestOptions } from '../../internal/request-options'; export class MemoryPreference extends APIResource { /** * Update user memory preference status. */ update( params: MemoryPreferenceUpdateParams, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat, ...body } = params; return this._client.put('/users/memory-preference', { body, ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } /** * Get user memory preference status. */ list( params: MemoryPreferenceListParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'If-None-Match': ifNoneMatch, 'X-Error-Format': xErrorFormat, } = params ?? {}; return this._client.get('/users/memory-preference', { ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(ifNoneMatch != null ? { 'If-None-Match': ifNoneMatch } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Response model for memory preference. * * Attributes: use_memory (bool): Whether memory is enabled for the user. */ export interface UserMemoryPreferenceResponse { /** * Whether memory is enabled for the user */ use_memory: boolean; } export interface MemoryPreferenceUpdateParams { /** * Body param: Whether to enable memory for the user */ use_memory: boolean; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface MemoryPreferenceListParams { 'Accept-Language'?: string; 'If-None-Match'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace MemoryPreference { export { type UserMemoryPreferenceResponse as UserMemoryPreferenceResponse, type MemoryPreferenceUpdateParams as MemoryPreferenceUpdateParams, type MemoryPreferenceListParams as MemoryPreferenceListParams, }; }