upwork-api 1.3.0 → 1.3.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b2e8926f9643382cf971940857b19fb0361ac88c164a51ba6d1c7fe012f927f
4
- data.tar.gz: a350200eef734e54db98fa608dca33a646fcfaf1932a44a7772aabf9f4e63b6d
3
+ metadata.gz: ebd5a01663e5177177beebc70dfd4e402eba1abfae5f4009176acd89a3480e4e
4
+ data.tar.gz: aa0e0d4bd459a56e16dd9bb5b782fd55754a5269e37a2989e7fafa45be0d9f4a
5
5
  SHA512:
6
- metadata.gz: 21d7bdf4e36804439183a91648d163f4e924f3ce966a29568060dbb470a84e6d5d2ec62a3766abe26ee59c8fa6444e7e89d237a11a003fbfb750ffbd42b88447
7
- data.tar.gz: 1b6af05929c86efc601e06ffe9d476b03d5508b3b2ade7287b7f7f2f50b2ebee07132632d807e71cb9187de600c909fbbfd25378bacf2bb88a07c2708204cf23
6
+ metadata.gz: 467640cc6c17a01bc37ce2f94523a61951e247e5078b6c87b1b16a48c9edcb3a1ca6377c1702370c5c52269ac6a2887e1c2c932409f2872b3b5e850dad46f1be
7
+ data.tar.gz: '099570b67682911a5456e7ea5467994fe76a9f922ff017eb909fbc8252642c8fffffd51e2c13b44a91859eaeb1cc78d6f86ce8931a62488be65ad30b9061a8af'
data/CHANGES.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Release History
2
2
 
3
+ ## 1.3.5
4
+ * Send Message to a Batch of Rooms API
5
+ * Bug fixes
6
+
7
+ ## 1.3.4
8
+ * Add Room Messages API
9
+
10
+ ## 1.3.3
11
+ * Add Specialties API
12
+ * Add Skills V2 API
13
+
14
+ ## 1.3.2
15
+ * Fix the broken URL in assign method of Activities API
16
+
17
+ ## 1.3.1
18
+ * Fix assign_to_engagement - parameters are not sent
19
+
3
20
  ## 1.3.0
4
21
  * Stop supporting deprecated Teamrooms API
5
22
  * Migrate Workdiaries, Workdays and Snapshots API to v3
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- Ruby bindings for Upwork API
1
+ Ruby bindings for Upwork API (OAuth1)
2
2
  ============
3
3
 
4
- [![License](http://img.shields.io/packagist/l/upwork/php-upwork.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
4
+ [![License](https://img.shields.io/github/license/upwork/ruby-upwork)](http://www.apache.org/licenses/LICENSE-2.0.html)
5
5
  [![Gem Version](https://badge.fury.io/rb/upwork-api.svg)](http://badge.fury.io/rb/upwork-api)
6
6
  [![GitHub release](https://img.shields.io/github/release/upwork/ruby-upwork.svg)](https://github.com/upwork/ruby-upwork/releases)
7
7
  [![Build Status](https://travis-ci.org/upwork/ruby-upwork.svg)](https://travis-ci.org/upwork/ruby-upwork)
@@ -26,4 +26,4 @@ module Upwork # :nodoc:
26
26
 
27
27
  $LOG = Logger.new
28
28
  end
29
- end
29
+ end
@@ -44,7 +44,7 @@ module Upwork
44
44
  # engagement: (String)
45
45
  # params: (Hash)
46
46
  def assign(company, team, engagement, params)
47
- @client.put '/otask/v1/tasks/companies/' + company + '/' + team + '/engagements/' + engagement, params
47
+ @client.put '/otask/v1/tasks/companies/' + company + '/teams/' + team + '/engagements/' + engagement + '/tasks', params
48
48
  end
49
49
 
50
50
  # Assign to specific engagement the list of activities
@@ -53,7 +53,7 @@ module Upwork
53
53
  # engagement_ref: (String)
54
54
  # params: (Hash)
55
55
  def assign_to_engagement(engagement_ref, params)
56
- @client.put '/tasks/v2/tasks/contracts/' + engagement_ref
56
+ @client.put '/tasks/v2/tasks/contracts/' + engagement_ref, params
57
57
  end
58
58
 
59
59
  end
@@ -44,7 +44,7 @@ module Upwork
44
44
  # reference: (String)
45
45
  def get_specific(reference)
46
46
  $LOG.i "running " + __method__.to_s
47
- @client.get '/hr/v4/contractors/applications' + reference
47
+ @client.get '/hr/v4/contractors/applications/' + reference
48
48
  end
49
49
  end
50
50
  end
@@ -44,7 +44,7 @@ module Upwork
44
44
  # reference: (String)
45
45
  def get_specific(reference)
46
46
  $LOG.i "running " + __method__.to_s
47
- @client.get '/offers/v1/clients/offers/' + reference
47
+ @client.get '/offers/v1/contractors/offers/' + reference
48
48
  end
49
49
 
50
50
  # Apply specific action
@@ -54,7 +54,7 @@ module Upwork
54
54
  # params: (Hash)
55
55
  def actions(reference, params)
56
56
  $LOG.i "running " + __method__.to_s
57
- @client.post '/offers/v1/clients/actions/' + reference, params
57
+ @client.post '/offers/v1/contractors/actions/' + reference, params
58
58
  end
59
59
  end
60
60
  end
@@ -47,6 +47,17 @@ module Upwork
47
47
  @client.get '/messages/v3/' + company + '/rooms/' + room_id, params
48
48
  end
49
49
 
50
+ # Get messages from a specific room
51
+ #
52
+ # Arguments:
53
+ # company: (String)
54
+ # room_id: (String)
55
+ # params: (Hash)
56
+ def get_room_messages(company, room_id, params = {})
57
+ $LOG.i "running " + __method__.to_s
58
+ @client.get '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params
59
+ end
60
+
50
61
  # Get a specific room by offer ID
51
62
  #
52
63
  # Arguments:
@@ -89,7 +100,7 @@ module Upwork
89
100
  $LOG.i "running " + __method__.to_s
90
101
  @client.post '/messages/v3/' + company + '/rooms', params
91
102
  end
92
-
103
+
93
104
  # Send a message to a room
94
105
  #
95
106
  # Arguments:
@@ -100,7 +111,17 @@ module Upwork
100
111
  $LOG.i "running " + __method__.to_s
101
112
  @client.post '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params
102
113
  end
103
-
114
+
115
+ # Send a message to a batch of rooms
116
+ #
117
+ # Arguments:
118
+ # company: (String)
119
+ # params: (Hash)
120
+ def send_message_to_rooms(company, params = {})
121
+ $LOG.i "running " + __method__.to_s
122
+ @client.post '/messages/v3/' + company + '/stories/batch', params
123
+ end
124
+
104
125
  # Update a room settings
105
126
  #
106
127
  # Arguments:
@@ -39,6 +39,18 @@ module Upwork
39
39
  @client.get '/profiles/v1/metadata/skills'
40
40
  end
41
41
 
42
+ # Get skills V2
43
+ def get_skills_v2(params)
44
+ $LOG.i "running " + __method__.to_s
45
+ @client.get '/profiles/v2/metadata/skills', params
46
+ end
47
+
48
+ # Get specialties
49
+ def get_specialties
50
+ $LOG.i "running " + __method__.to_s
51
+ @client.get '/profiles/v1/metadata/specialties'
52
+ end
53
+
42
54
  # Get regions
43
55
  def get_regions
44
56
  $LOG.i "running " + __method__.to_s
@@ -13,6 +13,6 @@
13
13
 
14
14
  module Upwork # :nodoc:
15
15
  module Api
16
- VERSION = "1.3.0"
16
+ VERSION = "1.3.5"
17
17
  end
18
18
  end
@@ -19,6 +19,11 @@ class MessagesTest < Test::Unit::TestCase
19
19
  assert api.get_room_details('company', 'room-id', {})
20
20
  end
21
21
 
22
+ def test_get_room_messages
23
+ api = Upwork::Api::Routers::Messages.new(get_client_mock)
24
+ assert api.get_room_messages('company', 'room-id', {})
25
+ end
26
+
22
27
  def test_get_room_by_offer
23
28
  api = Upwork::Api::Routers::Messages.new(get_client_mock)
24
29
  assert api.get_room_by_offer('company', '1234', {})
@@ -43,6 +48,11 @@ class MessagesTest < Test::Unit::TestCase
43
48
  api = Upwork::Api::Routers::Messages.new(get_client_mock)
44
49
  assert api.send_message_to_room('company', 'room-id', {})
45
50
  end
51
+
52
+ def test_send_message_to_rooms
53
+ api = Upwork::Api::Routers::Messages.new(get_client_mock)
54
+ assert api.send_message_to_rooms('company', {})
55
+ end
46
56
 
47
57
  def test_update_room_settings
48
58
  api = Upwork::Api::Routers::Messages.new(get_client_mock)
@@ -24,6 +24,16 @@ class MetadataTest < Test::Unit::TestCase
24
24
  assert api.get_skills
25
25
  end
26
26
 
27
+ def test_get_skills_v2
28
+ api = Upwork::Api::Routers::Metadata.new(get_client_mock)
29
+ assert api.get_skills_v2({})
30
+ end
31
+
32
+ def test_get_specialties
33
+ api = Upwork::Api::Routers::Metadata.new(get_client_mock)
34
+ assert api.get_specialties
35
+ end
36
+
27
37
  def test_get_categories_v2
28
38
  api = Upwork::Api::Routers::Metadata.new(get_client_mock)
29
39
  assert api.get_categories_v2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upwork-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maksym Novozhylov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-25 00:00:00.000000000 Z
11
+ date: 2020-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth
@@ -189,8 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubyforge_project:
193
- rubygems_version: 2.7.6
192
+ rubygems_version: 3.1.2
194
193
  signing_key:
195
194
  specification_version: 4
196
195
  summary: Ruby bindings for Upwork API.