Esempio n. 1
0
        public async Task <AiurValue <KahlaUser> > MeAsync()
        {
            var url    = new AiurUrl(_kahlaLocation.ToString(), "Auth", "Me", new { });
            var result = await _http.Get(url);

            var jResult = JsonConvert.DeserializeObject <AiurValue <KahlaUser> >(result);

            if (jResult.Code != ErrorType.Success)
            {
                throw new AiurUnexpectedResponse(jResult);
            }
            return(jResult);
        }
Esempio n. 2
0
        public async Task <MineViewModel> MineAsync()
        {
            var url    = new AiurUrl(_kahlaLocation.ToString(), "Friendship", "Mine", new { });
            var result = await _http.Get(url);

            var jsonResult = JsonConvert.DeserializeObject <MineViewModel>(result);

            if (jsonResult.Code != ErrorType.Success)
            {
                throw new AiurUnexpectedResponse(jsonResult);
            }

            return(jsonResult);
        }
Esempio n. 3
0
        public async Task <AiurCollection <ContactInfo> > AllAsync()
        {
            var url = new AiurUrl(_kahlaLocation.ToString(), "Conversation", "All", new
            {
            });
            var result = await _http.Get(url);

            var jsonResult = JsonConvert.DeserializeObject <AiurCollection <ContactInfo> >(result);

            if (jsonResult.Code != ErrorType.Success)
            {
                throw new AiurUnexpectedResponse(jsonResult);
            }
            return(jsonResult);
        }
Esempio n. 4
0
        public async Task <IndexViewModel> IndexAsync()
        {
            var url    = new AiurUrl(_kahlaLocation.ToString(), "Home", "Index", new { });
            var result = await _http.Get(url);

            var JResult = JsonConvert.DeserializeObject <IndexViewModel>(result);

            if (JResult.Code != ErrorType.Success)
            {
                throw new AiurUnexceptedResponse(JResult);
            }
            return(JResult);
        }
Esempio n. 5
0
        public async Task <AiurCollection <Request> > MyRequestsAsync()
        {
            var url    = new AiurUrl(_kahlaLocation.ToString(), "Friendship", "MyRequests", new { });
            var result = await _http.Get(url);

            var jsonResult = JsonConvert.DeserializeObject <AiurCollection <Request> >(result);

            if (jsonResult.Code != ErrorType.Success)
            {
                throw new AiurUnexceptedResponse(jsonResult);
            }

            return(jsonResult);
        }
Esempio n. 6
0
        public async Task <AiurValue <SearchedGroup> > GroupSummaryAsync(int groupId)
        {
            var url = new AiurUrl(_kahlaLocation.ToString(), "Groups", "GroupSummary", new
            {
                id = groupId
            });
            var result = await _http.Get(url);

            var jResult = JsonConvert.DeserializeObject <AiurValue <SearchedGroup> >(result);

            if (jResult.Code != ErrorType.Success)
            {
                throw new AiurUnexpectedResponse(jResult);
            }
            return(jResult);
        }
Esempio n. 7
0
        public async Task <InitFileAccessViewModel> InitFileAccessAsync(int conversationId, bool canUpload, bool canDownload)
        {
            var url = new AiurUrl(_kahlaLocation.ToString(), "Storage", "InitFileAccess", new InitFileAccessAddressModel
            {
                ConversationId = conversationId,
                Upload         = canUpload,
                Download       = canDownload
            });
            var result = await Http.Get(url);

            var jResult = JsonConvert.DeserializeObject <InitFileAccessViewModel>(result);

            if (jResult.Code != ErrorType.Success)
            {
                throw new AiurUnexpectedResponse(jResult);
            }
            return(jResult);
        }