/// <summary> /// 异步设置对应 <see cref="Session"/> 实例的 Websocket /// </summary> /// <param name="enabled">是否启用</param> private async Task SetWebsocketAsync(bool enabled) => (await ApiMethods.ConfigAsync(Session.Settings.HttpUri, Session.SessionKey, enabled)).CheckError();
/// <summary> /// 异步获取对应 <see cref="Session"/> 实例的 API 配置 /// </summary> public async Task <ApiConfig> GetApiConfigAsync() => JsonConvert.DeserializeObject <ApiConfig>(await ApiMethods.GetConfigAsync(Session.Settings.HttpUri, Session.SessionKey));
/// <summary> /// 异步设置对应 <see cref="Session"/> 实例的缓存大小 /// </summary> /// <param name="size">缓存大小</param> public async Task SetCacheSizeAsync(int size) => (await ApiMethods.ConfigAsync(Session.Settings.HttpUri, Session.SessionKey, size)).CheckError();
/// <summary> /// 异步获取 API 信息 /// </summary> public async Task <ApiInfo> GetApiInfoAsync() => JObject.Parse((await ApiMethods.GetAboutAsync(Session.Settings.HttpUri)).CheckError())["data"].ToObject <ApiInfo>();