zoom_rb 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/Gemfile.lock +3 -3
- data/lib/zoom/actions/meeting.rb +7 -0
- data/lib/zoom/actions/webinar.rb +9 -1
- data/lib/zoom/error.rb +13 -13
- data/lib/zoom/version.rb +1 -1
- data/spec/fixtures/meeting/instances.json +8 -0
- data/spec/fixtures/webinar/panelist_add.json +4 -0
- data/spec/fixtures/webinar/panelist_delete.json +4 -0
- data/spec/fixtures/webinar/panelist_delete_all.json +4 -0
- data/spec/lib/zoom/actions/meeting/get_spec.rb +20 -0
- data/spec/lib/zoom/actions/webinar/panelist_add_spec.rb +54 -0
- data/spec/lib/zoom/actions/webinar/panelist_delete_spec.rb +50 -0
- data/spec/lib/zoom/actions/webinar/panelists_delete_all_spec.rb +45 -0
- data/spec/lib/zoom/errors_spec.rb +31 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daad98f9fbc78390d4f9f9bf0c4e1505cc9238e40af0113b5e5bcd36deea3c67
|
4
|
+
data.tar.gz: 9c0351755733f9c8e728425679522ee7dc6e1003306ed76694689fe3aaa91ffe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2b66e44b5db67db9a9caed1b063fcbec87b4d22276eed265d8f2645fbe47ef42dcd810201d21bd4ad2c1181688b104bb97be7d85dc0422dc11bf289f66e2347
|
7
|
+
data.tar.gz: 610a6ed4a5dd99a4360dad225b5b93537fbd15d02c33610ebf8369aece17c17db3391b00e77132245bf194b3cf7ca66ae2a9d0b103dc1364ef9cf9e378f9981c
|
data/.circleci/config.yml
CHANGED
@@ -9,7 +9,7 @@ jobs:
|
|
9
9
|
CC_TEST_REPORTER_ID: c6c77975186cfe10e41d9548e9b4a4648f87b56cdbb70bd3896a5a58abf08421
|
10
10
|
docker:
|
11
11
|
# specify the version you desire here
|
12
|
-
- image: circleci/ruby:
|
12
|
+
- image: circleci/ruby:3.0-node-browsers
|
13
13
|
|
14
14
|
# Specify service dependencies here if necessary
|
15
15
|
# CircleCI maintains a library of pre-built images
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
zoom_rb (1.1.
|
4
|
+
zoom_rb (1.1.5)
|
5
5
|
httparty (>= 0.13)
|
6
6
|
json (>= 1.8)
|
7
7
|
jwt
|
@@ -35,8 +35,8 @@ GEM
|
|
35
35
|
multi_xml (>= 0.5.2)
|
36
36
|
i18n (1.10.0)
|
37
37
|
concurrent-ruby (~> 1.0)
|
38
|
-
json (2.6.
|
39
|
-
jwt (2.
|
38
|
+
json (2.6.2)
|
39
|
+
jwt (2.5.0)
|
40
40
|
method_source (1.0.0)
|
41
41
|
mime-types (3.4.1)
|
42
42
|
mime-types-data (~> 3.2015)
|
data/lib/zoom/actions/meeting.rb
CHANGED
@@ -47,9 +47,16 @@ module Zoom
|
|
47
47
|
# Register for a meeting.
|
48
48
|
patch 'meeting_registrant_questions', '/meeting/:meeting_id/registrants/questions'
|
49
49
|
|
50
|
+
# List users that have registered for a meeting.
|
51
|
+
get 'list_meeting_registrants', '/meetings/:meeting_id/registrants',
|
52
|
+
permit: %i[occurrence_id status page_size next_page_token]
|
53
|
+
|
50
54
|
# Retrieve ended meeting details
|
51
55
|
get 'past_meeting_details', '/past_meetings/:meeting_uuid'
|
52
56
|
|
57
|
+
# Retrieve past meeting instances
|
58
|
+
get 'past_meeting_instances', '/past_meetings/:meeting_id/instances'
|
59
|
+
|
53
60
|
# Retrieve ended meeting participants
|
54
61
|
get 'past_meeting_participants', '/past_meetings/:meeting_uuid/participants'
|
55
62
|
|
data/lib/zoom/actions/webinar.rb
CHANGED
@@ -32,7 +32,7 @@ module Zoom
|
|
32
32
|
].freeze
|
33
33
|
|
34
34
|
get 'webinar_list', '/users/:host_id/webinars',
|
35
|
-
permit: %i[page_size
|
35
|
+
permit: %i[page_size next_page_token]
|
36
36
|
|
37
37
|
# TODO: process recurrence keys based on constants
|
38
38
|
# TODO: process settings keys based on constants
|
@@ -78,6 +78,14 @@ module Zoom
|
|
78
78
|
|
79
79
|
get 'webinar_panelist_list', '/webinars/:webinar_id/panelists'
|
80
80
|
|
81
|
+
post 'webinar_panelist_add', '/webinars/:webinar_id/panelists',
|
82
|
+
require: :panelists,
|
83
|
+
permit: [ panelists: [] ]
|
84
|
+
|
85
|
+
delete 'webinar_panelist_delete', '/webinars/:webinar_id/panelists/:panelist_id'
|
86
|
+
|
87
|
+
delete 'webinar_panelists_delete_all', '/webinars/:webinar_id/panelists'
|
88
|
+
|
81
89
|
get 'past_webinars_absentees', '/past_webinars/:webinar_uuid/absentees',
|
82
90
|
permit: %i[occurrence_id page_size next_page_token]
|
83
91
|
end
|
data/lib/zoom/error.rb
CHANGED
@@ -9,17 +9,17 @@ module Zoom
|
|
9
9
|
super(msg)
|
10
10
|
end
|
11
11
|
end
|
12
|
-
class GatewayTimeout <
|
13
|
-
class NotImplemented <
|
14
|
-
class ParameterMissing <
|
15
|
-
class ParameterNotPermitted <
|
16
|
-
class ParameterValueNotPermitted <
|
17
|
-
class AuthenticationError <
|
18
|
-
class BadRequest <
|
19
|
-
class Unauthorized <
|
20
|
-
class Forbidden <
|
21
|
-
class NotFound <
|
22
|
-
class Conflict <
|
23
|
-
class TooManyRequests <
|
24
|
-
class InternalServerError <
|
12
|
+
class GatewayTimeout < Error; end
|
13
|
+
class NotImplemented < Error; end
|
14
|
+
class ParameterMissing < Error; end
|
15
|
+
class ParameterNotPermitted < Error; end
|
16
|
+
class ParameterValueNotPermitted < Error; end
|
17
|
+
class AuthenticationError < Error; end
|
18
|
+
class BadRequest < Error; end
|
19
|
+
class Unauthorized < Error; end
|
20
|
+
class Forbidden < Error; end
|
21
|
+
class NotFound < Error; end
|
22
|
+
class Conflict < Error; end
|
23
|
+
class TooManyRequests < Error; end
|
24
|
+
class InternalServerError < Error; end
|
25
25
|
end
|
data/lib/zoom/version.rb
CHANGED
@@ -46,4 +46,24 @@ describe Zoom::Actions::Meeting do
|
|
46
46
|
}.to raise_error(NoMethodError)
|
47
47
|
end
|
48
48
|
end
|
49
|
+
|
50
|
+
describe '#past_meeting_instances' do
|
51
|
+
before :each do
|
52
|
+
stub_request(
|
53
|
+
:get,
|
54
|
+
zoom_url("/past_meetings/#{args[:meeting_id]}/instances")
|
55
|
+
).to_return(
|
56
|
+
status: 200,
|
57
|
+
body: json_response('meeting','instances'){},
|
58
|
+
headers: { 'Content-Type' => 'application/json' }
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'returns meeting instances' do
|
63
|
+
res = zc.past_meeting_instances(args)
|
64
|
+
|
65
|
+
expect(res['meetings'][0]['start_time']).to eq('2022-03-26T05:37:59Z')
|
66
|
+
expect(res['meetings'][0]['uuid']).to eq('Vg8IdgluR5WDeWIkpJlElQ==')
|
67
|
+
end
|
68
|
+
end
|
49
69
|
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::Webinar do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { webinar_id: '123456789',
|
8
|
+
panelists: [{email: "foo@bar.com", name: "Foo Bar"}] } }
|
9
|
+
|
10
|
+
describe '#webinar_panelist_add' do
|
11
|
+
context 'with a valid response' do
|
12
|
+
before :each do
|
13
|
+
stub_request(
|
14
|
+
:post,
|
15
|
+
zoom_url("/webinars/#{args[:webinar_id]}/panelists")
|
16
|
+
).to_return(status: 201,
|
17
|
+
body: json_response('webinar', 'panelist_add'),
|
18
|
+
headers: { 'Content-Type' => 'application/json' })
|
19
|
+
end
|
20
|
+
|
21
|
+
it "requires a 'webinar id' argument" do
|
22
|
+
expect { zc.webinar_panelist_add(filter_key(args, :webinar_id)) }.to raise_error(Zoom::ParameterMissing, [:webinar_id].to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "requires a 'panelists' argument" do
|
26
|
+
expect { zc.webinar_panelist_add(filter_key(args, :panelists)) }.to raise_error(Zoom::ParameterMissing, [:panelists].to_s)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'returns an Hash' do
|
30
|
+
expect(zc.webinar_panelist_add(args)).to be_kind_of(Hash)
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'returns an "id"' do
|
34
|
+
res = zc.webinar_panelist_add(args)
|
35
|
+
expect(res['id']).not_to be nil
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'with a 4xx response' do
|
40
|
+
before :each do
|
41
|
+
stub_request(
|
42
|
+
:post,
|
43
|
+
zoom_url("/webinars/#{args[:webinar_id]}/panelists")
|
44
|
+
).to_return(status: 404,
|
45
|
+
body: json_response('error', 'validation'),
|
46
|
+
headers: { 'Content-Type' => 'application/json' })
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'raises Zoom::Error exception' do
|
50
|
+
expect { zc.webinar_panelist_add(args) }.to raise_error(Zoom::Error)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::Webinar do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { webinar_id: '123456789',
|
8
|
+
panelist_id: '12345' } }
|
9
|
+
|
10
|
+
describe '#webinar_panelist_delete' do
|
11
|
+
context 'with a valid response' do
|
12
|
+
before :each do
|
13
|
+
stub_request(
|
14
|
+
:delete,
|
15
|
+
zoom_url("/webinars/#{args[:webinar_id]}/panelists/#{args[:panelist_id]}")
|
16
|
+
).to_return(status: 204,
|
17
|
+
body: json_response('webinar', 'panelist_delete'),
|
18
|
+
headers: { 'Content-Type' => 'application/json' })
|
19
|
+
end
|
20
|
+
|
21
|
+
it "requires a 'webinar id' argument" do
|
22
|
+
expect { zc.webinar_panelist_delete(filter_key(args, :webinar_id)) }.to raise_error(Zoom::ParameterMissing, [:webinar_id].to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "requires a 'panelist id' argument" do
|
26
|
+
expect { zc.webinar_panelist_delete(filter_key(args, :panelist_id)) }.to raise_error(Zoom::ParameterMissing, [:panelist_id].to_s)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'returns the http status code as a number' do
|
30
|
+
expect(zc.webinar_panelist_delete(args)).to eql(204)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with a 4xx response' do
|
36
|
+
before :each do
|
37
|
+
stub_request(
|
38
|
+
:delete,
|
39
|
+
zoom_url("/webinars/#{args[:webinar_id]}/panelists/#{args[:panelist_id]}")
|
40
|
+
).to_return(status: 404,
|
41
|
+
body: json_response('error', 'validation'),
|
42
|
+
headers: { 'Content-Type' => 'application/json' })
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'raises Zoom::Error exception' do
|
46
|
+
expect { zc.webinar_panelist_delete(args) }.to raise_error(Zoom::Error)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::Webinar do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { webinar_id: '123456789' } }
|
8
|
+
|
9
|
+
describe '#webinar_panelists_delete_all' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:delete,
|
14
|
+
zoom_url("/webinars/#{args[:webinar_id]}/panelists")
|
15
|
+
).to_return(status: 204,
|
16
|
+
body: json_response('webinar', 'panelist_delete_all'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires a 'webinar id' argument" do
|
21
|
+
expect { zc.webinar_panelists_delete_all(filter_key(args, :webinar_id)) }.to raise_error(Zoom::ParameterMissing, [:webinar_id].to_s)
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'returns the http status code as a number' do
|
25
|
+
expect(zc.webinar_panelists_delete_all(args)).to eql(204)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'with a 4xx response' do
|
31
|
+
before :each do
|
32
|
+
stub_request(
|
33
|
+
:delete,
|
34
|
+
zoom_url("/webinars/#{args[:webinar_id]}/panelists")
|
35
|
+
).to_return(status: 404,
|
36
|
+
body: json_response('error', 'validation'),
|
37
|
+
headers: { 'Content-Type' => 'application/json' })
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'raises Zoom::Error exception' do
|
41
|
+
expect { zc.webinar_panelist_delete(args) }.to raise_error(Zoom::Error)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Zoom::Error do
|
6
|
+
let(:rescue?) { false }
|
7
|
+
|
8
|
+
subject do
|
9
|
+
begin
|
10
|
+
raise Zoom::ParameterMissing, "msg"
|
11
|
+
rescue Zoom::Error => error
|
12
|
+
if rescue?
|
13
|
+
true
|
14
|
+
else
|
15
|
+
raise error
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'raises specific errors' do
|
21
|
+
expect { subject }.to raise_error(Zoom::ParameterMissing, "msg")
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'with errors rescued' do
|
25
|
+
let(:rescue?) { true }
|
26
|
+
|
27
|
+
it 'descends from Zoom::Error' do
|
28
|
+
expect(subject).to be true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
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: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Boe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -240,6 +240,7 @@ files:
|
|
240
240
|
- spec/fixtures/meeting/add_registrant.json
|
241
241
|
- spec/fixtures/meeting/create.json
|
242
242
|
- spec/fixtures/meeting/get.json
|
243
|
+
- spec/fixtures/meeting/instances.json
|
243
244
|
- spec/fixtures/meeting/invitation.json
|
244
245
|
- spec/fixtures/meeting/list.json
|
245
246
|
- spec/fixtures/meeting/live_stream/errors/meeting_not_found.json
|
@@ -296,6 +297,9 @@ files:
|
|
296
297
|
- spec/fixtures/webinar/create.json
|
297
298
|
- spec/fixtures/webinar/delete.json
|
298
299
|
- spec/fixtures/webinar/list.json
|
300
|
+
- spec/fixtures/webinar/panelist_add.json
|
301
|
+
- spec/fixtures/webinar/panelist_delete.json
|
302
|
+
- spec/fixtures/webinar/panelist_delete_all.json
|
299
303
|
- spec/fixtures/webinar/panelist_list.json
|
300
304
|
- spec/fixtures/webinar/past_webinar_list.json
|
301
305
|
- spec/fixtures/webinar/past_webinars_absentees.json
|
@@ -434,7 +438,10 @@ files:
|
|
434
438
|
- spec/lib/zoom/actions/webinar/get_spec.rb
|
435
439
|
- spec/lib/zoom/actions/webinar/list_registration_spec.rb
|
436
440
|
- spec/lib/zoom/actions/webinar/list_spec.rb
|
441
|
+
- spec/lib/zoom/actions/webinar/panelist_add_spec.rb
|
442
|
+
- spec/lib/zoom/actions/webinar/panelist_delete_spec.rb
|
437
443
|
- spec/lib/zoom/actions/webinar/panelist_list_spec.rb
|
444
|
+
- spec/lib/zoom/actions/webinar/panelists_delete_all_spec.rb
|
438
445
|
- spec/lib/zoom/actions/webinar/past_webinar_absentees_spec.rb
|
439
446
|
- spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb
|
440
447
|
- spec/lib/zoom/actions/webinar/poll_get_spec.rb
|
@@ -451,6 +458,7 @@ files:
|
|
451
458
|
- spec/lib/zoom/actions/webinar/uuid_list_spec.rb
|
452
459
|
- spec/lib/zoom/actions_spec.rb
|
453
460
|
- spec/lib/zoom/client_spec.rb
|
461
|
+
- spec/lib/zoom/errors_spec.rb
|
454
462
|
- spec/lib/zoom/params_spec.rb
|
455
463
|
- spec/lib/zoom/utils_spec.rb
|
456
464
|
- spec/spec_helper.rb
|
@@ -522,6 +530,7 @@ test_files:
|
|
522
530
|
- spec/fixtures/meeting/add_registrant.json
|
523
531
|
- spec/fixtures/meeting/create.json
|
524
532
|
- spec/fixtures/meeting/get.json
|
533
|
+
- spec/fixtures/meeting/instances.json
|
525
534
|
- spec/fixtures/meeting/invitation.json
|
526
535
|
- spec/fixtures/meeting/list.json
|
527
536
|
- spec/fixtures/meeting/live_stream/errors/meeting_not_found.json
|
@@ -578,6 +587,9 @@ test_files:
|
|
578
587
|
- spec/fixtures/webinar/create.json
|
579
588
|
- spec/fixtures/webinar/delete.json
|
580
589
|
- spec/fixtures/webinar/list.json
|
590
|
+
- spec/fixtures/webinar/panelist_add.json
|
591
|
+
- spec/fixtures/webinar/panelist_delete.json
|
592
|
+
- spec/fixtures/webinar/panelist_delete_all.json
|
581
593
|
- spec/fixtures/webinar/panelist_list.json
|
582
594
|
- spec/fixtures/webinar/past_webinar_list.json
|
583
595
|
- spec/fixtures/webinar/past_webinars_absentees.json
|
@@ -716,7 +728,10 @@ test_files:
|
|
716
728
|
- spec/lib/zoom/actions/webinar/get_spec.rb
|
717
729
|
- spec/lib/zoom/actions/webinar/list_registration_spec.rb
|
718
730
|
- spec/lib/zoom/actions/webinar/list_spec.rb
|
731
|
+
- spec/lib/zoom/actions/webinar/panelist_add_spec.rb
|
732
|
+
- spec/lib/zoom/actions/webinar/panelist_delete_spec.rb
|
719
733
|
- spec/lib/zoom/actions/webinar/panelist_list_spec.rb
|
734
|
+
- spec/lib/zoom/actions/webinar/panelists_delete_all_spec.rb
|
720
735
|
- spec/lib/zoom/actions/webinar/past_webinar_absentees_spec.rb
|
721
736
|
- spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb
|
722
737
|
- spec/lib/zoom/actions/webinar/poll_get_spec.rb
|
@@ -733,6 +748,7 @@ test_files:
|
|
733
748
|
- spec/lib/zoom/actions/webinar/uuid_list_spec.rb
|
734
749
|
- spec/lib/zoom/actions_spec.rb
|
735
750
|
- spec/lib/zoom/client_spec.rb
|
751
|
+
- spec/lib/zoom/errors_spec.rb
|
736
752
|
- spec/lib/zoom/params_spec.rb
|
737
753
|
- spec/lib/zoom/utils_spec.rb
|
738
754
|
- spec/spec_helper.rb
|