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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +1 -1
  3. data/CHANGES.md +3 -0
  4. data/README.md +1 -15
  5. data/example/example.rb +7 -0
  6. data/lib/upwork/api/client.rb +10 -4
  7. data/lib/upwork/api/config.rb +2 -2
  8. data/lib/upwork/api/routers/activities/engagement.rb +3 -3
  9. data/lib/upwork/api/routers/activities/team.rb +5 -5
  10. data/lib/upwork/api/routers/auth.rb +2 -2
  11. data/lib/upwork/api/routers/freelancers/profile.rb +2 -2
  12. data/lib/upwork/api/routers/freelancers/search.rb +2 -2
  13. data/lib/upwork/api/routers/graphql.rb +38 -0
  14. data/lib/upwork/api/routers/hr/clients/applications.rb +2 -2
  15. data/lib/upwork/api/routers/hr/clients/offers.rb +3 -3
  16. data/lib/upwork/api/routers/hr/contracts.rb +3 -3
  17. data/lib/upwork/api/routers/hr/engagements.rb +3 -3
  18. data/lib/upwork/api/routers/hr/freelancers/applications.rb +2 -2
  19. data/lib/upwork/api/routers/hr/freelancers/offers.rb +3 -3
  20. data/lib/upwork/api/routers/hr/interviews.rb +2 -2
  21. data/lib/upwork/api/routers/hr/jobs.rb +6 -6
  22. data/lib/upwork/api/routers/hr/milestones.rb +7 -7
  23. data/lib/upwork/api/routers/hr/roles.rb +3 -3
  24. data/lib/upwork/api/routers/hr/submissions.rb +3 -3
  25. data/lib/upwork/api/routers/jobs/profile.rb +2 -2
  26. data/lib/upwork/api/routers/jobs/search.rb +2 -2
  27. data/lib/upwork/api/routers/messages.rb +11 -11
  28. data/lib/upwork/api/routers/metadata.rb +7 -7
  29. data/lib/upwork/api/routers/organization/companies.rb +5 -5
  30. data/lib/upwork/api/routers/organization/teams.rb +3 -3
  31. data/lib/upwork/api/routers/organization/users.rb +2 -2
  32. data/lib/upwork/api/routers/payments.rb +1 -1
  33. data/lib/upwork/api/routers/reports/finance/accounts.rb +3 -3
  34. data/lib/upwork/api/routers/reports/finance/billings.rb +6 -6
  35. data/lib/upwork/api/routers/reports/finance/earnings.rb +6 -6
  36. data/lib/upwork/api/routers/reports/time.rb +3 -3
  37. data/lib/upwork/api/routers/snapshot.rb +3 -3
  38. data/lib/upwork/api/routers/workdays.rb +2 -2
  39. data/lib/upwork/api/routers/workdiary.rb +2 -2
  40. data/lib/upwork/api/version.rb +1 -1
  41. data/ruby-upwork-oauth2.gemspec +1 -1
  42. data/test/test_activities_engagement.rb +6 -6
  43. data/test/test_activities_team.rb +14 -14
  44. data/test/test_auth.rb +3 -3
  45. data/test/test_freelancers_profile.rb +4 -4
  46. data/test/test_freelancers_search.rb +3 -3
  47. data/test/test_graphql.rb +16 -0
  48. data/test/test_hr_clients_applications.rb +5 -5
  49. data/test/test_hr_clients_offers.rb +6 -6
  50. data/test/test_hr_contracts.rb +6 -6
  51. data/test/test_hr_engagements.rb +5 -5
  52. data/test/test_hr_freelancers_applications.rb +5 -5
  53. data/test/test_hr_freelancers_offers.rb +6 -6
  54. data/test/test_hr_interviews.rb +3 -3
  55. data/test/test_hr_jobs.rb +11 -11
  56. data/test/test_hr_milestones.rb +14 -14
  57. data/test/test_hr_roles.rb +5 -5
  58. data/test/test_hr_submissions.rb +6 -6
  59. data/test/test_jobs_profile.rb +3 -3
  60. data/test/test_jobs_search.rb +3 -3
  61. data/test/test_messages.rb +22 -22
  62. data/test/test_metadata.rb +14 -14
  63. data/test/test_organization_companies.rb +9 -9
  64. data/test/test_organization_teams.rb +5 -5
  65. data/test/test_organization_users.rb +4 -4
  66. data/test/test_payments.rb +2 -2
  67. data/test/test_reports_finance_accounts.rb +5 -5
  68. data/test/test_reports_finance_billings.rb +11 -11
  69. data/test/test_reports_finance_earnings.rb +11 -11
  70. data/test/test_reports_time.rb +13 -13
  71. data/test/test_snapshot.rb +6 -6
  72. data/test/test_workdays.rb +4 -4
  73. data/test/test_workdiary.rb +2 -2
  74. metadata +13 -10
@@ -33,7 +33,7 @@ module Upwork
33
33
  # params: (Hash)
34
34
  def get_rooms(company, params = {})
35
35
  $LOG.i "running " + __method__.to_s
36
- @client.get '/messages/v3/' + company + '/rooms', params
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
  # Get a specific room information
@@ -44,7 +44,7 @@ module Upwork
44
44
  # params: (Hash)
45
45
  def get_room_details(company, room_id, params = {})
46
46
  $LOG.i "running " + __method__.to_s
47
- @client.get '/messages/v3/' + company + '/rooms/' + room_id, params
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
  # Get messages from a specific room
@@ -55,7 +55,7 @@ module Upwork
55
55
  # params: (Hash)
56
56
  def get_room_messages(company, room_id, params = {})
57
57
  $LOG.i "running " + __method__.to_s
58
- @client.get '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params
58
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
59
59
  end
60
60
 
61
61
  # Get a specific room by offer ID
@@ -66,7 +66,7 @@ module Upwork
66
66
  # params: (Hash)
67
67
  def get_room_by_offer(company, offer_id, params = {})
68
68
  $LOG.i "running " + __method__.to_s
69
- @client.get '/messages/v3/' + company + '/rooms/offers/' + offer_id, params
69
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
70
70
  end
71
71
 
72
72
  # Get a specific room by application ID
@@ -77,7 +77,7 @@ module Upwork
77
77
  # params: (Hash)
78
78
  def get_room_by_application(company, application_id, params = {})
79
79
  $LOG.i "running " + __method__.to_s
80
- @client.get '/messages/v3/' + company + '/rooms/applications/' + application_id, params
80
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
81
81
  end
82
82
 
83
83
  # Get a specific room by contract ID
@@ -88,7 +88,7 @@ module Upwork
88
88
  # params: (Hash)
89
89
  def get_room_by_contract(company, contract_id, params = {})
90
90
  $LOG.i "running " + __method__.to_s
91
- @client.get '/messages/v3/' + company + '/rooms/contracts/' + contract_id, params
91
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
92
92
  end
93
93
 
94
94
  # Create a new room
@@ -98,7 +98,7 @@ module Upwork
98
98
  # params: (Hash)
99
99
  def create_room(company, params = {})
100
100
  $LOG.i "running " + __method__.to_s
101
- @client.post '/messages/v3/' + company + '/rooms', params
101
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
102
102
  end
103
103
 
104
104
  # Send a message to a room
@@ -109,7 +109,7 @@ module Upwork
109
109
  # params: (Hash)
110
110
  def send_message_to_room(company, room_id, params = {})
111
111
  $LOG.i "running " + __method__.to_s
112
- @client.post '/messages/v3/' + company + '/rooms/' + room_id + '/stories', params
112
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
113
113
  end
114
114
 
115
115
  # Send a message to a batch of rooms
@@ -119,7 +119,7 @@ module Upwork
119
119
  # params: (Hash)
120
120
  def send_message_to_rooms(company, params = {})
121
121
  $LOG.i "running " + __method__.to_s
122
- @client.post '/messages/v3/' + company + '/stories/batch', params
122
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
123
123
  end
124
124
 
125
125
  # Update a room settings
@@ -131,7 +131,7 @@ module Upwork
131
131
  # params: (Hash)
132
132
  def update_room_settings(company, room_id, username, params = {})
133
133
  $LOG.i "running " + __method__.to_s
134
- @client.put '/messages/v3/' + company + '/rooms/' + room_id + '/users/' + username, params
134
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
135
135
  end
136
136
 
137
137
  # Update the metadata of a room
@@ -142,7 +142,7 @@ module Upwork
142
142
  # params: (Hash)
143
143
  def update_room_metadata(company, room_id, params = {})
144
144
  $LOG.i "running " + __method__.to_s
145
- @client.put '/messages/v3/' + company + '/rooms/' + room_id, params
145
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
146
146
  end
147
147
  end
148
148
  end
@@ -30,37 +30,37 @@ module Upwork
30
30
  # Get categories (v2)
31
31
  def get_categories_v2
32
32
  $LOG.i "running " + __method__.to_s
33
- @client.get '/profiles/v2/metadata/categories'
33
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
34
34
  end
35
35
 
36
36
  # Get skills
37
37
  def get_skills
38
38
  $LOG.i "running " + __method__.to_s
39
- @client.get '/profiles/v1/metadata/skills'
39
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
40
40
  end
41
41
 
42
42
  # Get skills V2
43
43
  def get_skills_v2(params)
44
44
  $LOG.i "running " + __method__.to_s
45
- @client.get '/profiles/v2/metadata/skills'
45
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
46
46
  end
47
47
 
48
48
  # Get specialties
49
49
  def get_specialties
50
50
  $LOG.i "running " + __method__.to_s
51
- @client.get '/profiles/v1/metadata/specialties'
51
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
52
52
  end
53
53
 
54
54
  # Get regions
55
55
  def get_regions
56
56
  $LOG.i "running " + __method__.to_s
57
- @client.get '/profiles/v1/metadata/regions'
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
  # Get tests
61
61
  def get_tests
62
62
  $LOG.i "running " + __method__.to_s
63
- @client.get '/profiles/v1/metadata/tests'
63
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
64
64
  end
65
65
 
66
66
  # Get reasons
@@ -69,7 +69,7 @@ module Upwork
69
69
  # params: (Hash)
70
70
  def get_reasons(params)
71
71
  $LOG.i "running " + __method__.to_s
72
- @client.get '/profiles/v1/metadata/reasons', params;
72
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
73
73
  end
74
74
  end
75
75
  end
@@ -31,7 +31,7 @@ module Upwork
31
31
  # Get Companies Info
32
32
  def get_list
33
33
  $LOG.i "running " + __method__.to_s
34
- @client.get '/hr/v2/companies'
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 Specific Company
@@ -40,7 +40,7 @@ module Upwork
40
40
  # company_reference: (String)
41
41
  def get_specific(company_reference)
42
42
  $LOG.i "running " + __method__.to_s
43
- @client.get '/hr/v2/companies/' + company_reference
43
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
44
44
  end
45
45
 
46
46
  # Get Teams in Company
@@ -49,7 +49,7 @@ module Upwork
49
49
  # company_reference: (String)
50
50
  def get_teams(company_reference)
51
51
  $LOG.i "running " + __method__.to_s
52
- @client.get '/hr/v2/companies/' + company_reference + '/teams'
52
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
53
53
  end
54
54
 
55
55
  # Get Users in Company
@@ -58,10 +58,10 @@ module Upwork
58
58
  # company_reference: (String)
59
59
  def get_users(company_reference)
60
60
  $LOG.i "running " + __method__.to_s
61
- @client.get '/hr/v2/companies/' + company_reference + '/users'
61
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
62
62
  end
63
63
  end
64
64
  end
65
65
  end
66
66
  end
67
- end
67
+ end
@@ -31,7 +31,7 @@ module Upwork
31
31
  # Get Teams info
32
32
  def get_list
33
33
  $LOG.i "running " + __method__.to_s
34
- @client.get '/hr/v2/teams'
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 Users in Team
@@ -40,10 +40,10 @@ module Upwork
40
40
  # team_reference: (String)
41
41
  def get_users_in_team(team_reference)
42
42
  $LOG.i "running " + __method__.to_s
43
- @client.get '/hr/v2/teams/' + team_reference + '/users'
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
@@ -31,7 +31,7 @@ module Upwork
31
31
  # Get Auth User Info
32
32
  def get_my_info
33
33
  $LOG.i "running " + __method__.to_s
34
- @client.get '/hr/v2/users/me'
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 Specific User Info
@@ -40,7 +40,7 @@ module Upwork
40
40
  # user_reference: (String)
41
41
  def get_specific(user_reference)
42
42
  $LOG.i "running " + __method__.to_s
43
- @client.get '/hr/v2/users/' + user_reference
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
@@ -34,7 +34,7 @@ module Upwork
34
34
  # params: (Hash)
35
35
  def submit_bonus(team_reference, params)
36
36
  $LOG.i "running " + __method__.to_s
37
- @client.post '/hr/v2/teams/' + team_reference + '/adjustments', params
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
@@ -36,7 +36,7 @@ module Upwork
36
36
  # params: (Hash)
37
37
  def get_owned(freelancer_reference, params)
38
38
  $LOG.i "running " + __method__.to_s
39
- @client.get '/finreports/v2/financial_account_owner/' + freelancer_reference, params
39
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
40
40
  end
41
41
 
42
42
  # Generate Financial Reports for a Specific Account
@@ -46,11 +46,11 @@ module Upwork
46
46
  # params: (Hash)
47
47
  def get_specific(entity_reference, params)
48
48
  $LOG.i "running " + __method__.to_s
49
- @client.get '/finreports/v2/financial_accounts/' + entity_reference, params
49
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
50
50
  end
51
51
  end
52
52
  end
53
53
  end
54
54
  end
55
55
  end
56
- end
56
+ end
@@ -36,7 +36,7 @@ module Upwork
36
36
  # params: (Hash)
37
37
  def get_by_freelancer(freelancer_reference, params)
38
38
  $LOG.i "running " + __method__.to_s
39
- @client.get '/finreports/v2/providers/' + freelancer_reference + '/billings', params
39
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
40
40
  end
41
41
 
42
42
  # Generate Billing Reports for a Specific Freelancer's Team
@@ -46,7 +46,7 @@ module Upwork
46
46
  # params: (Hash)
47
47
  def get_by_freelancers_team(freelancer_team_reference, params)
48
48
  $LOG.i "running " + __method__.to_s
49
- @client.get '/finreports/v2/provider_teams/' + freelancer_team_reference + '/billings', params
49
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
50
50
  end
51
51
 
52
52
  # Generate Billing Reports for a Specific Freelancer's Company
@@ -56,7 +56,7 @@ module Upwork
56
56
  # params: (Hash)
57
57
  def get_by_freelancers_company(freelancer_company_reference, params)
58
58
  $LOG.i "running " + __method__.to_s
59
- @client.get '/finreports/v2/provider_companies/' + freelancer_company_reference + '/billings', params
59
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
60
60
  end
61
61
 
62
62
  # Generate Billing Reports for a Specific Buyer's Team
@@ -66,7 +66,7 @@ module Upwork
66
66
  # params: (Hash)
67
67
  def get_by_buyers_team(buyer_team_reference, params)
68
68
  $LOG.i "running " + __method__.to_s
69
- @client.get '/finreports/v2/buyer_teams/' + buyer_team_reference + '/billings', params
69
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
70
70
  end
71
71
 
72
72
  # Generate Billing Reports for a Specific Buyer's Company
@@ -76,11 +76,11 @@ module Upwork
76
76
  # params: (Hash)
77
77
  def get_by_buyers_company(buyer_company_reference, params)
78
78
  $LOG.i "running " + __method__.to_s
79
- @client.get '/finreports/v2/buyer_companies/' + buyer_company_reference + '/billings', params
79
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
80
80
  end
81
81
  end
82
82
  end
83
83
  end
84
84
  end
85
85
  end
86
- end
86
+ end
@@ -36,7 +36,7 @@ module Upwork
36
36
  # params: (Hash)
37
37
  def get_by_freelancer(freelancer_reference, params)
38
38
  $LOG.i "running " + __method__.to_s
39
- @client.get '/finreports/v2/providers/' + freelancer_reference + '/earnings', params
39
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
40
40
  end
41
41
 
42
42
  # Generate Earning Reports for a Specific Freelancer's Team
@@ -46,7 +46,7 @@ module Upwork
46
46
  # params: (Hash)
47
47
  def get_by_freelancers_team(freelancer_team_reference, params)
48
48
  $LOG.i "running " + __method__.to_s
49
- @client.get '/finreports/v2/provider_teams/' + freelancer_team_reference + '/earnings', params
49
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
50
50
  end
51
51
 
52
52
  # Generate Earning Reports for a Specific Freelancer's Company
@@ -56,7 +56,7 @@ module Upwork
56
56
  # params: (Hash)
57
57
  def get_by_freelancers_company(freelancer_company_reference, params)
58
58
  $LOG.i "running " + __method__.to_s
59
- @client.get '/finreports/v2/provider_companies/' + freelancer_company_reference + '/earnings', params
59
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
60
60
  end
61
61
 
62
62
  # Generate Earning Reports for a Specific Buyer's Team
@@ -66,7 +66,7 @@ module Upwork
66
66
  # params: (Hash)
67
67
  def get_by_buyers_team(buyer_team_reference, params)
68
68
  $LOG.i "running " + __method__.to_s
69
- @client.get '/finreports/v2/buyer_teams/' + buyer_team_reference + '/earnings', params
69
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
70
70
  end
71
71
 
72
72
  # Generate Earning Reports for a Specific Buyer's Company
@@ -76,11 +76,11 @@ module Upwork
76
76
  # params: (Hash)
77
77
  def get_by_buyers_company(buyer_company_reference, params)
78
78
  $LOG.i "running " + __method__.to_s
79
- @client.get '/finreports/v2/buyer_companies/' + buyer_company_reference + '/earnings', params
79
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
80
80
  end
81
81
  end
82
82
  end
83
83
  end
84
84
  end
85
85
  end
86
- end
86
+ end
@@ -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 + '/hours', params
81
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
82
82
  end
83
83
 
84
84
  # Generating Freelancer's Specific Reports (with financial info)
@@ -88,7 +88,7 @@ module Upwork
88
88
  # params: (Hash)
89
89
  def get_by_freelancer_full(freelancer_id, params)
90
90
  $LOG.i "running " + __method__.to_s
91
- @client.get '/timereports/v1/providers/' + freelancer_id, params
91
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
92
92
  end
93
93
 
94
94
  private
@@ -105,7 +105,7 @@ module Upwork
105
105
  url = '/agencies/' + agency
106
106
  end
107
107
 
108
- @client.get '/timereports/v1/companies/' + company + url, params
108
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
109
109
  end
110
110
  end
111
111
  end
@@ -34,7 +34,7 @@ module Upwork
34
34
  # ts: (String)
35
35
  def get_by_contract(contract, ts)
36
36
  $LOG.i "running " + __method__.to_s
37
- @client.get '/team/v3/snapshots/contracts/' + contract + '/' + ts
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
  # Update snapshot by specific contract
@@ -45,7 +45,7 @@ module Upwork
45
45
  # params: (Hash)
46
46
  def update_by_contract(contract, ts, params)
47
47
  $LOG.i "running " + __method__.to_s
48
- @client.put '/team/v3/snapshots/contracts/' + contract + '/' + ts, params
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
  # Delete snapshot by specific contract
@@ -54,7 +54,7 @@ module Upwork
54
54
  # ts: (String)
55
55
  def delete_by_contract(contract, ts)
56
56
  $LOG.i "running " + __method__.to_s
57
- @client.delete '/team/v3/snapshots/contracts/' + contract + '/' + ts
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 get_by_company(company, from_date, till_date, params = {})
37
37
  $LOG.i "running " + __method__.to_s
38
- @client.get '/team/v3/workdays/companies/' + company + '/' + from_date + ',' + till_date, params
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 Workdays by Contract
@@ -46,7 +46,7 @@ module Upwork
46
46
  # params: (Hash)
47
47
  def get_by_contract(contract, from_date, till_date, params = {})
48
48
  $LOG.i "running " + __method__.to_s
49
- @client.get '/team/v3/workdays/contracts/' + contract + '/' + from_date + ',' + till_date, params
49
+ raise StandardError.new "The legacy API was deprecated. Please, use GraphQL call - see example in this library."
50
50
  end
51
51
  end
52
52
  end
@@ -34,7 +34,7 @@ module Upwork
34
34
  # params: (Hash)
35
35
  def get(company, date, params = {})
36
36
  $LOG.i "running " + __method__.to_s
37
- @client.get '/team/v3/workdiaries/companies/' + company + '/' + date, params
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 Work Diary by Contract
@@ -44,7 +44,7 @@ module Upwork
44
44
  # params: (Hash)
45
45
  def get_by_contract(contract, date, params = {})
46
46
  $LOG.i "running " + __method__.to_s
47
- @client.get '/team/v3/workdiaries/contracts/' + contract + '/' + date, params
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
@@ -13,6 +13,6 @@
13
13
 
14
14
  module Upwork # :nodoc:
15
15
  module Api
16
- VERSION = "2.1.4"
16
+ VERSION = "2.3.0"
17
17
  end
18
18
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_development_dependency "bundler", "~> 2.2", ">= 2.2.10"
23
+ spec.add_development_dependency "bundler", "~> 2.5", ">= 2.5.23"
24
24
  spec.add_development_dependency "rake", "~>12.3", ">= 12.3.3"
25
25
  spec.add_development_dependency "mocha", "~> 0"
26
26
  spec.add_development_dependency "test-unit", "~> 0"
@@ -10,17 +10,17 @@ class ActivitiesEngagementTest < Test::Unit::TestCase
10
10
  include TestHelper
11
11
 
12
12
  def test_get_specific
13
- api = Upwork::Api::Routers::Activities::Engagement.new(get_client_mock)
14
- assert api.get_specific('1234')
13
+ #api = Upwork::Api::Routers::Activities::Engagement.new(get_client_mock)
14
+ #assert api.get_specific('1234')
15
15
  end
16
16
 
17
17
  def test_assign
18
- api = Upwork::Api::Routers::Activities::Engagement.new(get_client_mock)
19
- assert api.assign('company', 'team', '1234', {})
18
+ #api = Upwork::Api::Routers::Activities::Engagement.new(get_client_mock)
19
+ #assert api.assign('company', 'team', '1234', {})
20
20
  end
21
21
 
22
22
  def test_assign_to_engagement
23
- api = Upwork::Api::Routers::Activities::Engagement.new(get_client_mock)
24
- assert api.assign_to_engagement('1234', {})
23
+ #api = Upwork::Api::Routers::Activities::Engagement.new(get_client_mock)
24
+ #assert api.assign_to_engagement('1234', {})
25
25
  end
26
26
  end
@@ -10,37 +10,37 @@ class ActivitiesTeamTest < Test::Unit::TestCase
10
10
  include TestHelper
11
11
 
12
12
  def test_get_list
13
- api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
14
- assert api.get_list('company', 'team')
13
+ #api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
14
+ #assert api.get_list('company', 'team')
15
15
  end
16
16
 
17
17
  def test_get_specific_list
18
- api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
19
- assert api.get_specific_list('company', 'team', 'code')
18
+ #api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
19
+ #assert api.get_specific_list('company', 'team', 'code')
20
20
  end
21
21
 
22
22
  def test_add_activity
23
- api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
24
- assert api.add_activity('company', 'team', {})
23
+ #api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
24
+ #assert api.add_activity('company', 'team', {})
25
25
  end
26
26
 
27
27
  def test_update_activities
28
- api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
29
- assert api.update_activities('company', 'team', 'code', {})
28
+ #api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
29
+ #assert api.update_activities('company', 'team', 'code', {})
30
30
  end
31
31
 
32
32
  def test_archive_activities
33
- api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
34
- assert api.archive_activities('company', 'team', 'code')
33
+ #api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
34
+ #assert api.archive_activities('company', 'team', 'code')
35
35
  end
36
36
 
37
37
  def test_unarchive_activities
38
- api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
39
- assert api.unarchive_activities('company', 'team', 'code')
38
+ #api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
39
+ #assert api.unarchive_activities('company', 'team', 'code')
40
40
  end
41
41
 
42
42
  def test_update_batch
43
- api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
44
- assert api.update_batch('company', 'data')
43
+ #api = Upwork::Api::Routers::Activities::Team.new(get_client_mock)
44
+ #assert api.update_batch('company', 'data')
45
45
  end
46
46
  end
data/test/test_auth.rb CHANGED
@@ -10,7 +10,7 @@ class AuthTest < Test::Unit::TestCase
10
10
  include TestHelper
11
11
 
12
12
  def test_get_user_info
13
- api = Upwork::Api::Routers::Auth.new(get_client_mock)
14
- assert api.get_user_info
13
+ #api = Upwork::Api::Routers::Auth.new(get_client_mock)
14
+ #assert api.get_user_info
15
15
  end
16
- end
16
+ end
@@ -10,13 +10,13 @@ class FreelancersProfileTest < Test::Unit::TestCase
10
10
  include TestHelper
11
11
 
12
12
  def test_get_specific
13
- api = Upwork::Api::Routers::Freelancers::Profile.new(get_client_mock)
14
- assert api.get_specific('~key')
13
+ #api = Upwork::Api::Routers::Freelancers::Profile.new(get_client_mock)
14
+ #assert api.get_specific('~key')
15
15
  end
16
16
 
17
17
  def test_get_specific_brief
18
- api = Upwork::Api::Routers::Freelancers::Profile.new(get_client_mock)
19
- assert api.get_specific_brief('~key')
18
+ #api = Upwork::Api::Routers::Freelancers::Profile.new(get_client_mock)
19
+ #assert api.get_specific_brief('~key')
20
20
  end
21
21
 
22
22
  end
@@ -10,7 +10,7 @@ class FreelancersSearchTest < Test::Unit::TestCase
10
10
  include TestHelper
11
11
 
12
12
  def test_find
13
- api = Upwork::Api::Routers::Freelancers::Search.new(get_client_mock)
14
- assert api.find({})
13
+ #api = Upwork::Api::Routers::Freelancers::Search.new(get_client_mock)
14
+ #assert api.find({})
15
15
  end
16
- end
16
+ end
@@ -0,0 +1,16 @@
1
+ $:.unshift 'lib'
2
+ $LOAD_PATH << File.dirname(__FILE__)
3
+
4
+ require 'helper'
5
+ require 'upwork/api/routers/graphql'
6
+ require 'test/unit'
7
+ require 'mocha/test_unit'
8
+
9
+ class GraphqlTest < Test::Unit::TestCase
10
+ include TestHelper
11
+
12
+ def test_execute
13
+ api = Upwork::Api::Routers::Graphql.new(get_client_mock)
14
+ assert api.execute({'query': 'query{}'})
15
+ end
16
+ end
@@ -10,12 +10,12 @@ class HrClientsApplicationsTest < Test::Unit::TestCase
10
10
  include TestHelper
11
11
 
12
12
  def test_get_list
13
- api = Upwork::Api::Routers::Hr::Clients::Applications.new(get_client_mock)
14
- assert api.get_list({})
13
+ #api = Upwork::Api::Routers::Hr::Clients::Applications.new(get_client_mock)
14
+ #assert api.get_list({})
15
15
  end
16
16
 
17
17
  def test_get_specific
18
- api = Upwork::Api::Routers::Hr::Clients::Applications.new(get_client_mock)
19
- assert api.get_specific('12', {})
18
+ #api = Upwork::Api::Routers::Hr::Clients::Applications.new(get_client_mock)
19
+ #assert api.get_specific('12', {})
20
20
  end
21
- end
21
+ end