toggl_api 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE +20 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +48 -0
  7. data/Rakefile +1 -0
  8. data/lib/toggl_api.rb +7 -0
  9. data/lib/toggl_api/api/client.rb +42 -0
  10. data/lib/toggl_api/api/project.rb +46 -0
  11. data/lib/toggl_api/api/project_user.rb +38 -0
  12. data/lib/toggl_api/api/tag.rb +24 -0
  13. data/lib/toggl_api/api/task.rb +38 -0
  14. data/lib/toggl_api/api/time_entry.rb +73 -0
  15. data/lib/toggl_api/api/user.rb +46 -0
  16. data/lib/toggl_api/api/workspace.rb +36 -0
  17. data/lib/toggl_api/api/workspace_user.rb +32 -0
  18. data/lib/toggl_api/base.rb +39 -0
  19. data/lib/toggl_api/error.rb +8 -0
  20. data/lib/toggl_api/report.rb +30 -0
  21. data/lib/toggl_api/request.rb +100 -0
  22. data/lib/toggl_api/version.rb +3 -0
  23. data/test/base_test.rb +38 -0
  24. data/test/fixtures/authentication.json +44 -0
  25. data/test/fixtures/bulk_update_tasks.json +24 -0
  26. data/test/fixtures/bulk_update_time_entries.json +29 -0
  27. data/test/fixtures/client.json +11 -0
  28. data/test/fixtures/client_projects.json +21 -0
  29. data/test/fixtures/clients.json +15 -0
  30. data/test/fixtures/create_client.json +8 -0
  31. data/test/fixtures/create_project.json +13 -0
  32. data/test/fixtures/create_project_user.json +0 -0
  33. data/test/fixtures/create_tag.json +7 -0
  34. data/test/fixtures/create_task.json +10 -0
  35. data/test/fixtures/create_time_entry.json +13 -0
  36. data/test/fixtures/invite_users_to_workspace.json +12 -0
  37. data/test/fixtures/project.json +13 -0
  38. data/test/fixtures/project_users.json +18 -0
  39. data/test/fixtures/relations_of_workspace_and_user.json +22 -0
  40. data/test/fixtures/report_failure.json +8 -0
  41. data/test/fixtures/report_success.json +6 -0
  42. data/test/fixtures/reset_api_token.json +2 -0
  43. data/test/fixtures/signup.json +19 -0
  44. data/test/fixtures/start_time_entry.json +13 -0
  45. data/test/fixtures/stop_time_entry.json +13 -0
  46. data/test/fixtures/task.json +10 -0
  47. data/test/fixtures/time_entries.json +24 -0
  48. data/test/fixtures/time_entry.json +15 -0
  49. data/test/fixtures/update_client.json +9 -0
  50. data/test/fixtures/update_project.json +12 -0
  51. data/test/fixtures/update_project_user.json +0 -0
  52. data/test/fixtures/update_tag.json +7 -0
  53. data/test/fixtures/update_task.json +13 -0
  54. data/test/fixtures/update_time_entry.json +15 -0
  55. data/test/fixtures/update_user.json +31 -0
  56. data/test/fixtures/update_workspace_user.json +9 -0
  57. data/test/fixtures/workspace_clients.json +19 -0
  58. data/test/fixtures/workspace_projects.json +21 -0
  59. data/test/fixtures/workspace_tasks.json +29 -0
  60. data/test/fixtures/workspace_users.json +47 -0
  61. data/test/fixtures/workspaces.json +12 -0
  62. data/test/helper.rb +10 -0
  63. data/test/test_client.rb +51 -0
  64. data/test/test_project.rb +94 -0
  65. data/test/test_report.rb +53 -0
  66. data/test/test_tag.rb +30 -0
  67. data/test/test_task.rb +51 -0
  68. data/test/test_time_entry.rb +69 -0
  69. data/test/test_user.rb +53 -0
  70. data/test/test_workspace.rb +72 -0
  71. data/toggl_api.gemspec +30 -0
  72. metadata +260 -0
@@ -0,0 +1,8 @@
1
+ {
2
+ "data": {
3
+ "id":1239455,
4
+ "wid":777,
5
+ "name":"Very Big Company",
6
+ "at":"2013-02-26T08:45:28+00:00"
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "data": {
3
+ "id":193838628,
4
+ "wid":777,
5
+ "cid":123397,
6
+ "name":"An awesome project",
7
+ "billable":false,
8
+ "is_private":true,
9
+ "active":true,
10
+ "at":"2013-03-06T12:15:37+00:00",
11
+ "template_id":10237
12
+ }
13
+ }
File without changes
@@ -0,0 +1,7 @@
1
+ {
2
+ "data": {
3
+ "id":1239455,
4
+ "wid":777,
5
+ "name":"not billed"
6
+ }
7
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "data": {
3
+ "name":"A new task",
4
+ "id":1335076912,
5
+ "wid":888,
6
+ "pid":777,
7
+ "active":true,
8
+ "estimated_seconds":0
9
+ }
10
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "data":
3
+ {
4
+ "id":436694100,
5
+ "pid":123,
6
+ "wid":777,
7
+ "billable":false,
8
+ "start":"2013-03-05T07:58:58.000Z",
9
+ "duration":1200,
10
+ "description":"Meeting with possible clients",
11
+ "tags":["billed"]
12
+ }
13
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "data":{[
3
+ "id":3511220,
4
+ "uid":35934278,
5
+ "wid":777,
6
+ "admin":false,
7
+ "active":false,
8
+ "email":"jane.swift@toggl.com",
9
+ "invite_url":"https://toggl.com/user/accept_invitation?code=ec2876e421234dfasd0fa1c55370d3940"
10
+ ]},
11
+ "notifications":["To add more users you have to Upgrade"]
12
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "data": {
3
+ "id":193838628,
4
+ "wid":777,
5
+ "cid":123397,
6
+ "name":"An awesome project",
7
+ "billable":false,
8
+ "is_private":true,
9
+ "active":true,
10
+ "at":"2013-03-06T12:15:37+00:00",
11
+ "template":true
12
+ }
13
+ }
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "id":4692190,
4
+ "pid":777,
5
+ "uid":123,
6
+ "wid":99,
7
+ "manager":true,
8
+ "rate":4
9
+ },
10
+ {
11
+ "id":4692193,
12
+ "pid":777,
13
+ "uid":125,
14
+ "wid":99,
15
+ "manager":false,
16
+ "rate":4
17
+ }
18
+ ]
@@ -0,0 +1,22 @@
1
+ [
2
+ {
3
+ "id":3123855,
4
+ "uid":35224123,
5
+ "wid":777,
6
+ "admin":false,
7
+ "active":false,
8
+ "email":"John@toggl.com",
9
+ "at":"2013-05-17T16:50:36+03:00",
10
+ "name":"John Swift",
11
+ "invite_url":"https://toggl.com/user/accept_invitation?code=fb3ad3db5dasd123c2b529e3a519826"
12
+ },{
13
+ "id":200066,
14
+ "uid":21961,
15
+ "wid":777,
16
+ "admin":true,
17
+ "active":true,
18
+ "email":"Jane@toggl.com",
19
+ "at":"2012-04-11T22:59:33+03:00",
20
+ "name":"Jane"
21
+ }
22
+ ]
@@ -0,0 +1,8 @@
1
+ {
2
+ "error": {
3
+ "message":"We are sorry, this Error should never happen to you",
4
+ "tip":"Please contact support@toggl.com with information on your request",
5
+ "code":500
6
+ }
7
+ }
8
+
@@ -0,0 +1,6 @@
1
+ {
2
+ "total_grand":null,
3
+ "total_billable":null,
4
+ "total_currencies":[{"currency":null,"amount":null}],
5
+ "data":[]
6
+ }
@@ -0,0 +1,2 @@
1
+ "a0123123b8e43343d614553f95f9192ab9c1"
2
+
@@ -0,0 +1,19 @@
1
+ {
2
+ "data":{
3
+ "id":599978901,
4
+ "api_token":"808lolae4eab897cce9729a53642124effe",
5
+ "default_wid":983493,
6
+ "email":"test.user@toggl.com",
7
+ "fullname":"Test User",
8
+ "jquery_timeofday_format":"",
9
+ "jquery_date_format":"",
10
+ "timeofday_format":"",
11
+ "date_format":"",
12
+ "store_start_and_stop_time":false,
13
+ "beginning_of_week":0,
14
+ "sidebar_piechart":false,
15
+ "timeline_experiment":false,
16
+ "new_blog_post":{},
17
+ "invitation":{}
18
+ }
19
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "data":
3
+ {
4
+ "id":436694100,
5
+ "pid":123,
6
+ "wid":777,
7
+ "billable":false,
8
+ "start":"2013-03-05T07:58:58.000Z",
9
+ "duration":-1362470338,
10
+ "description":"Meeting with possible clients",
11
+ "tags":["billed"]
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "data":
3
+ {
4
+ "id":436694100,
5
+ "pid":123,
6
+ "wid":777,
7
+ "billable":false,
8
+ "start":"2013-03-05T07:58:58.000Z",
9
+ "duration":60,
10
+ "description":"Meeting with possible clients",
11
+ "tags":["billed"]
12
+ }
13
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "data": {
3
+ "name":"A new task",
4
+ "id":1335076912,
5
+ "wid":888,
6
+ "pid":777,
7
+ "active":true,
8
+ "estimated_seconds":0
9
+ }
10
+ }
@@ -0,0 +1,24 @@
1
+ [
2
+ {
3
+ "id":436691234,
4
+ "wid":777,
5
+ "pid":123,
6
+ "billable":true,
7
+ "start":"2013-03-11T11:36:00+00:00",
8
+ "stop":"2013-03-11T15:36:00+00:00",
9
+ "duration":14400,
10
+ "description":"Meeting with the client",
11
+ "tags":[""],
12
+ "at":"2013-03-11T15:36:58+00:00"
13
+ },{
14
+ "id":436776436,
15
+ "wid":777,
16
+ "billable":false,
17
+ "start":"2013-03-12T10:32:43+00:00",
18
+ "stop":"2013-03-12T14:32:43+00:00",
19
+ "duration":18400,
20
+ "description":"important work",
21
+ "tags":[""],
22
+ "at":"2013-03-12T14:32:43+00:00"
23
+ }
24
+ ]
@@ -0,0 +1,15 @@
1
+ {
2
+ "data":{
3
+ "id":436694100,
4
+ "wid":777,
5
+ "pid":193791,
6
+ "tid":13350500,
7
+ "billable":false,
8
+ "start":"2013-02-27T01:24:00+00:00",
9
+ "stop":"2013-02-27T07:24:00+00:00",
10
+ "duration":21600,
11
+ "description":"Some serious work",
12
+ "tags":["billed"],
13
+ "at":"2013-02-27T13:49:18+00:00"
14
+ }
15
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "data": {
3
+ "id":1239455,
4
+ "wid":777,
5
+ "name":"Very Big Company",
6
+ "notes":"something about the client",
7
+ "at":"2013-02-26T08:55:28+00:00"
8
+ }
9
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "data": {
3
+ "id":193838628,
4
+ "wid":777,
5
+ "cid":123398,
6
+ "name":"Changed the name",
7
+ "billable":false,
8
+ "active":true,
9
+ "at":"2013-03-06T12:15:37+00:00",
10
+ "template":true
11
+ }
12
+ }
File without changes
@@ -0,0 +1,7 @@
1
+ {
2
+ "data": {
3
+ "id":1239455,
4
+ "wid":777,
5
+ "name":"billed"
6
+ }
7
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "data": {
3
+ "name":"A new task",
4
+ "id":1335076912,
5
+ "wid":888,
6
+ "pid":777,
7
+ "active":false,
8
+ "at":"2013-02-26T15:09:52+00:00",
9
+ "estimated_seconds":3600,
10
+ "uname": "John Swift",
11
+ "done_seconds": 1200
12
+ }
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "data":
3
+ {
4
+ "id":436694100,
5
+ "pid":123,
6
+ "wid":777,
7
+ "billable":false,
8
+ "start":"2013-03-05T07:58:58.000Z",
9
+ "stop":"2013-03-05T08:58:58.000Z",
10
+ "duration":1240,
11
+ "description":"Meeting with possible clients",
12
+ "billable": true,
13
+ "at": "2013-03-05T12:34:50+00:00"
14
+ }
15
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "data":{
3
+ "id":123123123,
4
+ "api_token":"1971800d4d82861d8f2c1651fea4d212",
5
+ "default_wid":777,
6
+ "email":"john@toggl.com",
7
+ "fullname":"John Smith",
8
+ "jquery_timeofday_format":"h:i A",
9
+ "jquery_date_format":"d.m.Y",
10
+ "timeofday_format":"h:mm A",
11
+ "date_format":"DD.MM.YYYY",
12
+ "store_start_and_stop_time":true,
13
+ "beginning_of_week":1,
14
+ "language":"en_US",
15
+ "image_url":"https://www.toggl.com/system/avatars/9000/small/open-uri20121116-2767-b1qr8l.png",
16
+ "sidebar_piechart":false,
17
+ "at":"2013-08-12T11:55:58+03:00",
18
+ "retention":9,
19
+ "record_timeline":true,
20
+ "render_timeline":true,
21
+ "timeline_enabled":true,
22
+ "timeline_experiment":true,
23
+ "new_blog_post":{},
24
+ "timezone":"Europe/Tallinn",
25
+ "openid_enabled":true,
26
+ "send_product_emails":true,
27
+ "send_weekly_report":true,
28
+ "send_timer_notifications":true,
29
+ "invitation":{}
30
+ }
31
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "data": {
3
+ "id":19012628,
4
+ "uid":1625,
5
+ "wid":777,
6
+ "admin":false,
7
+ "active":true
8
+ }
9
+ }
@@ -0,0 +1,19 @@
1
+ [
2
+ {
3
+ "id":123,
4
+ "wid":777,
5
+ "name":"Rising Start-Up",
6
+ "at":"2013-03-06T09:06:13+00:00",
7
+ "notes":"Arrange a discount for them",
8
+ "hrate":2,
9
+ "cur":"USD"
10
+ },{
11
+ "id":987,
12
+ "wid":777,
13
+ "name":"Big Company Inc",
14
+ "at":"2013-03-06T09:05:40+00:00",
15
+ "notes":"We had some lovely projects with them",
16
+ "hrate":10,
17
+ "cur":"EUR"
18
+ }
19
+ ]
@@ -0,0 +1,21 @@
1
+ [
2
+ {
3
+ "id":909,
4
+ "wid":777,
5
+ "cid":987,
6
+ "name":"Very lucrative project",
7
+ "billable":false,
8
+ "is_private":true,
9
+ "active":true,
10
+ "at":"2013-03-06T09:15:18+00:00"
11
+ },{
12
+ "id":32123,
13
+ "wid":777,
14
+ "cid":123,
15
+ "name":"Factory server infrastructure",
16
+ "billable":true,
17
+ "is_private":true,
18
+ "active":true,
19
+ "at":"2013-03-06T09:16:06+00:00"
20
+ }
21
+ ]
@@ -0,0 +1,29 @@
1
+ [
2
+ {
3
+ "name":"SWOT",
4
+ "id":13512097,
5
+ "wid":777,
6
+ "pid":32123,
7
+ "uid":123123,
8
+ "active":true,
9
+ "at":"2013-03-06T09:15:51+00:00",
10
+ "estimated_seconds":7200
11
+ },{
12
+ "name":"development",
13
+ "id":133504498,
14
+ "wid":777,
15
+ "pid":32123,
16
+ "active":true,
17
+ "at":"2013-03-06T09:15:59+00:00",
18
+ "estimated_seconds":0
19
+ },{
20
+ "name":"analyze SEO",
21
+ "id":1335112300,
22
+ "wid":777,
23
+ "pid":909,
24
+ "active":true,
25
+ "at":"2013-03-06T09:18:57+00:00",
26
+ "estimated_seconds":21600
27
+ }
28
+
29
+ ]
@@ -0,0 +1,47 @@
1
+ [
2
+ {
3
+ "id":123123,
4
+ "default_wid":777,
5
+ "email":"john@swift.com",
6
+ "fullname":"John Swift",
7
+ "jquery_timeofday_format":"h:i A",
8
+ "jquery_date_format":"m/d/Y",
9
+ "timeofday_format":"h:mm A",
10
+ "date_format":"MM/DD/YYYY",
11
+ "store_start_and_stop_time":true,
12
+ "beginning_of_week":0,
13
+ "language":"en_US",
14
+ "image_url":"https://www.toggl.com/system/avatars/123123/small/open-uri20121116-2767-b1qr8l.png",
15
+ "sidebar_piechart":false,
16
+ "at":"2013-03-06T08:57:12+00:00",
17
+ "retention":9,
18
+ "record_timeline":true,
19
+ "render_timeline":true,
20
+ "timeline_enabled":true,
21
+ "timeline_experiment":true,
22
+ "new_blog_post":{},
23
+ "should_upgrade":true,
24
+ "invitation":{}
25
+ },{
26
+ "id":321321,
27
+ "email":"Happy@worker.com",
28
+ "fullname":"Happy Worker",
29
+ "jquery_timeofday_format":"h:i A",
30
+ "jquery_date_format":"m/d/Y",
31
+ "timeofday_format":"h:mm A",
32
+ "date_format":"MM/DD/YYYY",
33
+ "store_start_and_stop_time":true,
34
+ "beginning_of_week":1,
35
+ "language":"en_US",
36
+ "image_url":"https://www.toggl.com/images/profile.png",
37
+ "sidebar_piechart":false,
38
+ "at":"2013-03-06T08:46:07+00:00",
39
+ "created_at":"2013-03-06T07:52:03+00:00",
40
+ "retention":9,
41
+ "render_timeline":true,
42
+ "timeline_experiment":true,
43
+ "new_blog_post":{},
44
+ "should_upgrade":true,
45
+ "invitation":{}
46
+ }
47
+ ]