zoom_rb 0.8.7 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c6bdaacbf4a10b0f14d9cba48f13b9cccc9e7ed1d0aa3b5e9d20c4b7b0acefd
4
- data.tar.gz: 80732724df8e317b58d7c9814db9862d429dac3ffbeff2535ab7bc28160bd5a9
3
+ metadata.gz: 711b71ce15443f695b228ee36d51501e18b2b5132ab3b2c473d1d8300ea64720
4
+ data.tar.gz: 4f967a6b7e73adc1450d7ea51defb7380fa6c660c83922a01ba696f91950a25f
5
5
  SHA512:
6
- metadata.gz: 450e7576c8c0ff966c54dc94a7986d5025dfaaade64592c57f24ad3fc218e35d6494d01d2dea7f91872f904b2518ea651a61df306f5ae1e56d403fe2c15b1e3f
7
- data.tar.gz: 8b9984d94f4dd49849a08d2416ea2fd1c952c91a744815f0b3521669bc4164d384bc4fc1a9e90532beb4e37ea60dbecde1ce98e4d50ff9b7df0d7fd9a7d21443
6
+ metadata.gz: 7d57f4998d48c7999a9a404688120312173d5c613a82069717ffd414dd8ad744dc1695e085436160fc7deb96350a86e689d053fea94ed6eeec0225ac77fd5ead
7
+ data.tar.gz: eff852b6a1012dd45186560406d5afeb98ae77aa8a41d43c663ca1edfde5fd2f5bced5512fea05a71b1be7f14c681fdde51824009773ec468130dda437622f3b
@@ -1 +1 @@
1
- 2.5.1
1
+ 2.6.2
@@ -2,6 +2,7 @@
2
2
 
3
3
  $:.unshift File.dirname(__FILE__)
4
4
 
5
+ require 'zoom/version'
5
6
  require 'zoom/constants'
6
7
  require 'zoom/params'
7
8
  require 'zoom/utils'
@@ -3,75 +3,86 @@
3
3
  module Zoom
4
4
  module Actions
5
5
  module Meeting
6
+ # List all the scheduled meetings on Zoom.
7
+ def meeting_list(*args)
8
+ options = Zoom::Params.new(Utils.extract_options!(args))
9
+ options.require(%i[user_id])
10
+ Utils.parse_response self.class.get("/users/#{options[:user_id]}/meetings", query: options.except(:user_id), headers: request_headers)
11
+ end
12
+
6
13
  # Create a meeting on Zoom, return the created meeting URL
7
14
  def meeting_create(*args)
8
- params = Zoom::Params.new(Utils.extract_options!(args))
9
- params.require(%i[user_id])
10
- Utils.process_datetime_params!(:start_time, params)
11
- Utils.parse_response self.class.post("/users/#{params[:user_id]}/meetings", body: params.except(:user_id).to_json, query: { access_token: access_token })
15
+ options = Zoom::Params.new(Utils.extract_options!(args))
16
+ options.require(%i[user_id])
17
+ Utils.process_datetime_params!(:start_time, options)
18
+ Utils.parse_response self.class.post("/users/#{options[:user_id]}/meetings", body: options.except(:user_id).to_json, headers: request_headers)
12
19
  end
13
20
 
14
- # Delete a meeting on Zoom, return the deleted meeting ID.
15
- def meeting_delete(*args)
16
- options = Utils.extract_options!(args)
17
- Utils.require_params(%i[id host_id], options)
18
- Utils.parse_response self.class.post('/meeting/delete', query: options)
21
+ # Get a meeting on Zoom via meeting ID, return the meeting info.
22
+ def meeting_get(*args)
23
+ options = Zoom::Params.new(Utils.extract_options!(args))
24
+ options.require(%i[meeting_id])
25
+ Utils.parse_response self.class.get("/meetings/#{options[:meeting_id]}", headers: request_headers)
19
26
  end
20
27
 
21
- # End a meeting on Zoom, return the deleted meeting ID.
22
- def meeting_end(*args)
23
- options = Utils.extract_options!(args)
24
- Utils.require_params(%i[id host_id], options)
25
- Utils.parse_response self.class.post('/meeting/end', query: options)
28
+ # Update meeting info on Zoom via meeting ID.
29
+ def meeting_update(*args)
30
+ options = Zoom::Params.new(Utils.extract_options!(args))
31
+ options.require(%i[meeting_id])
32
+ Utils.process_datetime_params!(:start_time, options)
33
+ # TODO Handle `topic` attr, Max of 300 characters.
34
+ # TODO Handle `timezone` attr, refer to the id value in timezone list JSON file. like "America/Los_Angeles"
35
+ # TODO Verify `password` attr, may only contain the following characters: a-z A-Z 0-9 @ - _
36
+ # TODO Handle `option_audio` attr, Can be "both", "telephony", "voip".
37
+ # TODO Handle `option_auto_record_type`, Can be "local", “cloud” or "none".
38
+ Utils.parse_response self.class.patch("/meetings/#{options[:meeting_id]}", body: options.except(:meeting_id).to_json, headers: request_headers)
26
39
  end
27
40
 
28
- # Get a meeting on Zoom via meeting ID, return the meeting info.
29
- def meeting_get(*args)
30
- options = Utils.extract_options!(args)
31
- Utils.require_params(%i[id host_id], options)
32
- Utils.parse_response self.class.post('/meeting/get', query: options)
41
+ # Delete a meeting on Zoom, return the deleted meeting ID.
42
+ def meeting_delete(*args)
43
+ options = Zoom::Params.new(Utils.extract_options!(args))
44
+ options.require(%i[meeting_id])
45
+ Utils.parse_response self.class.delete("/meetings/#{options[:meeting_id]}", query: options.except(:meeting_id), headers: request_headers)
33
46
  end
34
47
 
35
- # List all the scheduled meetings on Zoom.
36
- def meeting_list(*args)
48
+ # Update a meeting's status
49
+ def meeting_update_status(*args)
50
+ options = Zoom::Params.new(Utils.extract_options!(args))
51
+ options.require(%i[meeting_id])
52
+ Utils.parse_response self.class.put("/meetings/#{options[:meeting_id]}/status", body: options.except(:meeting_id).to_json, headers: request_headers)
53
+ end
54
+
55
+ # End a meeting on Zoom, return the deleted meeting ID.
56
+ def meeting_end(*args)
37
57
  options = Utils.extract_options!(args)
38
- Utils.require_params(:host_id, options)
39
- Utils.process_datetime_params!(:start_time, options)
40
- # TODO Handle `page_size` attr, Defaults to 30. Max of 300 meetings.
41
- # TODO Handle `page_number` attr, Defaults to 1.
42
- Utils.parse_response self.class.post('/meeting/list', query: options)
58
+ meeting_update_status(options.merge(action: 'end'))
43
59
  end
44
60
 
45
61
  # Lists the live meetings on Zoom.
46
62
  def meeting_live(*args)
47
63
  options = Utils.extract_options!(args)
48
- Utils.parse_response self.class.post('/meeting/live', query: options)
64
+ meeting_list(options.merge(type: 'live'))
49
65
  end
50
66
 
51
67
  # Register for a meeting.
52
68
  def meeting_register(*args)
53
- options = Utils.extract_options!(args)
54
- Utils.require_params(%i[id email first_name last_name], options)
55
- # TODO Verify country param by referring to the id value in country list JSON file
56
- # TODO Verify Purchasing Time Frame, should be "Within a month", "1-3 months", "4-6 months", "More than 6 months", "No timeframe".
57
- # TODO Verify Role in Purchase Process, should be "Decision Maker", "Evaluator/Recommender", "Influencer", "Not involved".
58
- # TODO Verify Number of Employees, should be "1-20", "21-50", "51-100", "101-250", "251-500", "501-1,000", "1,001-5,000", "5,001-10,000", "More than 10,000".
59
- # TODO Verify Custom Questions, should be JSON format
60
- # TODO Verify Language, should be "en-US", "en", "zh-CN", "zh", "en-ES", "es", “fr-FR” or "fr"
61
- Utils.parse_response self.class.post('/meeting/register', query: options)
69
+ options = Zoom::Params.new(Utils.extract_options!(args))
70
+ options.require(%i[meeting_id email first_name last_name])
71
+ Utils.parse_response self.class.post("/meetings/#{options[:meeting_id]}/registrants", body: options.except(:meeting_id).to_json, headers: request_headers)
62
72
  end
63
73
 
64
- # Update meeting info on Zoom via meeting ID.
65
- def meeting_update(*args)
66
- options = Utils.extract_options!(args)
67
- Utils.require_params(%i[id host_id type], options)
68
- Utils.process_datetime_params!(:start_time, options)
69
- # TODO Handle `topic` attr, Max of 300 characters.
70
- # TODO Handle `timezone` attr, refer to the id value in timezone list JSON file. like "America/Los_Angeles"
71
- # TODO Verify `password` attr, may only contain the following characters: a-z A-Z 0-9 @ - _
72
- # TODO Handle `option_audio` attr, Can be "both", "telephony", "voip".
73
- # TODO Handle `option_auto_record_type`, Can be "local", “cloud” or "none".
74
- Utils.parse_response self.class.post('/meeting/update', query: options)
74
+ # Retrieve ended meeting details
75
+ def past_meeting_details(*args)
76
+ options = Zoom::Params.new(Utils.extract_options!(args))
77
+ options.require(%i[meeting_uuid])
78
+ Utils.parse_response self.class.get("/past_meetings/#{options[:meeting_uuid]}", headers: request_headers)
79
+ end
80
+
81
+ # Retrieve ended meeting participants
82
+ def past_meeting_participants(*args)
83
+ options = Zoom::Params.new(Utils.extract_options!(args))
84
+ options.require(%i[meeting_uuid])
85
+ Utils.parse_response self.class.get("/past_meetings/#{options[:meeting_uuid]}/participants", headers: request_headers)
75
86
  end
76
87
  end
77
88
  end
@@ -6,7 +6,7 @@ module Zoom
6
6
  def user_list(*args)
7
7
  params = Zoom::Params.new(Utils.extract_options!(args))
8
8
  params.permit(%i[status page_size page_number])
9
- response = self.class.get('/users', query: params.merge(access_token: access_token))
9
+ response = self.class.get('/users', query: params, headers: request_headers)
10
10
  Utils.parse_response(response)
11
11
  end
12
12
 
@@ -16,25 +16,25 @@ module Zoom
16
16
  require_param_keys.append(:password) if params[:action] == 'autoCreate'
17
17
  params.require(require_param_keys)
18
18
  params.permit_value(:action, Zoom::Constants::USER_CREATE_TYPES.keys)
19
- Utils.parse_response self.class.post('/users', body: { action: params[:action], user_info: params.except(:action) }.to_json, query: { access_token: access_token })
19
+ Utils.parse_response self.class.post('/users', body: { action: params[:action], user_info: params.except(:action) }.to_json, headers: request_headers)
20
20
  end
21
21
 
22
22
  def user_get(*args)
23
23
  params = Zoom::Params.new(Utils.extract_options!(args))
24
24
  params.require(:id).permit(:login_type)
25
- Utils.parse_response self.class.get("/users/#{params[:id]}", query: params.except(:id).merge(access_token: access_token))
25
+ Utils.parse_response self.class.get("/users/#{params[:id]}", query: params.except(:id), headers: request_headers)
26
26
  end
27
27
 
28
28
  def user_update(*args)
29
29
  params = Zoom::Params.new(Utils.extract_options!(args))
30
30
  params.require(:id).permit(%i[first_name last_name type pmi timezone dept vanity_name host_key cms_user_id])
31
- Utils.parse_response self.class.patch("/users/#{params[:id]}", body: params.except(:id), query: { access_token: access_token })
31
+ Utils.parse_response self.class.patch("/users/#{params[:id]}", body: params.except(:id), headers: request_headers)
32
32
  end
33
33
 
34
34
  def user_delete(*args)
35
35
  params = Zoom::Params.new(Utils.extract_options!(args))
36
36
  params.require(:id).permit(%i[action transfer_email transfer_meeting transfer_webinar transfer_recording])
37
- Utils.parse_response self.class.delete("/users/#{params[:id]}", query: params.except(:id).merge(access_token: access_token))
37
+ Utils.parse_response self.class.delete("/users/#{params[:id]}", query: params.except(:id), headers: request_headers)
38
38
  end
39
39
 
40
40
  def user_assistants_list(*args)
@@ -42,21 +42,21 @@ module Zoom
42
42
  # TODO: implement user_assistants_list
43
43
  # options = Utils.extract_options!(args)
44
44
  # Utils.require_params([:user_id], options)
45
- Utils.parse_response self.class.get("/users/#{options.slice!(:id)}/assistants", query: options.merge(access_token: access_token))
45
+ Utils.parse_response self.class.get("/users/#{options.slice!(:id)}/assistants", query: options, headers: request_headers)
46
46
  end
47
47
 
48
48
  def user_assistants_create(*args)
49
49
  raise Zoom::NotImplemented, 'user_assistants_create is not yet implemented'
50
50
  # TODO: validate body attributes
51
51
  options = Utils.extract_options!(args)
52
- Utils.parse_response self.class.post("/users/#{options.slice!(:id)}/assistants", body: options, query: { access_token: access_token })
52
+ Utils.parse_response self.class.post("/users/#{options.slice!(:id)}/assistants", body: options, headers: request_headers)
53
53
  end
54
54
 
55
55
  def user_assistants_delete_all(*args)
56
56
  raise Zoom::NotImplemented, 'user_assistants_delete_all is not yet implemented'
57
57
  # TODO: implement user_assistants_delete_all
58
58
  options = Utils.extract_options!(args)
59
- Utils.parse_response self.class.delete("/users/#{options.slice!(:id)}/assistants", body: options, query: { access_token: access_token })
59
+ Utils.parse_response self.class.delete("/users/#{options.slice!(:id)}/assistants", body: options, headers: request_headers)
60
60
  end
61
61
 
62
62
  def user_assistants_delete(*args)
@@ -12,7 +12,7 @@ module Zoom
12
12
  def webinar_list(*args)
13
13
  params = Zoom::Params.new(Utils.extract_options!(args))
14
14
  params.require(:host_id).permit(:page_size, :page_number)
15
- Utils.parse_response self.class.get("/users/#{params[:host_id]}/webinars", query: params.merge(access_token: access_token))
15
+ Utils.parse_response self.class.get("/users/#{params[:host_id]}/webinars", query: params, headers: request_headers)
16
16
  end
17
17
 
18
18
  def webinar_create(*args)
@@ -23,13 +23,13 @@ module Zoom
23
23
  settings: SETTINGS_KEYS)
24
24
  # process recurrence keys based on constants
25
25
  # process settings keys based on constants
26
- Utils.parse_response self.class.post("/users/#{params[:host_id]}/webinars", body: params.except(:host_id).to_json, query: { access_token: access_token })
26
+ Utils.parse_response self.class.post("/users/#{params[:host_id]}/webinars", body: params.except(:host_id).to_json, headers: request_headers)
27
27
  end
28
28
 
29
29
  def webinar_get(*args)
30
30
  params = Zoom::Params.new(Utils.extract_options!(args))
31
31
  params.require(:id)
32
- Utils.parse_response self.class.get("/webinars/#{params[:id]}", query: { access_token: access_token })
32
+ Utils.parse_response self.class.get("/webinars/#{params[:id]}", headers: request_headers)
33
33
  end
34
34
 
35
35
  def webinar_update(*args)
@@ -38,13 +38,13 @@ module Zoom
38
38
  :timezone, :password, :agenda,
39
39
  recurrence: RECURRENCE_KEYS,
40
40
  settings: SETTINGS_KEYS)
41
- Utils.parse_response self.class.patch("/webinars/#{params[:id]}", body: params.except(:id).to_json, query: { access_token: access_token })
41
+ Utils.parse_response self.class.patch("/webinars/#{params[:id]}", body: params.except(:id).to_json, headers: request_headers)
42
42
  end
43
43
 
44
44
  def webinar_delete(*args)
45
45
  params = Zoom::Params.new(Utils.extract_options!(args))
46
46
  params.require(:id).permit(:occurrence_id)
47
- Utils.parse_response self.class.delete("/webinars/#{params[:id]}", query: params.except(:id).merge(access_token: access_token))
47
+ Utils.parse_response self.class.delete("/webinars/#{params[:id]}", query: params.except(:id), headers: request_headers)
48
48
  end
49
49
 
50
50
  def webinar_status_update(*args)
@@ -80,7 +80,7 @@ module Zoom
80
80
  def webinar_registrants_list(*args)
81
81
  params = Zoom::Params.new(Utils.extract_options!(args))
82
82
  params.require(:id).permit(%i[occurrence_id status page_size page_number])
83
- Utils.parse_response self.class.get("/webinars/#{params[:id]}/registrants", query: params.except(:id).merge(access_token: access_token))
83
+ Utils.parse_response self.class.get("/webinars/#{params[:id]}/registrants", query: params.except(:id), headers: request_headers)
84
84
  end
85
85
 
86
86
  def webinar_registrant_add(*args)
@@ -89,14 +89,14 @@ module Zoom
89
89
  .permit(%i[occurrence_ids address city country zip state phone
90
90
  industry org job_title purchasing_time_frame role_in_purchase_process
91
91
  no_of_employees comments custom_questions])
92
- Utils.parse_response self.class.post("/webinars/#{params[:id]}/registrants", body: params.except(:id, :occurrence_ids).to_json, query: params.slice(:occurrence_ids).merge(access_token: access_token))
92
+ Utils.parse_response self.class.post("/webinars/#{params[:id]}/registrants", body: params.except(:id, :occurrence_ids).to_json, query: params.slice(:occurrence_ids), headers: request_headers)
93
93
  end
94
94
 
95
95
  def webinar_registrants_status_update(*args)
96
96
  params = Zoom::Params.new(Utils.extract_options!(args))
97
97
  params.require(:id, :action)
98
98
  .permit(:occurrence_id, registrants: [])
99
- Utils.parse_response self.class.put("/webinars/#{params[:id]}/registrants/status", body: params.except(:id, :occurrence_ids).to_json, query: params.slice(:occurrence_ids).merge(access_token: access_token))
99
+ Utils.parse_response self.class.put("/webinars/#{params[:id]}/registrants/status", body: params.except(:id, :occurrence_ids).to_json, query: params.slice(:occurrence_ids), headers: request_headers)
100
100
  end
101
101
 
102
102
  def past_webinar_list(*args)
@@ -29,6 +29,14 @@ module Zoom
29
29
  self.class.default_timeout(@timeout)
30
30
  end
31
31
 
32
+ def request_headers
33
+ {
34
+ 'Accept' => 'application/json',
35
+ 'Content-Type' => 'application/json',
36
+ 'Authorization' => "Bearer #{access_token}"
37
+ }
38
+ end
39
+
32
40
  def access_token
33
41
  JWT.encode({ iss: @api_key, exp: Time.now.to_i + @timeout }, @api_secret, 'HS256', { typ: 'JWT' })
34
42
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ VERSION = '0.9.0'
5
+ end
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ lib = File.expand_path("../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'zoom/version'
6
+
3
7
  Gem::Specification.new do |gem|
4
8
 
5
9
  gem.add_dependency 'httparty', '~> 0.13'
@@ -25,5 +29,5 @@ Gem::Specification.new do |gem|
25
29
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
26
30
  gem.name = 'zoom_rb'
27
31
  gem.require_paths = ['lib']
28
- gem.version = '0.8.7'
32
+ gem.version = Zoom::VERSION
29
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoom_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Boe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-03 00:00:00.000000000 Z
11
+ date: 2019-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -169,6 +169,7 @@ files:
169
169
  - lib/zoom/interface.rb
170
170
  - lib/zoom/params.rb
171
171
  - lib/zoom/utils.rb
172
+ - lib/zoom/version.rb
172
173
  - spec/fixtures/chat/get.json
173
174
  - spec/fixtures/chat/list.json
174
175
  - spec/fixtures/error/already_exists.json
@@ -339,8 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
340
  - !ruby/object:Gem::Version
340
341
  version: '0'
341
342
  requirements: []
342
- rubyforge_project:
343
- rubygems_version: 2.7.6
343
+ rubygems_version: 3.0.3
344
344
  signing_key:
345
345
  specification_version: 4
346
346
  summary: zoom.us API wrapper