/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import { preferencesGetAllPreferences } from "../funcs/preferencesGetAllPreferences.js";
import { preferencesGetPreference } from "../funcs/preferencesGetPreference.js";
import { preferencesSetPreferences } from "../funcs/preferencesSetPreferences.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";

export class Preferences extends ClientSDK {
  /**
   * Get all preferences
   *
   * @remarks
   * Get the list of all preferences
   */
  async getAllPreferences(
    options?: RequestOptions,
  ): Promise<operations.GetAllPreferencesResponse> {
    return unwrapAsync(preferencesGetAllPreferences(
      this,
      options,
    ));
  }

  /**
   * Set preferences
   *
   * @remarks
   * Set a set of preferences in query parameters
   */
  async setPreferences(
    request: operations.SetPreferencesRequest,
    options?: RequestOptions,
  ): Promise<operations.SetPreferencesResponse> {
    return unwrapAsync(preferencesSetPreferences(
      this,
      request,
      options,
    ));
  }

  /**
   * Get a preferences
   *
   * @remarks
   * Get a single preference and value
   */
  async getPreference(
    request: operations.GetPreferenceRequest,
    options?: RequestOptions,
  ): Promise<operations.GetPreferenceResponse> {
    return unwrapAsync(preferencesGetPreference(
      this,
      request,
      options,
    ));
  }
}
