export type UserSettingListResults<T> = Record<UserSettingKey, UserSettingBody<T>>;

export type UserSettingKey = UserSetting<object>['path'];
export type UserSettingBody<T> = Required<Omit<UserSetting<T>, 'path'>>;
export type UpsertUserSetting<T> = Omit<UserSetting<T>, 'lastModified'>;
export type DeleteUserSetting = Required<Pick<UserSetting<object>, 'etag' | 'path'>>;
export interface UserSetting<T> {
    /**
     * Etag of retrived setting. When updating or delelting, this must match the value
     */
    etag?: string;
    /**
     * Slash separated path to setting
     */
    path: string;
    /**
     * Date last modified
     */
    lastModified: Date;
    /**
     * The actual setting
     */
    value: T;
}
