Пример #1
0
        /// <summary>
        ///Add a task
        /// https://www.toggl.com/public/api#post_tasks
        /// </summary>
        /// <param name="t"></param>
        public async Task <Task> CreateAsync(Task t)
        {
            var response = await TogglSrv.PostAsync(_togglTasksUrl, t.ToJson()).ConfigureAwait(false);

            var data = response.GetData <Task>();

            return(data);
        }
Пример #2
0
        /// <summary>
        /// Edit a task
        /// https://www.toggl.com/public/api#put_tasks
        /// </summary>
        /// <param name="t"></param>
        public async Task <Task> UpdateAsync(Task t)
        {
            var url      = string.Format(ApiRoutes.Task.TogglTasksGet, t.Id);
            var response = await TogglSrv.PutAsync(url, t.ToJson()).ConfigureAwait(false);

            var data = response.GetData <Task>();

            return(data);
        }