upwork-api 1.0.1 → 1.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.
- data/README.md +1 -0
- data/lib/upwork/api/routers/activities/engagement.rb +9 -0
- data/lib/upwork/api/routers/activities/team.rb +5 -5
- data/lib/upwork/api/routers/hr/freelancers/offers.rb +1 -1
- data/lib/upwork/api/routers/metadata.rb +0 -6
- data/lib/upwork/api/routers/reports/time.rb +2 -2
- data/lib/upwork/api/version.rb +1 -1
- data/test/test_activities_engagement.rb +5 -0
- data/test/test_metadata.rb +0 -5
- metadata +2 -2
data/README.md
CHANGED
@@ -3,6 +3,7 @@ Ruby bindings for Upwork API
|
|
3
3
|
|
4
4
|
[](http://www.apache.org/licenses/LICENSE-2.0.html)
|
5
5
|
[](http://badge.fury.io/rb/upwork-api)
|
6
|
+
[](https://github.com/upwork/ruby-upwork/releases)
|
6
7
|
[](https://travis-ci.org/upwork/ruby-upwork)
|
7
8
|
[](http://waffle.io/upwork/ruby-upwork)
|
8
9
|
|
@@ -46,6 +46,15 @@ module Upwork
|
|
46
46
|
def assign(company, team, engagement, params)
|
47
47
|
@client.put '/otask/v1/tasks/companies/' + company + '/' + team + '/engagements/' + engagement, params
|
48
48
|
end
|
49
|
+
|
50
|
+
# Assign to specific engagement the list of activities
|
51
|
+
#
|
52
|
+
# Arguments:
|
53
|
+
# engagement_ref: (String)
|
54
|
+
# params: (Hash)
|
55
|
+
def assign_to_engagement(engagement_ref, params)
|
56
|
+
@client.put '/tasks/v2/tasks/contracts/' + engagement_ref
|
57
|
+
end
|
49
58
|
|
50
59
|
end
|
51
60
|
end
|
@@ -54,7 +54,7 @@ module Upwork
|
|
54
54
|
# team: (String)
|
55
55
|
# params: (Hash)
|
56
56
|
def add_activity(company, team, params)
|
57
|
-
@client.post '/otask/v1/tasks/companies/' + company + '/' + team + '/tasks', params
|
57
|
+
@client.post '/otask/v1/tasks/companies/' + company + '/teams/' + team + '/tasks', params
|
58
58
|
end
|
59
59
|
|
60
60
|
# Update specific oTask/Activity record within a team
|
@@ -65,7 +65,7 @@ module Upwork
|
|
65
65
|
# code: (String)
|
66
66
|
# params: (Hash)
|
67
67
|
def update_activities(company, team, code, params)
|
68
|
-
@client.put '/otask/v1/tasks/companies/' + company + '/' + team + '/tasks/' + code, params
|
68
|
+
@client.put '/otask/v1/tasks/companies/' + company + '/teams/' + team + '/tasks/' + code, params
|
69
69
|
end
|
70
70
|
|
71
71
|
# Archive specific oTask/Activity record within a team
|
@@ -75,7 +75,7 @@ module Upwork
|
|
75
75
|
# team: (String)
|
76
76
|
# code: (String)
|
77
77
|
def archive_activities(company, team, code)
|
78
|
-
@client.put '/otask/v1/tasks/companies/' + company + '/' + team + '/archive/' + code
|
78
|
+
@client.put '/otask/v1/tasks/companies/' + company + '/teams/' + team + '/archive/' + code
|
79
79
|
end
|
80
80
|
|
81
81
|
# Unarchive specific oTask/Activity record within a team
|
@@ -85,7 +85,7 @@ module Upwork
|
|
85
85
|
# team: (String)
|
86
86
|
# code: (String)
|
87
87
|
def unarchive_activities(company, team, code)
|
88
|
-
@client.put '/otask/v1/tasks/companies/' + company + '/' + team + '/unarchive/' + code
|
88
|
+
@client.put '/otask/v1/tasks/companies/' + company + '/teams/' + team + '/unarchive/' + code
|
89
89
|
end
|
90
90
|
|
91
91
|
# Update a group of oTask/Activity records within a company
|
@@ -107,7 +107,7 @@ module Upwork
|
|
107
107
|
url = '/' + code;
|
108
108
|
end
|
109
109
|
|
110
|
-
@client.get '/otask/v1/tasks/companies/' + company + '/' + team + '/tasks' + url
|
110
|
+
@client.get '/otask/v1/tasks/companies/' + company + '/teams/' + team + '/tasks' + url
|
111
111
|
end
|
112
112
|
|
113
113
|
end
|
@@ -27,12 +27,6 @@ module Upwork
|
|
27
27
|
@client.epoint = ENTRY_POINT
|
28
28
|
end
|
29
29
|
|
30
|
-
# Get categories
|
31
|
-
def get_categories
|
32
|
-
$LOG.i "running " + __method__.to_s
|
33
|
-
@client.get '/profiles/v1/metadata/categories'
|
34
|
-
end
|
35
|
-
|
36
30
|
# Get categories (v2)
|
37
31
|
def get_categories_v2
|
38
32
|
$LOG.i "running " + __method__.to_s
|
@@ -78,7 +78,7 @@ module Upwork
|
|
78
78
|
# params: (Hash)
|
79
79
|
def get_by_freelancer_limited(freelancer_id, params)
|
80
80
|
$LOG.i "running " + __method__.to_s
|
81
|
-
@client.get '/timereports/v1/providers/' + freelancer_id, params
|
81
|
+
@client.get '/timereports/v1/providers/' + freelancer_id + '/hours', params
|
82
82
|
end
|
83
83
|
|
84
84
|
# Generating Freelancer's Specific Reports (with financial info)
|
@@ -111,4 +111,4 @@ module Upwork
|
|
111
111
|
end
|
112
112
|
end
|
113
113
|
end
|
114
|
-
end
|
114
|
+
end
|
data/lib/upwork/api/version.rb
CHANGED
@@ -18,4 +18,9 @@ class ActivitiesEngagementTest < Test::Unit::TestCase
|
|
18
18
|
api = Upwork::Api::Routers::Activities::Engagement.new(get_client_mock)
|
19
19
|
assert api.assign('company', 'team', '1234', {})
|
20
20
|
end
|
21
|
+
|
22
|
+
def test_assign_to_engagement
|
23
|
+
api = Upwork::Api::Routers::Activities::Engagement.new(get_client_mock)
|
24
|
+
assert api.assign_to_engagement('1234', {})
|
25
|
+
end
|
21
26
|
end
|
data/test/test_metadata.rb
CHANGED
@@ -24,11 +24,6 @@ class MetadataTest < Test::Unit::TestCase
|
|
24
24
|
assert api.get_skills
|
25
25
|
end
|
26
26
|
|
27
|
-
def test_get_categories
|
28
|
-
api = Upwork::Api::Routers::Metadata.new(get_client_mock)
|
29
|
-
assert api.get_categories
|
30
|
-
end
|
31
|
-
|
32
27
|
def test_get_categories_v2
|
33
28
|
api = Upwork::Api::Routers::Metadata.new(get_client_mock)
|
34
29
|
assert api.get_categories_v2
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upwork-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-10-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth
|