# Interface UserSettingApCLient

API for managing user specific settings

interface UserSettingApCLient {
delete(deleteUserSetting: DeleteUserSetting): Promise<Response>;
get<T>(
path: string,
maxLevels?: number,
): Promise<TypedResponse<UserSettingListResults<T>>>;
upsert<T>(upsertUserSetting: UpsertUserSetting<T>): Promise<Response>;
}

##### Index

### Methods

delete
get
upsert

## Methods

### delete

- delete(deleteUserSetting: DeleteUserSetting): Promise<Response>

  Deletes the setting at the given path. An up-to-date etag must be provided in order to prevent concurrency issues

  #### Parameters

  - deleteUserSetting: DeleteUserSetting

    The setting to delete

  #### Returns Promise<Response>

### get

- get<T>(
  path: string,
  maxLevels?: number,
  ): Promise<TypedResponse<UserSettingListResults<T>>>

  Looks for settings belonging to the current user, starting at path, and then recursively down the hierarchy.

  Example: There are settings at a a/b a/b/c

  path = 'a', maxLevels = 0 will return the setting at 'a' path = 'a', maxLevels = 1 will return the settings at 'a' and 'a/b' path = 'a', maxLevels = 2 will return the settings at 'a', 'a/b', 'a/b/c' path = 'a/b', maxLevels = 1 will return the settings at 'a/b' and 'a/b/c' path = 'b' will not return any setting

  #### Type Parameters

  - T

  #### Parameters

  - path: string

    Slash separated path to setting

  - `Optional` maxLevels: number

    Maximum recursion level when traversing the setting hierarchy. Default = 0 (current level)

  #### Returns Promise<TypedResponse<UserSettingListResults<T>>>

### upsert

- upsert<T>(upsertUserSetting: UpsertUserSetting<T>): Promise<Response>

  Set the setting at the given path. If a setting already exists at the given path, an up-to-date etag must be provided in order to prevent concurrency issues

  #### Type Parameters

  - T

  #### Parameters

  - upsertUserSetting: UpsertUserSetting<T>

    The setting to upsert

  #### Returns Promise<Response>