ruby-upwork-oauth2 2.1.4 → 2.3.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.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +1 -1
- data/CHANGES.md +3 -0
- data/README.md +1 -15
- data/example/example.rb +7 -0
- data/lib/upwork/api/client.rb +10 -4
- data/lib/upwork/api/config.rb +2 -2
- data/lib/upwork/api/routers/activities/engagement.rb +3 -3
- data/lib/upwork/api/routers/activities/team.rb +5 -5
- data/lib/upwork/api/routers/auth.rb +2 -2
- data/lib/upwork/api/routers/freelancers/profile.rb +2 -2
- data/lib/upwork/api/routers/freelancers/search.rb +2 -2
- data/lib/upwork/api/routers/graphql.rb +38 -0
- data/lib/upwork/api/routers/hr/clients/applications.rb +2 -2
- data/lib/upwork/api/routers/hr/clients/offers.rb +3 -3
- data/lib/upwork/api/routers/hr/contracts.rb +3 -3
- data/lib/upwork/api/routers/hr/engagements.rb +3 -3
- data/lib/upwork/api/routers/hr/freelancers/applications.rb +2 -2
- data/lib/upwork/api/routers/hr/freelancers/offers.rb +3 -3
- data/lib/upwork/api/routers/hr/interviews.rb +2 -2
- data/lib/upwork/api/routers/hr/jobs.rb +6 -6
- data/lib/upwork/api/routers/hr/milestones.rb +7 -7
- data/lib/upwork/api/routers/hr/roles.rb +3 -3
- data/lib/upwork/api/routers/hr/submissions.rb +3 -3
- data/lib/upwork/api/routers/jobs/profile.rb +2 -2
- data/lib/upwork/api/routers/jobs/search.rb +2 -2
- data/lib/upwork/api/routers/messages.rb +11 -11
- data/lib/upwork/api/routers/metadata.rb +7 -7
- data/lib/upwork/api/routers/organization/companies.rb +5 -5
- data/lib/upwork/api/routers/organization/teams.rb +3 -3
- data/lib/upwork/api/routers/organization/users.rb +2 -2
- data/lib/upwork/api/routers/payments.rb +1 -1
- data/lib/upwork/api/routers/reports/finance/accounts.rb +3 -3
- data/lib/upwork/api/routers/reports/finance/billings.rb +6 -6
- data/lib/upwork/api/routers/reports/finance/earnings.rb +6 -6
- data/lib/upwork/api/routers/reports/time.rb +3 -3
- data/lib/upwork/api/routers/snapshot.rb +3 -3
- data/lib/upwork/api/routers/workdays.rb +2 -2
- data/lib/upwork/api/routers/workdiary.rb +2 -2
- data/lib/upwork/api/version.rb +1 -1
- data/ruby-upwork-oauth2.gemspec +1 -1
- data/test/test_activities_engagement.rb +6 -6
- data/test/test_activities_team.rb +14 -14
- data/test/test_auth.rb +3 -3
- data/test/test_freelancers_profile.rb +4 -4
- data/test/test_freelancers_search.rb +3 -3
- data/test/test_graphql.rb +16 -0
- data/test/test_hr_clients_applications.rb +5 -5
- data/test/test_hr_clients_offers.rb +6 -6
- data/test/test_hr_contracts.rb +6 -6
- data/test/test_hr_engagements.rb +5 -5
- data/test/test_hr_freelancers_applications.rb +5 -5
- data/test/test_hr_freelancers_offers.rb +6 -6
- data/test/test_hr_interviews.rb +3 -3
- data/test/test_hr_jobs.rb +11 -11
- data/test/test_hr_milestones.rb +14 -14
- data/test/test_hr_roles.rb +5 -5
- data/test/test_hr_submissions.rb +6 -6
- data/test/test_jobs_profile.rb +3 -3
- data/test/test_jobs_search.rb +3 -3
- data/test/test_messages.rb +22 -22
- data/test/test_metadata.rb +14 -14
- data/test/test_organization_companies.rb +9 -9
- data/test/test_organization_teams.rb +5 -5
- data/test/test_organization_users.rb +4 -4
- data/test/test_payments.rb +2 -2
- data/test/test_reports_finance_accounts.rb +5 -5
- data/test/test_reports_finance_billings.rb +11 -11
- data/test/test_reports_finance_earnings.rb +11 -11
- data/test/test_reports_time.rb +13 -13
- data/test/test_snapshot.rb +6 -6
- data/test/test_workdays.rb +4 -4
- data/test/test_workdiary.rb +2 -2
- metadata +13 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 714d57824d8e7e99ce8abfb0292feb999658487dc796645583ef0f37fbb79e4b
|
4
|
+
data.tar.gz: f6d723f4d3b7f46b5c389cc1db185f5064e648e1c2bc44ec62895942c7b62fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8edcd97947d2ccdcf59043db46f2e41a640a60bc4b091a801052841c978b6e17eb7896ff19045286e5518abed259c184570c0d14b72d67c50a5a9112da8b4a32
|
7
|
+
data.tar.gz: 7518ea1a6642682ded9da4fe7cc27cceb2e163b74f0d6a70bac74333e7a88b712d9bb0c3a0504875f524b88a35ab91ab8b52710a6339493986a8523ee50e23d9
|
data/.github/workflows/build.yml
CHANGED
data/CHANGES.md
CHANGED
data/README.md
CHANGED
@@ -12,21 +12,7 @@ This project provides a set of resources of Upwork API from http://developers.up
|
|
12
12
|
based on OAuth 2.0.
|
13
13
|
|
14
14
|
# Features
|
15
|
-
|
16
|
-
|
17
|
-
* My Info
|
18
|
-
* Custom Payments
|
19
|
-
* Hiring
|
20
|
-
* Job and Freelancer Profile
|
21
|
-
* Search Jobs and Freelancers
|
22
|
-
* Organization
|
23
|
-
* Messages
|
24
|
-
* Time and Financial Reporting
|
25
|
-
* Metadata
|
26
|
-
* Snapshot
|
27
|
-
* Team
|
28
|
-
* Workd Diary
|
29
|
-
* Activities
|
15
|
+
The library supports all GraphQL calls, which are publicly shared at Upwork
|
30
16
|
|
31
17
|
# License
|
32
18
|
|
data/example/example.rb
CHANGED
@@ -16,6 +16,7 @@ config = Upwork::Api::Config.new({
|
|
16
16
|
'client_id' => 'xxxxxxxx',
|
17
17
|
'client_secret' => 'xxxxxxxx',
|
18
18
|
'redirect_uri' => 'https://a.callback.url',
|
19
|
+
# 'grant_type' => 'client_credentials' # Client Credentials Grant
|
19
20
|
# 'access_token' => 'xxxxxxxx',
|
20
21
|
# 'refresh_token' => 'xxxxxxxx',
|
21
22
|
# 'expires_in' => '86399'
|
@@ -26,6 +27,7 @@ config = Upwork::Api::Config.new({
|
|
26
27
|
# setup client
|
27
28
|
client = Upwork::Api::Client.new(config)
|
28
29
|
|
30
|
+
# Code Authorization Grant
|
29
31
|
# run authorization in case we haven't done it yet
|
30
32
|
# and do not have an access and refresh token pair
|
31
33
|
if !config.access_token and !config.refresh_token
|
@@ -38,6 +40,11 @@ if !config.access_token and !config.refresh_token
|
|
38
40
|
# store access token data in safe place!
|
39
41
|
end
|
40
42
|
|
43
|
+
# Client Credentials Grant
|
44
|
+
if !config.access_token
|
45
|
+
@token = client.get_access_token
|
46
|
+
end
|
47
|
+
|
41
48
|
# WARNING: the access token will be refreshed automatically for you
|
42
49
|
# in case it's expired, i.e. expires_at < time(). Make sure you replace the
|
43
50
|
# old token accordingly in your security storage. Call client.get_actual_config
|
data/lib/upwork/api/client.rb
CHANGED
@@ -60,10 +60,16 @@ module Upwork
|
|
60
60
|
#
|
61
61
|
# Arguments:
|
62
62
|
# authz_code: (String)
|
63
|
-
def get_access_token(authz_code)
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
def get_access_token(authz_code = nil)
|
64
|
+
if @config.grant_type == 'client_credentials'
|
65
|
+
$LOG.i "getting access token"
|
66
|
+
@access_token = @oauth2_client.client_credentials.get_token
|
67
|
+
$LOG.i "got access token", @access_token
|
68
|
+
else
|
69
|
+
$LOG.i "getting access and refresh token pair"
|
70
|
+
@access_token = @oauth2_client.auth_code.get_token(authz_code, :redirect_uri => @config.redirect_uri)
|
71
|
+
$LOG.i "got access and refresh token pair", @access_token
|
72
|
+
end
|
67
73
|
|
68
74
|
refresh_config_from_access_token
|
69
75
|
|
data/lib/upwork/api/config.rb
CHANGED
@@ -18,14 +18,14 @@ module Upwork
|
|
18
18
|
@@debug = false;
|
19
19
|
|
20
20
|
attr_accessor :access_token, :refresh_token, :expires_in, :expires_at
|
21
|
-
attr_reader :client_id, :client_secret, :redirect_uri
|
21
|
+
attr_reader :client_id, :client_secret, :redirect_uri, :grant_type
|
22
22
|
|
23
23
|
# Init config object
|
24
24
|
#
|
25
25
|
# Arguments:
|
26
26
|
# config: (Hash)
|
27
27
|
def initialize(config = {})
|
28
|
-
@client_id, @client_secret, @redirect_uri = config['client_id'], config['client_secret'], config['redirect_uri']
|
28
|
+
@client_id, @client_secret, @redirect_uri, @grant_type = config['client_id'], config['client_secret'], config['redirect_uri'], config['grant_type']
|
29
29
|
@access_token, @refresh_token, @expires_in, @expires_at = config['access_token'], config['refresh_token'], config['expires_in'], config['expires_at']
|
30
30
|
@@debug = config['debug']
|
31
31
|
|
@@ -33,7 +33,7 @@ module Upwork
|
|
33
33
|
# Arguments:
|
34
34
|
# engagement_ref: (String)
|
35
35
|
def get_specific(engagement_ref)
|
36
|
-
|
36
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
37
37
|
end
|
38
38
|
|
39
39
|
# Assign engagements to the list of activities
|
@@ -44,7 +44,7 @@ module Upwork
|
|
44
44
|
# engagement: (String)
|
45
45
|
# params: (Hash)
|
46
46
|
def assign(company, team, engagement, params)
|
47
|
-
|
47
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
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
|
-
|
56
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
57
57
|
end
|
58
58
|
|
59
59
|
end
|
@@ -54,7 +54,7 @@ module Upwork
|
|
54
54
|
# team: (String)
|
55
55
|
# params: (Hash)
|
56
56
|
def add_activity(company, team, params)
|
57
|
-
|
57
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
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
|
-
|
68
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
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
|
-
|
78
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
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
|
-
|
88
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
89
89
|
end
|
90
90
|
|
91
91
|
# Update a group of oTask/Activity records within a company
|
@@ -94,7 +94,7 @@ module Upwork
|
|
94
94
|
# company: (String)
|
95
95
|
# params: (Hash)
|
96
96
|
def update_batch(company, params)
|
97
|
-
|
97
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
98
98
|
end
|
99
99
|
|
100
100
|
private
|
@@ -30,9 +30,9 @@ module Upwork
|
|
30
30
|
# Get info of authenticated user
|
31
31
|
def get_user_info
|
32
32
|
$LOG.i "running " + __method__.to_s
|
33
|
-
|
33
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
|
-
end
|
38
|
+
end
|
@@ -34,7 +34,7 @@ module Upwork
|
|
34
34
|
# key: (String)
|
35
35
|
def get_specific(key)
|
36
36
|
$LOG.i "running " + __method__.to_s
|
37
|
-
|
37
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
38
38
|
end
|
39
39
|
|
40
40
|
# Get brief info on specific profile
|
@@ -42,7 +42,7 @@ module Upwork
|
|
42
42
|
# Arguments:
|
43
43
|
# key: (String)
|
44
44
|
def get_specific_brief(key)
|
45
|
-
|
45
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
46
46
|
@client.get '/profiles/v1/providers/' + key + '/brief'
|
47
47
|
end
|
48
48
|
end
|
@@ -34,10 +34,10 @@ module Upwork
|
|
34
34
|
# params: (Hash)
|
35
35
|
def find(params)
|
36
36
|
$LOG.i "running " + __method__.to_s
|
37
|
-
|
37
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Licensed under the Upwork'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@upwork.com)
|
11
|
+
# Copyright:: Copyright 2021(c) Upwork.com
|
12
|
+
# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
|
13
|
+
|
14
|
+
module Upwork
|
15
|
+
module Api
|
16
|
+
module Routers
|
17
|
+
# Execute GraphQL requests
|
18
|
+
class Graphql
|
19
|
+
ENTRY_POINT = 'graphql'
|
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
|
+
# Execute GraphQL request
|
31
|
+
def execute(params)
|
32
|
+
$LOG.i "running " + __method__.to_s
|
33
|
+
@client.post '', params
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -35,7 +35,7 @@ module Upwork
|
|
35
35
|
# params: (Hash)
|
36
36
|
def get_list(params)
|
37
37
|
$LOG.i "running " + __method__.to_s
|
38
|
-
|
38
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
39
39
|
end
|
40
40
|
|
41
41
|
# Get specific application
|
@@ -45,7 +45,7 @@ module Upwork
|
|
45
45
|
# params: (Hash)
|
46
46
|
def get_specific(reference, params)
|
47
47
|
$LOG.i "running " + __method__.to_s
|
48
|
-
|
48
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -35,7 +35,7 @@ module Upwork
|
|
35
35
|
# params: (Hash)
|
36
36
|
def get_list(params)
|
37
37
|
$LOG.i "running " + __method__.to_s
|
38
|
-
|
38
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
39
39
|
end
|
40
40
|
|
41
41
|
# Get specific offer
|
@@ -45,7 +45,7 @@ module Upwork
|
|
45
45
|
# params: (Hash)
|
46
46
|
def get_specific(reference, params)
|
47
47
|
$LOG.i "running " + __method__.to_s
|
48
|
-
|
48
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
49
49
|
end
|
50
50
|
|
51
51
|
# Make an Offer
|
@@ -54,7 +54,7 @@ module Upwork
|
|
54
54
|
# params: (Hash)
|
55
55
|
def make_offer(params)
|
56
56
|
$LOG.i "running " + __method__.to_s
|
57
|
-
|
57
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -35,7 +35,7 @@ module Upwork
|
|
35
35
|
# params: (Hash)
|
36
36
|
def suspend_contract(reference, params)
|
37
37
|
$LOG.i "running " + __method__.to_s
|
38
|
-
|
38
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
39
39
|
end
|
40
40
|
|
41
41
|
# Restart Contract
|
@@ -45,7 +45,7 @@ module Upwork
|
|
45
45
|
# params: (Hash)
|
46
46
|
def restart_contract(reference, params)
|
47
47
|
$LOG.i "running " + __method__.to_s
|
48
|
-
|
48
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
49
49
|
end
|
50
50
|
|
51
51
|
# End Contract
|
@@ -55,7 +55,7 @@ module Upwork
|
|
55
55
|
# params: (Hash)
|
56
56
|
def end_contract(reference, params)
|
57
57
|
$LOG.i "running " + __method__.to_s
|
58
|
-
|
58
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -34,7 +34,7 @@ module Upwork
|
|
34
34
|
# params: (Hash)
|
35
35
|
def get_list(params)
|
36
36
|
$LOG.i "running " + __method__.to_s
|
37
|
-
|
37
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
38
38
|
end
|
39
39
|
|
40
40
|
# Get specific engagement
|
@@ -43,10 +43,10 @@ module Upwork
|
|
43
43
|
# reference: (String)
|
44
44
|
def get_specific(reference)
|
45
45
|
$LOG.i "running " + __method__.to_s
|
46
|
-
|
46
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
|
-
end
|
52
|
+
end
|
@@ -35,7 +35,7 @@ module Upwork
|
|
35
35
|
# params: (Hash)
|
36
36
|
def get_list(params = {})
|
37
37
|
$LOG.i "running " + __method__.to_s
|
38
|
-
|
38
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
39
39
|
end
|
40
40
|
|
41
41
|
# Get specific application
|
@@ -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
|
-
|
47
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -35,7 +35,7 @@ module Upwork
|
|
35
35
|
# params: (Hash)
|
36
36
|
def get_list(params = {})
|
37
37
|
$LOG.i "running " + __method__.to_s
|
38
|
-
|
38
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
39
39
|
end
|
40
40
|
|
41
41
|
# Get specific offer
|
@@ -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
|
-
|
47
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
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
|
-
|
57
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -35,10 +35,10 @@ module Upwork
|
|
35
35
|
# params: (Hash)
|
36
36
|
def invite(job_key, params)
|
37
37
|
$LOG.i "running " + __method__.to_s
|
38
|
-
|
38
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
|
-
end
|
44
|
+
end
|
@@ -34,7 +34,7 @@ module Upwork
|
|
34
34
|
# params: (Hash)
|
35
35
|
def get_list(params)
|
36
36
|
$LOG.i "running " + __method__.to_s
|
37
|
-
|
37
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
38
38
|
end
|
39
39
|
|
40
40
|
# Get specific job by key
|
@@ -43,7 +43,7 @@ module Upwork
|
|
43
43
|
# key: (String)
|
44
44
|
def get_specific(key)
|
45
45
|
$LOG.i "running " + __method__.to_s
|
46
|
-
|
46
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
47
47
|
end
|
48
48
|
|
49
49
|
# Post a new job
|
@@ -52,7 +52,7 @@ module Upwork
|
|
52
52
|
# params: (Hash)
|
53
53
|
def post_job(params)
|
54
54
|
$LOG.i "running " + __method__.to_s
|
55
|
-
|
55
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
56
56
|
end
|
57
57
|
|
58
58
|
# Edit existent job
|
@@ -61,7 +61,7 @@ module Upwork
|
|
61
61
|
# params: (Hash)
|
62
62
|
def edit_job(key, params)
|
63
63
|
$LOG.i "running " + __method__.to_s
|
64
|
-
|
64
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
65
65
|
end
|
66
66
|
|
67
67
|
# Delete existent job
|
@@ -70,10 +70,10 @@ module Upwork
|
|
70
70
|
# params: (Hash)
|
71
71
|
def delete_job(key, params)
|
72
72
|
$LOG.i "running " + __method__.to_s
|
73
|
-
|
73
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
79
|
-
end
|
79
|
+
end
|
@@ -34,7 +34,7 @@ module Upwork
|
|
34
34
|
# contract_id: (String)
|
35
35
|
def get_active_milestone(contract_id)
|
36
36
|
$LOG.i "running " + __method__.to_s
|
37
|
-
|
37
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
38
38
|
end
|
39
39
|
|
40
40
|
# Get active Milestone for specific Contract
|
@@ -43,7 +43,7 @@ module Upwork
|
|
43
43
|
# milestone_id: (String)
|
44
44
|
def get_submissions(milestone_id)
|
45
45
|
$LOG.i "running " + __method__.to_s
|
46
|
-
|
46
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
47
47
|
end
|
48
48
|
|
49
49
|
# Create a new Milestone
|
@@ -52,7 +52,7 @@ module Upwork
|
|
52
52
|
# params: (Hash)
|
53
53
|
def create(params)
|
54
54
|
$LOG.i "running " + __method__.to_s
|
55
|
-
|
55
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
56
56
|
end
|
57
57
|
|
58
58
|
# Edit an existing Milestone
|
@@ -62,7 +62,7 @@ module Upwork
|
|
62
62
|
# params: (Hash)
|
63
63
|
def edit(milestone_id, params)
|
64
64
|
$LOG.i "running " + __method__.to_s
|
65
|
-
|
65
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
66
66
|
end
|
67
67
|
|
68
68
|
# Activate an existing Milestone
|
@@ -72,7 +72,7 @@ module Upwork
|
|
72
72
|
# params: (Hash)
|
73
73
|
def activate(milestone_id, params)
|
74
74
|
$LOG.i "running " + __method__.to_s
|
75
|
-
|
75
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
76
76
|
end
|
77
77
|
|
78
78
|
# Approve an existing Milestone
|
@@ -82,7 +82,7 @@ module Upwork
|
|
82
82
|
# params: (Hash)
|
83
83
|
def approve(milestone_id, params)
|
84
84
|
$LOG.i "running " + __method__.to_s
|
85
|
-
|
85
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
86
86
|
end
|
87
87
|
|
88
88
|
# Delete an existing Milestone
|
@@ -91,7 +91,7 @@ module Upwork
|
|
91
91
|
# milestone_id: (String)
|
92
92
|
def delete(milestone_id)
|
93
93
|
$LOG.i "running " + __method__.to_s
|
94
|
-
|
94
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
95
95
|
end
|
96
96
|
end
|
97
97
|
end
|
@@ -31,7 +31,7 @@ module Upwork
|
|
31
31
|
# Get user roles
|
32
32
|
def get_all
|
33
33
|
$LOG.i "running " + __method__.to_s
|
34
|
-
|
34
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
35
35
|
end
|
36
36
|
|
37
37
|
# Get by specific user
|
@@ -40,10 +40,10 @@ module Upwork
|
|
40
40
|
# reference: (String)
|
41
41
|
def get_by_specific_user(user_reference)
|
42
42
|
$LOG.i "running " + __method__.to_s
|
43
|
-
|
43
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
49
|
-
end
|
49
|
+
end
|
@@ -34,7 +34,7 @@ module Upwork
|
|
34
34
|
# params: (Hash)
|
35
35
|
def request_approval(params)
|
36
36
|
$LOG.i "running " + __method__.to_s
|
37
|
-
|
37
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
38
38
|
end
|
39
39
|
|
40
40
|
# Approve an existing Submission
|
@@ -44,7 +44,7 @@ module Upwork
|
|
44
44
|
# params: (Hash)
|
45
45
|
def approve(submission_id, params)
|
46
46
|
$LOG.i "running " + __method__.to_s
|
47
|
-
|
47
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
48
48
|
end
|
49
49
|
|
50
50
|
# Reject an existing Submission
|
@@ -54,7 +54,7 @@ module Upwork
|
|
54
54
|
# params: (Hash)
|
55
55
|
def reject(submission_id, params)
|
56
56
|
$LOG.i "running " + __method__.to_s
|
57
|
-
|
57
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -34,10 +34,10 @@ module Upwork
|
|
34
34
|
# key: (String)
|
35
35
|
def get_specific(key)
|
36
36
|
$LOG.i "running " + __method__.to_s
|
37
|
-
|
37
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end
|
@@ -34,10 +34,10 @@ module Upwork
|
|
34
34
|
# params: (Hash)
|
35
35
|
def find(params)
|
36
36
|
$LOG.i "running " + __method__.to_s
|
37
|
-
|
37
|
+
raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end
|