odesk-api 0.1.0

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 (77) hide show
  1. data/.gitignore +22 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +176 -0
  4. data/README.md +65 -0
  5. data/Rakefile +12 -0
  6. data/example/myapp.rb +57 -0
  7. data/lib/odesk/api/client.rb +161 -0
  8. data/lib/odesk/api/config.rb +42 -0
  9. data/lib/odesk/api/logger.rb +35 -0
  10. data/lib/odesk/api/routers/activities/company.rb +120 -0
  11. data/lib/odesk/api/routers/activities/team.rb +118 -0
  12. data/lib/odesk/api/routers/activities/user.rb +125 -0
  13. data/lib/odesk/api/routers/auth.rb +38 -0
  14. data/lib/odesk/api/routers/freelancers/profile.rb +43 -0
  15. data/lib/odesk/api/routers/freelancers/search.rb +43 -0
  16. data/lib/odesk/api/routers/hr/clients/applications.rb +55 -0
  17. data/lib/odesk/api/routers/hr/clients/offers.rb +63 -0
  18. data/lib/odesk/api/routers/hr/contracts.rb +44 -0
  19. data/lib/odesk/api/routers/hr/engagements.rb +52 -0
  20. data/lib/odesk/api/routers/hr/freelancers/applications.rb +54 -0
  21. data/lib/odesk/api/routers/hr/freelancers/offers.rb +54 -0
  22. data/lib/odesk/api/routers/hr/interviews.rb +44 -0
  23. data/lib/odesk/api/routers/hr/jobs.rb +79 -0
  24. data/lib/odesk/api/routers/hr/roles.rb +49 -0
  25. data/lib/odesk/api/routers/jobs/profile.rb +43 -0
  26. data/lib/odesk/api/routers/jobs/search.rb +43 -0
  27. data/lib/odesk/api/routers/mc.rb +89 -0
  28. data/lib/odesk/api/routers/metadata.rb +65 -0
  29. data/lib/odesk/api/routers/organization/companies.rb +67 -0
  30. data/lib/odesk/api/routers/organization/teams.rb +49 -0
  31. data/lib/odesk/api/routers/organization/users.rb +40 -0
  32. data/lib/odesk/api/routers/payments.rb +52 -0
  33. data/lib/odesk/api/routers/reports/finance/accounts.rb +56 -0
  34. data/lib/odesk/api/routers/reports/finance/billings.rb +86 -0
  35. data/lib/odesk/api/routers/reports/finance/earnings.rb +86 -0
  36. data/lib/odesk/api/routers/reports/time.rb +114 -0
  37. data/lib/odesk/api/routers/snapshot.rb +65 -0
  38. data/lib/odesk/api/routers/teams.rb +47 -0
  39. data/lib/odesk/api/routers/workdiary.rb +43 -0
  40. data/lib/odesk/api/version.rb +18 -0
  41. data/lib/odesk/api.rb +29 -0
  42. data/odesk-api.gemspec +23 -0
  43. data/test/helper.rb +21 -0
  44. data/test/test_activities_company.rb +51 -0
  45. data/test/test_activities_team.rb +46 -0
  46. data/test/test_activities_user.rb +46 -0
  47. data/test/test_auth.rb +16 -0
  48. data/test/test_client.rb +47 -0
  49. data/test/test_config.rb +25 -0
  50. data/test/test_freelancers_profile.rb +16 -0
  51. data/test/test_freelancers_search.rb +16 -0
  52. data/test/test_hr_clients_applications.rb +21 -0
  53. data/test/test_hr_clients_offers.rb +26 -0
  54. data/test/test_hr_contracts.rb +16 -0
  55. data/test/test_hr_engagements.rb +21 -0
  56. data/test/test_hr_freelancers_applications.rb +21 -0
  57. data/test/test_hr_freelancers_offers.rb +21 -0
  58. data/test/test_hr_interviews.rb +16 -0
  59. data/test/test_hr_jobs.rb +36 -0
  60. data/test/test_hr_roles.rb +21 -0
  61. data/test/test_jobs_profile.rb +16 -0
  62. data/test/test_jobs_search.rb +16 -0
  63. data/test/test_logger.rb +15 -0
  64. data/test/test_mc.rb +41 -0
  65. data/test/test_metadata.rb +36 -0
  66. data/test/test_organization_companies.rb +31 -0
  67. data/test/test_organization_teams.rb +21 -0
  68. data/test/test_organization_users.rb +16 -0
  69. data/test/test_payments.rb +21 -0
  70. data/test/test_reports_finance_accounts.rb +21 -0
  71. data/test/test_reports_finance_billings.rb +36 -0
  72. data/test/test_reports_finance_earnings.rb +36 -0
  73. data/test/test_reports_time.rb +41 -0
  74. data/test/test_snapshot.rb +26 -0
  75. data/test/test_teams.rb +21 -0
  76. data/test/test_workdiary.rb +16 -0
  77. metadata +189 -0
@@ -0,0 +1,120 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ module Activities
18
+ # Company Activities
19
+ class Company
20
+ ENTRY_POINT = 'api'
21
+
22
+ # Init
23
+ #
24
+ # Arguments:
25
+ # client: (Client)
26
+ def initialize(client)
27
+ @client = client
28
+ @client.epoint = ENTRY_POINT
29
+ end
30
+
31
+ # List all oTask/Activity records within a Company
32
+ #
33
+ # Arguments:
34
+ # company: (String)
35
+ def get_list(company)
36
+ get_by_type company, nil, false
37
+ end
38
+
39
+ # List all oTask/Activity records within a Company with additional info
40
+ #
41
+ # Arguments:
42
+ # company: (String)
43
+ def get_full_list(company)
44
+ get_by_type company, nil, true
45
+ end
46
+
47
+ # List all oTask/Activity records within a Company by specified code(s)
48
+ #
49
+ # Arguments:
50
+ # company: (String)
51
+ # code: (String)
52
+ def get_specific_list(company, code)
53
+ get_by_type company, code, false
54
+ end
55
+
56
+ # Create an oTask/Activity record within a company
57
+ #
58
+ # Arguments:
59
+ # company: (String)
60
+ # params: (Hash)
61
+ def add_activity(company, params)
62
+ @client.post '/otask/v1/tasks/companies/' + company + '/tasks', params
63
+ end
64
+
65
+ # Update specific oTask/Activity record within a company
66
+ #
67
+ # Arguments:
68
+ # company: (String)
69
+ # code: (String)
70
+ # params: (Hash)
71
+ def update_activities(company, code, params)
72
+ @client.put '/otask/v1/tasks/companies/' + company + '/tasks/' + code, params
73
+ end
74
+
75
+ # Update a group of oTask/Activity records within a company
76
+ #
77
+ # Arguments:
78
+ # company: (String)
79
+ # params: (Hash)
80
+ def update_batch(company, params)
81
+ @client.put '/otask/v1/tasks/companies/' + company + '/tasks/batch', params
82
+ end
83
+
84
+ # Delete specific oTask/Activity record within a company
85
+ #
86
+ # Arguments:
87
+ # company: (String)
88
+ # code: (String)
89
+ def delete_activities(company, code)
90
+ @client.delete '/otask/v1/tasks/companies/' + company + '/tasks/' + code
91
+ end
92
+
93
+ # Delete all oTask/Activity records within a company
94
+ #
95
+ # Arguments:
96
+ # company: (String)
97
+ def delete_all_activities(company)
98
+ @client.delete '/otask/v1/tasks/companies/' + company + '/tasks/all_tasks'
99
+ end
100
+
101
+ private
102
+
103
+ # Get by type
104
+ def get_by_type(company, code = nil, is_full = false)
105
+ $LOG.i "running " + __method__.to_s
106
+ url = '';
107
+ if (is_full)
108
+ url = '/full_list';
109
+ elsif code != nil
110
+ url = '/' + code;
111
+ end
112
+
113
+ @client.get '/otask/v1/tasks/companies/' + company + '/tasks' + url
114
+ end
115
+
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,118 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ module Activities
18
+ # Team Activities
19
+ class Team
20
+ ENTRY_POINT = 'api'
21
+
22
+ # Init
23
+ #
24
+ # Arguments:
25
+ # client: (Client)
26
+ def initialize(client)
27
+ @client = client
28
+ @client.epoint = ENTRY_POINT
29
+ end
30
+
31
+ # List all oTask/Activity records within a Company
32
+ #
33
+ # Arguments:
34
+ # company: (String)
35
+ # team: (String)
36
+ def get_list(company, team)
37
+ get_by_type company, team, nil, false
38
+ end
39
+
40
+ # List all oTask/Activity records within a Company with additional info
41
+ #
42
+ # Arguments:
43
+ # company: (String)
44
+ # team: (String)
45
+ def get_full_list(company, team)
46
+ get_by_type company, team, nil, true
47
+ end
48
+
49
+ # List all oTask/Activity records within a Company by specified code(s)
50
+ #
51
+ # Arguments:
52
+ # company: (String)
53
+ # team: (String)
54
+ # code: (String)
55
+ def get_specific_list(company, team, code)
56
+ get_by_type company, team, code, false
57
+ end
58
+
59
+ # Create an oTask/Activity record within a company
60
+ #
61
+ # Arguments:
62
+ # company: (String)
63
+ # team: (String)
64
+ # params: (Hash)
65
+ def add_activity(company, team, params)
66
+ @client.post '/otask/v1/tasks/companies/' + company + '/' + team + '/tasks', params
67
+ end
68
+
69
+ # Update specific oTask/Activity record within a company
70
+ #
71
+ # Arguments:
72
+ # company: (String)
73
+ # team: (String)
74
+ # code: (String)
75
+ # params: (Hash)
76
+ def update_activities(company, team, code, params)
77
+ @client.put '/otask/v1/tasks/companies/' + company + '/' + team + '/tasks/' + code, params
78
+ end
79
+
80
+ # Delete specific oTask/Activity record within a company
81
+ #
82
+ # Arguments:
83
+ # company: (String)
84
+ # team: (String)
85
+ # code: (String)
86
+ def delete_activities(company, team, code)
87
+ @client.delete '/otask/v1/tasks/companies/' + company + '/' + team + '/tasks/' + code
88
+ end
89
+
90
+ # Delete all oTask/Activity records within a company
91
+ #
92
+ # Arguments:
93
+ # company: (String)
94
+ # team: (String)
95
+ def delete_all_activities(company, team)
96
+ @client.delete '/otask/v1/tasks/companies/' + company + '/' + team + '/tasks/all_tasks'
97
+ end
98
+
99
+ private
100
+
101
+ # Get by type
102
+ def get_by_type(company, team, code = nil, is_full = false)
103
+ $LOG.i "running " + __method__.to_s
104
+ url = '';
105
+ if (is_full)
106
+ url = '/full_list';
107
+ elsif code != nil
108
+ url = '/' + code;
109
+ end
110
+
111
+ @client.get '/otask/v1/tasks/companies/' + company + '/' + team + '/tasks' + url
112
+ end
113
+
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,125 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ module Activities
18
+ # User Activities
19
+ class User
20
+ ENTRY_POINT = 'api'
21
+
22
+ # Init
23
+ #
24
+ # Arguments:
25
+ # client: (Client)
26
+ def initialize(client)
27
+ @client = client
28
+ @client.epoint = ENTRY_POINT
29
+ end
30
+
31
+ # List all oTask/Activity records within a Company
32
+ #
33
+ # Arguments:
34
+ # company: (String)
35
+ # team: (String)
36
+ # user: (String)
37
+ def get_list(company, team, user)
38
+ get_by_type company, team, user, nil, false
39
+ end
40
+
41
+ # List all oTask/Activity records within a Company with additional info
42
+ #
43
+ # Arguments:
44
+ # company: (String)
45
+ # team: (String)
46
+ # user: (String)
47
+ def get_full_list(company, team, user)
48
+ get_by_type company, team, user, nil, true
49
+ end
50
+
51
+ # List all oTask/Activity records within a Company by specified code(s)
52
+ #
53
+ # Arguments:
54
+ # company: (String)
55
+ # team: (String)
56
+ # user: (String)
57
+ # code: (String)
58
+ def get_specific_list(company, team, user, code)
59
+ get_by_type company, team, user, code, false
60
+ end
61
+
62
+ # Create an oTask/Activity record within a company
63
+ #
64
+ # Arguments:
65
+ # company: (String)
66
+ # team: (String)
67
+ # user: (String)
68
+ # params: (Hash)
69
+ def add_activity(company, team, user, params)
70
+ @client.post '/otask/v1/tasks/companies/' + company + '/' + team + '/' + user + '/tasks', params
71
+ end
72
+
73
+ # Update specific oTask/Activity record within a company
74
+ #
75
+ # Arguments:
76
+ # company: (String)
77
+ # team: (String)
78
+ # user: (String)
79
+ # code: (String)
80
+ # params: (Hash)
81
+ def update_activities(company, team, user, code, params)
82
+ @client.put '/otask/v1/tasks/companies/' + company + '/' + team + '/' + user + '/tasks/' + code, params
83
+ end
84
+
85
+ # Delete specific oTask/Activity record within a company
86
+ #
87
+ # Arguments:
88
+ # company: (String)
89
+ # team: (String)
90
+ # user: (String)
91
+ # code: (String)
92
+ def delete_activities(company, team, user, code)
93
+ @client.delete '/otask/v1/tasks/companies/' + company + '/' + team + '/' + user + '/tasks/' + code
94
+ end
95
+
96
+ # Delete all oTask/Activity records within a company
97
+ #
98
+ # Arguments:
99
+ # company: (String)
100
+ # team: (String)
101
+ # user: (String)
102
+ def delete_all_activities(company, team, user)
103
+ @client.delete '/otask/v1/tasks/companies/' + company + '/' + team + '/' + user + '/tasks/all_tasks'
104
+ end
105
+
106
+ private
107
+
108
+ # Get by type
109
+ def get_by_type(company, team, user, code = nil, is_full = false)
110
+ $LOG.i "running " + __method__.to_s
111
+ url = '';
112
+ if (is_full)
113
+ url = '/full_list';
114
+ elsif code != nil
115
+ url = '/' + code;
116
+ end
117
+
118
+ @client.get '/otask/v1/tasks/companies/' + company + '/' + team + '/' + user + '/tasks' + url
119
+ end
120
+
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,38 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ # Get My Info
18
+ class Auth
19
+ ENTRY_POINT = 'api'
20
+
21
+ # Init
22
+ #
23
+ # Arguments:
24
+ # client: (Client)
25
+ def initialize(client)
26
+ @client = client
27
+ @client.epoint = ENTRY_POINT
28
+ end
29
+
30
+ # Get info of authenticated user
31
+ def get_user_info
32
+ $LOG.i "running " + __method__.to_s
33
+ @client.get '/auth/v1/info'
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,43 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ module Freelancers
18
+ # Freelancer's profile info
19
+ class Profile
20
+ ENTRY_POINT = 'api'
21
+
22
+ # Init
23
+ #
24
+ # Arguments:
25
+ # client: (Client)
26
+ def initialize(client)
27
+ @client = client
28
+ @client.epoint = ENTRY_POINT
29
+ end
30
+
31
+ # Get specific profile
32
+ #
33
+ # Arguments:
34
+ # key: (String)
35
+ def get_specific(key)
36
+ $LOG.i "running " + __method__.to_s
37
+ @client.get '/profiles/v1/providers/' + key
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ module Freelancers
18
+ # Search Freelancer's profiles
19
+ class Search
20
+ ENTRY_POINT = 'api'
21
+
22
+ # Init
23
+ #
24
+ # Arguments:
25
+ # client: (Client)
26
+ def initialize(client)
27
+ @client = client
28
+ @client.epoint = ENTRY_POINT
29
+ end
30
+
31
+ # Search profiles
32
+ #
33
+ # Arguments:
34
+ # params: (Hash)
35
+ def find(params)
36
+ $LOG.i "running " + __method__.to_s
37
+ @client.get '/profiles/v2/search/providers', params
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,55 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ module Hr
18
+ module Clients
19
+ # Client Job Applications API
20
+ class Applications
21
+ ENTRY_POINT = 'api'
22
+
23
+ # Init
24
+ #
25
+ # Arguments:
26
+ # client: (Client)
27
+ def initialize(client)
28
+ @client = client
29
+ @client.epoint = ENTRY_POINT
30
+ end
31
+
32
+ # Get list of applications
33
+ #
34
+ # Arguments:
35
+ # params: (Hash)
36
+ def get_list(params)
37
+ $LOG.i "running " + __method__.to_s
38
+ @client.get '/hr/v3/clients/applications', params
39
+ end
40
+
41
+ # Get specific application
42
+ #
43
+ # Arguments:
44
+ # reference: (String)
45
+ # params: (Hash)
46
+ def get_specific(reference, params)
47
+ $LOG.i "running " + __method__.to_s
48
+ @client.get '/hr/v3/clients/applications/' + reference, params
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,63 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ module Hr
18
+ module Clients
19
+ # Client Job Offers API
20
+ class Offers
21
+ ENTRY_POINT = 'api'
22
+
23
+ # Init
24
+ #
25
+ # Arguments:
26
+ # client: (Client)
27
+ def initialize(client)
28
+ @client = client
29
+ @client.epoint = ENTRY_POINT
30
+ end
31
+
32
+ # Get list of offers
33
+ #
34
+ # Arguments:
35
+ # params: (Hash)
36
+ def get_list(params)
37
+ $LOG.i "running " + __method__.to_s
38
+ @client.get '/offers/v1/clients/offers', params
39
+ end
40
+
41
+ # Get specific offer
42
+ #
43
+ # Arguments:
44
+ # reference: (String)
45
+ def get_specific(reference)
46
+ $LOG.i "running " + __method__.to_s
47
+ @client.get '/offers/v1/clients/offers/' + reference
48
+ end
49
+
50
+ # Make an Offer
51
+ #
52
+ # Arguments:
53
+ # params: (Hash)
54
+ def make_offer(params)
55
+ $LOG.i "running " + __method__.to_s
56
+ @client.post '/offers/v1/clients/offers', params
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,44 @@
1
+ # Licensed under the oDesk's API Terms of Use;
2
+ # you may not use this file except in compliance with the Terms.
3
+ #
4
+ # Unless required by applicable law or agreed to in writing, software
5
+ # distributed under the License is distributed on an "AS IS" BASIS,
6
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
+ # See the License for the specific language governing permissions and
8
+ # limitations under the License.
9
+ #
10
+ # Author:: Maksym Novozhylov (mnovozhilov@odesk.com)
11
+ # Copyright:: Copyright 2014(c) oDesk.com
12
+ # License:: See LICENSE.txt and TOS - http://developers.odesk.com/API-Terms-of-Use
13
+
14
+ module Odesk
15
+ module Api
16
+ module Routers
17
+ module Hr
18
+ # Contracts API
19
+ class Contracts
20
+ ENTRY_POINT = 'api'
21
+
22
+ # Init
23
+ #
24
+ # Arguments:
25
+ # client: (Client)
26
+ def initialize(client)
27
+ @client = client
28
+ @client.epoint = ENTRY_POINT
29
+ end
30
+
31
+ # End Contract
32
+ #
33
+ # Arguments:
34
+ # reference: (String)
35
+ # params: (Hash)
36
+ def end_contract(reference, params)
37
+ $LOG.i "running " + __method__.to_s
38
+ @client.delete '/hr/v2/contracts/' + reference, params
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end