Esempio n. 1
0
        public TimeEntry GetRunningTimer()
        {
            var x         = WebCall.GetRequestWithErrorHandling($"{baseUrl}/time_entries/current", this.authString);
            var t         = JsonConvert.DeserializeObject <TimeEntryData>(x.Data);
            var timeEntry = t.data;

            return(timeEntry);
        }
Esempio n. 2
0
        public List <Project> GetProjects()
        {
            var url = $"{baseUrl}/workspaces/{this.wid}/projects";
            var x   = WebCall.GetRequestWithErrorHandling(url, this.authString);
            var t   = JsonConvert.DeserializeObject <List <Project> >(x.Data);

            return(t);
        }
Esempio n. 3
0
        public User GetMe()
        {
            var url = $"{baseUrl}/me";
            var x   = WebCall.GetRequestWithErrorHandling(url, this.authString);
            var t   = JsonConvert.DeserializeObject <User>(x.Data);

            return(t);
        }
Esempio n. 4
0
        public Project GetProject(int projectId)
        {
            var url  = $"{baseUrl}/projects/{projectId}";
            var x    = WebCall.GetRequestWithErrorHandling(url, this.authString);
            var t    = JsonConvert.DeserializeObject <ProjectData>(x.Data);
            var proj = t.data;

            return(proj);
        }
Esempio n. 5
0
        public TimeEntry GetRunningTimer()
        {
            var x = WebCall.GetRequestWithErrorHandling($"{baseUrl}/time_entries/current", this.apiKey);

            if (x.IsSuccessful)
            {
                var t         = JsonConvert.DeserializeObject <TimeEntryData>(x.Data);
                var timeEntry = t.data;
                return(timeEntry);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 6
0
        public ActionResult ManageWebhooks()
        {
            var req   = WebCall.GetRequestWithErrorHandling(WebhookRegisterURL);
            var hooks = new List <RegisteredWebhook>();

            if (req.IsSuccessful)
            {
                hooks = JsonConvert.DeserializeObject <List <RegisteredWebhook> >(req.Data);
            }
            var x = from h in hooks
                    select new {
                h.id
                , h.active
                , h.idModel
                , h.description
                , h.callbackURL
                , h.firstConsecutiveFailDate
                , h.consecutiveFailures
            };

            return(View(model: JsonConvert.SerializeObject(x, Formatting.Indented)));
        }
Esempio n. 7
0
 public void GetClients()
 {
     var url = $"{baseUrl}/clients";
     var x   = WebCall.GetRequestWithErrorHandling(url, this.authString);
     var t   = JsonConvert.DeserializeObject <List <Client> >(x.Data);
 }