コード例 #1
0
        private static async Task TimeTracker(string timeTrackerToken)
        {
            var client = new TimeTrackingClient(timeTrackerToken, "https://<organizationName>.timehub.7pace.com/api/rest/");

            var me = await client.GetMe();

            var items = await client.GetWorkLogs(DateTime.Now.AddDays(-7), DateTime.Now);

            var createRequest = new CreateWorkLogRequest(DateTime.UtcNow, 500, null, "TimeTracker API Test", me.User.Id, "00000000-0000-0000-0000-000000000000");

            // var created = await client.CreateWorkLog(createRequest);

            // await client.DeleteWorkLog(created.Id);
        }
コード例 #2
0
        private IEnumerable <WorkLog> GetWorkLogs()
        {
            var workLogs = _client.GetWorkLogs(_start, _end).Result;

            foreach (WorkLog workLog in workLogs)
            {
                if (workLog.Flags.IsFromApi == false)
                {
                    continue;
                }

                yield return(workLog);
            }
        }