public LatteShareUserInformation?GetUserInformation() { try { var request = new RestRequest("/user", Method.GET); request.AddParameter("apiKey", apiKey); IRestResponse <LatteShareUserInformationResponse> response = client.Execute <LatteShareUserInformationResponse>(request); if (response.Data.success) { var userInfo = new LatteShareUserInformation(); userInfo.username = (String)response.Data.data["username"]; userInfo.group = (String)response.Data.data["group"]; userInfo.quota = (long)response.Data.data["quota"]; userInfo.usedDiskSpace = (long)response.Data.data["usedDiskSpace"]; return(userInfo); } return(null); } catch { return(null); } }
public LatteShareUserInformation? GetUserInformation() { try { var request = new RestRequest("/user", Method.GET); request.AddParameter("apiKey", apiKey); IRestResponse<LatteShareUserInformationResponse> response = client.Execute<LatteShareUserInformationResponse>(request); if (response.Data.success) { var userInfo = new LatteShareUserInformation(); userInfo.username = (String)response.Data.data["username"]; userInfo.group = (String)response.Data.data["group"]; userInfo.quota = (long)response.Data.data["quota"]; userInfo.usedDiskSpace = (long)response.Data.data["usedDiskSpace"]; return userInfo; } return null; } catch { return null; } }