コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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;
            }
        }