Esempio n. 1
0
        private ImportSummary HandleResponse(Infrastructure.Http.Response response)
        {
            if (response.StatusCode == HttpStatusCode.OK)
            {
                return(_client.JsonMapper.From <SetupResponse>(response.Body).ImportSummary);
            }

            _client.HandleErrors(response);

            return(null);
        }
Esempio n. 2
0
 private Association HandleAssociationResponse(Infrastructure.Http.Response response)
 {
     if (response.StatusCode == HttpStatusCode.OK ||
         response.StatusCode == HttpStatusCode.Created ||
         response.StatusCode == HttpStatusCode.Accepted)
     {
         return(Client.JsonMapper.From <Association>(response.Body));
     }
     Client.HandleErrors(response);
     return(null);
 }
        private LinkedTransactionsResponse HandleResponse(Infrastructure.Http.Response response)
        {
            if (response.StatusCode == HttpStatusCode.OK)
            {
                var result = Client.JsonMapper.From <LinkedTransactionsResponse>(response.Body);
                return(result);
            }

            Client.HandleErrors(response);

            return(null);
        }
Esempio n. 4
0
        private TrackingCategoriesResponse HandleResponse(Infrastructure.Http.Response response)
        {
            if (response.StatusCode == HttpStatusCode.OK)
            {
                var result = Client.JsonMapper.From <TrackingCategoriesResponse>(response.Body);
                return(result);
            }

            Client.HandleErrors(response);

            return(null);
        }
Esempio n. 5
0
        private AllocationsResponse HandleResponse(Infrastructure.Http.Response response)
        {
            if (response.StatusCode == HttpStatusCode.OK)
            {
                var result = _client.JsonMapper.From <AllocationsResponse>(response.Body);
                return(result);
            }

            _client.HandleErrors(response);

            return(null);
        }
Esempio n. 6
0
        private FilesResponse HandleFileResponse(Infrastructure.Http.Response response)
        {
            if (response.StatusCode == HttpStatusCode.OK || response.StatusCode == HttpStatusCode.Created)
            {
                var result = Client.JsonMapper.From <FilesResponse>(response.Body);
                return(result);
            }

            Client.HandleErrors(response);

            return(null);
        }
Esempio n. 7
0
        private FoldersResponse[] HandleFoldersResponse(Infrastructure.Http.Response response)
        {
            if (response.StatusCode == HttpStatusCode.OK)
            {
                var json = response.Body;

                var result = Client.JsonMapper.From <FoldersResponse[]>(json);

                return(result);
            }

            Client.HandleErrors(response);

            return(null);
        }