zoom_rb 0.9.0 → 1.0.0
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/.gitignore +2 -1
- data/CHANGELOG.md +53 -0
- data/Gemfile.lock +85 -51
- data/Makefile +1 -1
- data/README.md +31 -3
- data/lib/zoom/actions/account.rb +18 -76
- data/lib/zoom/actions/billing.rb +41 -0
- data/lib/zoom/actions/dashboard.rb +22 -0
- data/lib/zoom/actions/groups.rb +19 -0
- data/lib/zoom/actions/im/chat.rb +13 -14
- data/lib/zoom/actions/meeting.rb +38 -63
- data/lib/zoom/actions/phone.rb +15 -0
- data/lib/zoom/actions/recording.rb +13 -22
- data/lib/zoom/actions/report.rb +8 -43
- data/lib/zoom/actions/roles.rb +24 -0
- data/lib/zoom/actions/sip_audio.rb +34 -0
- data/lib/zoom/actions/token.rb +26 -0
- data/lib/zoom/actions/user.rb +66 -139
- data/lib/zoom/actions/webinar.rb +43 -84
- data/lib/zoom/actions.rb +49 -0
- data/lib/zoom/client.rb +27 -16
- data/lib/zoom/clients/jwt.rb +22 -0
- data/lib/zoom/clients/oauth.rb +60 -0
- data/lib/zoom/constants/account/options/pay_modes.rb +12 -0
- data/lib/zoom/constants/account/settings/permitted_settings.rb +125 -0
- data/lib/zoom/constants/constants.rb +35 -0
- data/lib/zoom/constants/meeting/approval_types.rb +11 -0
- data/lib/zoom/constants/meeting/audio_type.rb +11 -0
- data/lib/zoom/constants/meeting/auto_recording.rb +11 -0
- data/lib/zoom/constants/meeting/registration_types.rb +11 -0
- data/lib/zoom/constants/meeting/types.rb +12 -0
- data/lib/zoom/constants/recurrence/monthly_weeks.rb +13 -0
- data/lib/zoom/constants/recurrence/types.rb +11 -0
- data/lib/zoom/constants/recurrence/weekly_days.rb +15 -0
- data/lib/zoom/constants/user/create_types.rb +12 -0
- data/lib/zoom/constants/user/types.rb +11 -0
- data/lib/zoom/constants/webinar/approval_types.rb +11 -0
- data/lib/zoom/constants/webinar/audio_type.rb +11 -0
- data/lib/zoom/constants/webinar/auto_recording.rb +11 -0
- data/lib/zoom/constants/webinar/registration_types.rb +11 -0
- data/lib/zoom/constants/webinar/types.rb +11 -0
- data/lib/zoom/error.rb +9 -1
- data/lib/zoom/params.rb +51 -12
- data/lib/zoom/utils.rb +22 -38
- data/lib/zoom/version.rb +2 -2
- data/lib/{zoom.rb → zoom_rb.rb} +12 -5
- data/spec/fixtures/account/create.json +6 -0
- data/spec/{lib/zoom/actions/report/hosts_report_spec.rb → fixtures/account/delete.json} +0 -0
- data/spec/fixtures/account/get.json +13 -0
- data/spec/fixtures/account/list.json +18 -0
- data/spec/fixtures/account/managed_domains.json +7 -0
- data/spec/fixtures/account/options_update.json +7 -0
- data/spec/fixtures/account/settings_get.json +120 -0
- data/spec/{lib/zoom/actions/report/meeting_polls_report_spec.rb → fixtures/account/settings_update.json} +0 -0
- data/spec/fixtures/account/trusted_domains.json +3 -0
- data/spec/fixtures/billing/get.json +12 -0
- data/spec/fixtures/billing/plans_list.json +44 -0
- data/spec/fixtures/billing/plans_subscribe.json +30 -0
- data/spec/fixtures/billing/plans_usage.json +30 -0
- data/spec/{lib/zoom/actions/report/meetings_report_spec.rb → fixtures/billing/update.json} +0 -0
- data/spec/fixtures/chat/channels/get.json +5 -0
- data/spec/fixtures/chat/users/channels/list.json +17 -0
- data/spec/fixtures/dashboard/crc.json +104 -0
- data/spec/fixtures/dashboard/meeting/detail.json +20 -0
- data/spec/fixtures/dashboard/meeting/participants.json +56 -0
- data/spec/fixtures/{metrics_meetings.json → dashboard/meetings.json} +1 -2
- data/spec/fixtures/error/admin_cannot_activated.json +4 -0
- data/spec/fixtures/error/channel_not_found.json +4 -0
- data/spec/fixtures/error/group_does_not_exist.json +4 -0
- data/spec/fixtures/error/group_not_belong_to_account.json +4 -0
- data/spec/fixtures/error/group_not_exist.json +4 -0
- data/spec/fixtures/error/meeting_not_exist.json +4 -0
- data/spec/fixtures/error/next_page_token_invalid.json +4 -0
- data/spec/fixtures/error/not_found_administrator.json +4 -0
- data/spec/fixtures/error/unauthorized_request.json +4 -0
- data/spec/fixtures/error/user_not_exist.json +1 -1
- data/spec/fixtures/groups/create.json +5 -0
- data/spec/fixtures/groups/get.json +5 -0
- data/spec/fixtures/groups/list.json +15 -0
- data/spec/{lib/zoom/actions/report/telephone_report_spec.rb → fixtures/groups/update.json} +0 -0
- data/spec/fixtures/meeting/add_registrant.json +7 -0
- data/spec/fixtures/meeting/create.json +31 -16
- data/spec/fixtures/meeting/get.json +43 -33
- data/spec/fixtures/meeting/invitation.json +3 -0
- data/spec/fixtures/meeting/live_stream/errors/meeting_not_found.json +4 -0
- data/spec/fixtures/meeting/live_stream/errors/missing_field.json +10 -0
- data/spec/fixtures/{recording_get.json → recording/get.json} +17 -6
- data/spec/fixtures/recording/list.json +53 -0
- data/spec/fixtures/recording/settings/get.json +7 -0
- data/spec/fixtures/report/meeting/participants.json +17 -0
- data/spec/fixtures/report/meeting.json +19 -0
- data/spec/fixtures/roles/assign.json +4 -0
- data/spec/fixtures/roles/create.json +9 -0
- data/spec/fixtures/roles/get.json +11 -0
- data/spec/fixtures/roles/list.json +29 -0
- data/spec/fixtures/roles/members.json +15 -0
- data/spec/fixtures/sip_audio/sip_trunks_get.json +19 -0
- data/spec/fixtures/sip_audio/sip_trunks_internal_callout_countries_add.json +10 -0
- data/spec/fixtures/sip_audio/sip_trunks_internal_callout_country_list.json +15 -0
- data/spec/fixtures/sip_audio/sip_trunks_internal_numbers_add.json +14 -0
- data/spec/fixtures/sip_audio/sip_trunks_internal_numbers_list.json +16 -0
- data/spec/fixtures/sip_audio/sip_trunks_numbers_assign.json +7 -0
- data/spec/fixtures/sip_audio/sip_trunks_numbers_list.json +9 -0
- data/spec/fixtures/token/access_token.json +7 -0
- data/spec/fixtures/token/data_compliance.json +8 -0
- data/spec/fixtures/token/refresh_token.json +7 -0
- data/spec/fixtures/user/assistant/create.json +4 -0
- data/spec/fixtures/user/assistant/list.json +8 -0
- data/spec/fixtures/user/email_check.json +3 -0
- data/spec/fixtures/user/get.json +35 -21
- data/spec/fixtures/user/list.json +17 -13
- data/spec/fixtures/user/permissions.json +65 -0
- data/spec/fixtures/user/recording/list.json +50 -0
- data/spec/fixtures/user/scheduler/list.json +12 -0
- data/spec/fixtures/user/settings_get.json +74 -0
- data/spec/fixtures/user/token.json +3 -0
- data/spec/{lib/zoom/actions/report/webinar_details_report_spec.rb → fixtures/user/update_email.json} +0 -0
- data/spec/{lib/zoom/actions/report/webinar_polls_report_spec.rb → fixtures/user/update_password.json} +0 -0
- data/spec/{lib/zoom/actions/report/webinar_qa_report_spec.rb → fixtures/user/update_status.json} +0 -0
- data/spec/fixtures/user/vanity_name.json +3 -0
- data/spec/fixtures/webinar/panelist_list.json +12 -0
- data/spec/fixtures/webinar/past_webinar_list.json +8 -0
- data/spec/fixtures/webinar/poll_get.json +13 -0
- data/spec/fixtures/webinar/polls_list.json +16 -0
- data/spec/fixtures/webinar/registrant/get.json +25 -0
- data/spec/lib/zoom/actions/account/create_spec.rb +68 -0
- data/spec/lib/zoom/actions/account/delete_spec.rb +44 -0
- data/spec/lib/zoom/actions/account/get_locked_settings_spec.rb +43 -0
- data/spec/lib/zoom/actions/account/get_spec.rb +43 -0
- data/spec/lib/zoom/actions/account/list_spec.rb +58 -0
- data/spec/lib/zoom/actions/account/managed_domains_spec.rb +43 -0
- data/spec/lib/zoom/actions/account/options_update_spec.rb +58 -0
- data/spec/lib/zoom/actions/account/settings_get_spec.rb +50 -0
- data/spec/lib/zoom/actions/account/settings_update_spec.rb +55 -0
- data/spec/lib/zoom/actions/account/trusted_domains_spec.rb +43 -0
- data/spec/lib/zoom/actions/billing/get_spec.rb +48 -0
- data/spec/lib/zoom/actions/billing/plans_list_spec.rb +48 -0
- data/spec/lib/zoom/actions/billing/plans_subscribe_spec.rb +69 -0
- data/spec/lib/zoom/actions/billing/plans_usage_spec.rb +48 -0
- data/spec/lib/zoom/actions/billing/update_spec.rb +64 -0
- data/spec/lib/zoom/actions/dashboard/crc_spec.rb +33 -0
- data/spec/lib/zoom/actions/dashboard/meeting_details_spec.rb +62 -0
- data/spec/lib/zoom/actions/dashboard/meeting_participants_spec.rb +74 -0
- data/spec/lib/zoom/actions/dashboard/meetings_spec.rb +63 -0
- data/spec/lib/zoom/actions/groups/create_spec.rb +98 -0
- data/spec/lib/zoom/actions/{group → groups}/delete_spec.rb +0 -0
- data/spec/lib/zoom/actions/{group → groups}/edit_spec.rb +0 -0
- data/spec/lib/zoom/actions/groups/get_spec.rb +62 -0
- data/spec/lib/zoom/actions/groups/list_spec.rb +47 -0
- data/spec/lib/zoom/actions/{group → groups}/member/add_spec.rb +0 -0
- data/spec/lib/zoom/actions/{group → groups}/member/delete_spec.rb +0 -0
- data/spec/lib/zoom/actions/{group → groups/member}/list_spec.rb +0 -0
- data/spec/lib/zoom/actions/groups/update_spec.rb +59 -0
- data/spec/lib/zoom/actions/im/chat/channels/get_spec.rb +64 -0
- data/spec/lib/zoom/actions/im/chat/users/channels/get_spec.rb +45 -0
- data/spec/lib/zoom/actions/meeting/add_registrant_spec.rb +30 -0
- data/spec/lib/zoom/actions/meeting/create_spec.rb +13 -13
- data/spec/lib/zoom/actions/meeting/delete_spec.rb +17 -34
- data/spec/lib/zoom/actions/meeting/get_spec.rb +21 -31
- data/spec/lib/zoom/actions/meeting/invitation_spec.rb +48 -0
- data/spec/lib/zoom/actions/meeting/livestream_spec.rb +61 -0
- data/spec/lib/zoom/actions/meeting/update_spec.rb +48 -42
- data/spec/lib/zoom/actions/recording/file_delete_spec.rb +33 -0
- data/spec/lib/zoom/actions/recording/get_spec.rb +19 -35
- data/spec/lib/zoom/actions/recording/list_spec.rb +20 -26
- data/spec/lib/zoom/actions/recording/settings/get_spec.rb +42 -0
- data/spec/lib/zoom/actions/recording/settings/update_spec.rb +32 -0
- data/spec/lib/zoom/actions/report/meeting_details_report_spec.rb +44 -0
- data/spec/lib/zoom/actions/report/meeting_participants_report_spec.rb +44 -0
- data/spec/lib/zoom/actions/report/webinar_participants_report_spec.rb +2 -2
- data/spec/lib/zoom/actions/roles/assign_spec.rb +25 -0
- data/spec/lib/zoom/actions/roles/create_spec.rb +55 -0
- data/spec/lib/zoom/actions/roles/get_spec.rb +37 -0
- data/spec/lib/zoom/actions/roles/list_spec.rb +28 -0
- data/spec/lib/zoom/actions/roles/members_spec.rb +35 -0
- data/spec/lib/zoom/actions/roles/unassign_spec.rb +34 -0
- data/spec/lib/zoom/actions/sip_audio/add_trunks_internal_callout_countries_spec.rb +25 -0
- data/spec/lib/zoom/actions/sip_audio/add_trunks_internal_numbers_spec.rb +25 -0
- data/spec/lib/zoom/actions/sip_audio/assign_numbers_spec.rb +29 -0
- data/spec/lib/zoom/actions/sip_audio/delete_internal_callout_countries_spec.rb +44 -0
- data/spec/lib/zoom/actions/sip_audio/delete_trunk_internal_numbers_spec.rb +44 -0
- data/spec/lib/zoom/actions/sip_audio/delete_trunk_numbers_spec.rb +44 -0
- data/spec/lib/zoom/actions/sip_audio/delete_trunks_spec.rb +44 -0
- data/spec/lib/zoom/actions/sip_audio/get_trunks_spec.rb +50 -0
- data/spec/lib/zoom/actions/sip_audio/list_trunk_numbers_spec.rb +46 -0
- data/spec/lib/zoom/actions/sip_audio/list_trunks_internal_callout_country_spec.rb +53 -0
- data/spec/lib/zoom/actions/sip_audio/list_trunks_internal_numbers_spec.rb +53 -0
- data/spec/lib/zoom/actions/token/access_token_spec.rb +26 -0
- data/spec/lib/zoom/actions/token/data_compliance_spec.rb +41 -0
- data/spec/lib/zoom/actions/token/refresh_token_spec.rb +26 -0
- data/spec/lib/zoom/actions/user/assistant/create_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/assistant/delete_all_spec.rb +44 -0
- data/spec/lib/zoom/actions/user/assistant/delete_spec.rb +48 -1
- data/spec/lib/zoom/actions/user/assistant/list_spec.rb +53 -0
- data/spec/lib/zoom/actions/user/create_spec.rb +20 -48
- data/spec/lib/zoom/actions/user/delete_spec.rb +2 -2
- data/spec/lib/zoom/actions/user/email_check_spec.rb +43 -0
- data/spec/lib/zoom/actions/user/get_spec.rb +12 -3
- data/spec/lib/zoom/actions/user/list_recordings_spec.rb +57 -0
- data/spec/lib/zoom/actions/user/list_spec.rb +34 -3
- data/spec/lib/zoom/actions/user/permissions_spec.rb +52 -0
- data/spec/lib/zoom/actions/user/scheduler/delete_all_spec.rb +44 -0
- data/spec/lib/zoom/actions/user/scheduler/delete_spec.rb +50 -0
- data/spec/lib/zoom/actions/user/scheduler/list_spec.rb +53 -0
- data/spec/lib/zoom/actions/user/settings_get_spec.rb +56 -0
- data/spec/lib/zoom/actions/user/settings_update_spec.rb +50 -0
- data/spec/lib/zoom/actions/user/token_spec.rb +61 -0
- data/spec/lib/zoom/actions/user/update_email_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/update_password_spec.rb +29 -0
- data/spec/lib/zoom/actions/user/update_spec.rb +2 -2
- data/spec/lib/zoom/actions/user/update_status_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/vanity_name_spec.rb +51 -0
- data/spec/lib/zoom/actions/webinar/create_spec.rb +49 -44
- data/spec/lib/zoom/actions/webinar/delete_spec.rb +3 -3
- data/spec/lib/zoom/actions/webinar/get_spec.rb +1 -1
- data/spec/lib/zoom/actions/webinar/list_spec.rb +2 -2
- data/spec/lib/zoom/actions/webinar/panelist_list_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/poll_get_spec.rb +47 -0
- data/spec/lib/zoom/actions/webinar/polls_list_spec.rb +44 -0
- data/spec/lib/zoom/actions/webinar/registrants/add_spec.rb +2 -2
- data/spec/lib/zoom/actions/webinar/registrants/get_spec.rb +49 -0
- data/spec/lib/zoom/actions/webinar/registrants/list_spec.rb +2 -2
- data/spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb +1 -1
- data/spec/lib/zoom/actions/webinar/update_spec.rb +2 -2
- data/spec/lib/zoom/actions_spec.rb +84 -0
- data/spec/lib/zoom/client_spec.rb +85 -7
- data/spec/lib/zoom/params_spec.rb +23 -3
- data/spec/lib/zoom/utils_spec.rb +13 -18
- data/spec/spec_helper.rb +23 -2
- data/zoom_rb.gemspec +1 -1
- metadata +343 -112
- data/.ruby-version +0 -1
- data/lib/zoom/actions/group.rb +0 -8
- data/lib/zoom/actions/metrics.rb +0 -27
- data/lib/zoom/constants.rb +0 -103
- data/spec/fixtures/meeting/delete.json +0 -4
- data/spec/fixtures/meeting/end.json +0 -4
- data/spec/fixtures/meeting/live.json +0 -32
- data/spec/fixtures/meeting/register.json +0 -7
- data/spec/fixtures/meeting/update.json +0 -4
- data/spec/fixtures/metrics_crc.json +0 -105
- data/spec/fixtures/metrics_meetingdetail.json +0 -32
- data/spec/fixtures/recording_delete.json +0 -4
- data/spec/fixtures/recording_list.json +0 -51
- data/spec/fixtures/user/assistant/delete.json +0 -5
- data/spec/lib/zoom/actions/group/create_spec.rb +0 -3
- data/spec/lib/zoom/actions/group/get_spec.rb +0 -3
- data/spec/lib/zoom/actions/group/member/list_spec.rb +0 -3
- data/spec/lib/zoom/actions/meeting/end_spec.rb +0 -55
- data/spec/lib/zoom/actions/meeting/live_spec.rb +0 -43
- data/spec/lib/zoom/actions/meeting/register_spec.rb +0 -45
- data/spec/lib/zoom/actions/metrics/crc_spec.rb +0 -48
- data/spec/lib/zoom/actions/metrics/im_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/meetingdetail_spec.rb +0 -51
- data/spec/lib/zoom/actions/metrics/meetings_spec.rb +0 -61
- data/spec/lib/zoom/actions/metrics/qos_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/webinardetail_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/webinars_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/zoomroomdetail_spec.rb +0 -3
- data/spec/lib/zoom/actions/metrics/zoomrooms_spec.rb +0 -3
- data/spec/lib/zoom/actions/recording/delete_spec.rb +0 -52
- data/spec/lib/zoom/actions/recording/mc_list_spec.rb +0 -51
- data/spec/lib/zoom/actions/user/activate_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/checkemail_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/checkzpk_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/deactivate_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/revoketoken_spec.rb +0 -3
- data/spec/lib/zoom/actions/user/updatepassword_spec.rb +0 -3
- data/spec/lib/zoom/actions/webinar/panelists_spec.rb +0 -3
- data/spec/lib/zoom/actions/webinar/polls_spec.rb +0 -3
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::IM::Chat do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { channel_id: 999999999 } }
|
8
|
+
let(:missed_channel_args) { { channel_id: 1000000 } }
|
9
|
+
let(:missed_channel_response) { zc.get_chat_channels(missed_channel_args) }
|
10
|
+
|
11
|
+
describe '#get_chat_channels action' do
|
12
|
+
context 'with a valid response' do
|
13
|
+
before :each do
|
14
|
+
stub_request(
|
15
|
+
:get,
|
16
|
+
zoom_url("/chat/channels/#{args[:channel_id]}")
|
17
|
+
).to_return(body: json_response('chat', 'channels', 'get'),
|
18
|
+
headers: { 'Content-Type' => 'application/json' })
|
19
|
+
end
|
20
|
+
|
21
|
+
it "requires a 'channel_id' argument" do
|
22
|
+
expect { zc.get_chat_channels }.to raise_error(Zoom::ParameterMissing, [:channel_id].to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'returns a hash' do
|
26
|
+
expect(zc.get_chat_channels(args)).to be_kind_of(Hash)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'with a 400 response' do
|
31
|
+
before :each do
|
32
|
+
stub_request(
|
33
|
+
:get,
|
34
|
+
zoom_url("/chat/channels/#{args[:channel_id]}")
|
35
|
+
).to_return(status: 400,
|
36
|
+
body: json_response('error', 'unauthorized_request'),
|
37
|
+
headers: { 'Content-Type' => 'application/json' })
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'raises Zoom::Error exception' do
|
41
|
+
expect { zc.get_chat_channels(args) }.to raise_error(Zoom::Error, {
|
42
|
+
base: "Unauthorized request. You do not have permission to access this user’s channel information."
|
43
|
+
}.to_s)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
context 'with a 404 response' do
|
48
|
+
before :each do
|
49
|
+
stub_request(
|
50
|
+
:get,
|
51
|
+
zoom_url("/chat/channels/#{missed_channel_args[:channel_id]}")
|
52
|
+
).to_return(status: 404,
|
53
|
+
body: json_response('error', 'channel_not_found'),
|
54
|
+
headers: { 'Content-Type' => 'application/json' })
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'returns a hash 404' do
|
58
|
+
expect { zc.get_chat_channels(missed_channel_args) }.to raise_error(Zoom::Error, {
|
59
|
+
base: "Channel does not exist: #{missed_channel_args[:channel_id]}"
|
60
|
+
}.to_s)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::IM::Chat do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { user_id: 555 } }
|
8
|
+
|
9
|
+
describe '#get_chat_user_channels action' do
|
10
|
+
context 'with a valid response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:get,
|
14
|
+
zoom_url("/chat/users/#{args[:user_id]}/channels")
|
15
|
+
).to_return(body: json_response('chat', 'users', 'channels', 'list'),
|
16
|
+
headers: { 'Content-Type' => 'application/json' })
|
17
|
+
end
|
18
|
+
|
19
|
+
it "requires a 'user_id' argument" do
|
20
|
+
expect { zc.get_chat_user_channels }.to raise_error(Zoom::ParameterMissing, [:user_id].to_s)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'returns a hash' do
|
24
|
+
expect(zc.get_chat_user_channels(args)).to be_kind_of(Hash)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'with a 400 response' do
|
29
|
+
before :each do
|
30
|
+
stub_request(
|
31
|
+
:get,
|
32
|
+
zoom_url("/chat/users/#{args[:user_id]}/channels")
|
33
|
+
).to_return(status: 400,
|
34
|
+
body: json_response('error', 'next_page_token_invalid'),
|
35
|
+
headers: { 'Content-Type' => 'application/json' })
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'raises Zoom::Error exception with text' do
|
39
|
+
expect { zc.get_chat_user_channels(args) }.to raise_error(Zoom::Error, {
|
40
|
+
base: 'The next page token is either invalid or has expired.'
|
41
|
+
}.to_s)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::Meeting do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { meeting_id: 1, email: 'foo@bar.com', first_name: 'Foo' } }
|
8
|
+
let(:join_url) { 'https://www.zoom.us/w/869275230' }
|
9
|
+
|
10
|
+
describe '#meeting_add_registrant action' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:post,
|
14
|
+
zoom_url("/meetings/#{args[:meeting_id]}/registrants")
|
15
|
+
).to_return(body: json_response('meeting', 'add_registrant'), headers: { 'Content-Type' => 'application/json' })
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'returns a hash' do
|
19
|
+
expect(zc.meeting_add_registrant(args)).to be_kind_of(Hash)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "returns the created user's unique registrant_id" do
|
23
|
+
expect(zc.meeting_add_registrant(args)['registrant_id']).to eql('555')
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'returns a join_url' do
|
27
|
+
expect(zc.meeting_add_registrant(args)['join_url']).to eql(join_url)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe Zoom::Actions::Meeting do
|
6
6
|
let(:zc) { zoom_client }
|
7
|
-
let(:args) { {
|
7
|
+
let(:args) { { topic: 'Zoom Meeting Topic', start_time: '2020-05-05T21:00:00Z', timezone: 'America/New_York', duration: 30, type: 2, user_id: 'r55v2FgSTVmDmVot18DX3A', template_id: 'template_id' } }
|
8
8
|
let(:response) { zc.meeting_create(args) }
|
9
9
|
|
10
10
|
describe '#meeting_create action' do
|
@@ -13,9 +13,11 @@ describe Zoom::Actions::Meeting do
|
|
13
13
|
stub_request(
|
14
14
|
:post,
|
15
15
|
zoom_url("/users/#{args[:user_id]}/meetings")
|
16
|
-
).to_return(
|
17
|
-
|
18
|
-
|
16
|
+
).to_return(
|
17
|
+
status: 201,
|
18
|
+
body: json_response('meeting','create'),
|
19
|
+
headers: { 'Content-Type' => 'application/json' }
|
20
|
+
)
|
19
21
|
end
|
20
22
|
|
21
23
|
it "requires user_id param" do
|
@@ -24,12 +26,6 @@ describe Zoom::Actions::Meeting do
|
|
24
26
|
}.to raise_error(Zoom::ParameterMissing, [:user_id].to_s)
|
25
27
|
end
|
26
28
|
|
27
|
-
it "requires user_id param" do
|
28
|
-
expect {
|
29
|
-
zc.meeting_create(args)
|
30
|
-
}.not_to raise_error
|
31
|
-
end
|
32
|
-
|
33
29
|
it 'returns a hash' do
|
34
30
|
expect(response).to be_kind_of(Hash)
|
35
31
|
end
|
@@ -37,6 +33,8 @@ describe Zoom::Actions::Meeting do
|
|
37
33
|
it 'returns the set params' do
|
38
34
|
expect(response['type']).to eq(args[:type])
|
39
35
|
expect(response['topic']).to eq(args[:topic])
|
36
|
+
expect(response['start_time']).to eq(args[:start_time])
|
37
|
+
expect(response['duration']).to eq(args[:duration])
|
40
38
|
end
|
41
39
|
|
42
40
|
it "returns 'start_url' and 'join_url'" do
|
@@ -50,9 +48,11 @@ describe Zoom::Actions::Meeting do
|
|
50
48
|
stub_request(
|
51
49
|
:post,
|
52
50
|
zoom_url("/users/#{args[:user_id]}/meetings")
|
53
|
-
).to_return(
|
54
|
-
|
55
|
-
|
51
|
+
).to_return(
|
52
|
+
status: 404,
|
53
|
+
body: json_response('error', 'user_not_exist'),
|
54
|
+
headers: { 'Content-Type' => 'application/json' }
|
55
|
+
)
|
56
56
|
end
|
57
57
|
|
58
58
|
it 'raises an error' do
|
@@ -2,54 +2,37 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
|
5
|
+
describe Zoom::Actions::Meeting do
|
6
6
|
let(:zc) { zoom_client }
|
7
|
-
let(:args) { {
|
7
|
+
let(:args) { { meeting_id: '91538056781' } }
|
8
8
|
|
9
|
-
|
9
|
+
describe '#meeting_delete action' do
|
10
10
|
before :each do
|
11
11
|
stub_request(
|
12
|
-
:
|
13
|
-
zoom_url(
|
14
|
-
).to_return(
|
12
|
+
:delete,
|
13
|
+
zoom_url("/meetings/#{args[:meeting_id]}")
|
14
|
+
).to_return(
|
15
|
+
status: 204,
|
16
|
+
headers: { 'Content-Type': 'application/json' }
|
17
|
+
)
|
15
18
|
end
|
16
19
|
|
17
|
-
it "requires a '
|
20
|
+
it "requires a 'meeting_id' argument" do
|
18
21
|
expect {
|
19
|
-
zc.meeting_delete(filter_key(args, :
|
20
|
-
}.to raise_error(
|
22
|
+
zc.meeting_delete(filter_key(args, :meeting_id))
|
23
|
+
}.to raise_error(Zoom::ParameterMissing)
|
21
24
|
end
|
22
25
|
|
23
|
-
it
|
24
|
-
expect
|
25
|
-
zc.meeting_delete(filter_key(args, :id))
|
26
|
-
}.to raise_error(ArgumentError)
|
27
|
-
end
|
28
|
-
|
29
|
-
it 'returns a hash' do
|
30
|
-
expect(zc.meeting_delete(args)).to be_kind_of(Hash)
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'returns id and deleted at attributes' do
|
34
|
-
res = zc.meeting_delete(args)
|
35
|
-
|
36
|
-
expect(res['id']).to eq(args[:id])
|
37
|
-
expect(res['deleted_at']).to eq('2013-04-05T15:50:47Z')
|
26
|
+
it 'returns a status code' do
|
27
|
+
expect(zc.meeting_delete(args)).to eq 204
|
38
28
|
end
|
39
29
|
end
|
40
30
|
|
41
|
-
|
42
|
-
|
43
|
-
stub_request(
|
44
|
-
:post,
|
45
|
-
zoom_url('/meeting/delete')
|
46
|
-
).to_return(body: json_response('error'))
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'raises Zoom::Error exception' do
|
31
|
+
describe '#meeting_delete! action' do
|
32
|
+
it 'raises NoMethodError exception' do
|
50
33
|
expect {
|
51
34
|
zc.meeting_delete!(args)
|
52
|
-
}.to raise_error(
|
35
|
+
}.to raise_error(NoMethodError)
|
53
36
|
end
|
54
37
|
end
|
55
38
|
end
|
@@ -2,28 +2,26 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
|
5
|
+
describe Zoom::Actions::Meeting do
|
6
6
|
let(:zc) { zoom_client }
|
7
|
-
let(:args) { {
|
7
|
+
let(:args) { { meeting_id: 91538056781 } }
|
8
8
|
|
9
|
-
|
9
|
+
describe '#meeting_get action' do
|
10
10
|
before :each do
|
11
11
|
stub_request(
|
12
|
-
:
|
13
|
-
zoom_url(
|
14
|
-
).to_return(
|
12
|
+
:get,
|
13
|
+
zoom_url("/meetings/#{args[:meeting_id]}")
|
14
|
+
).to_return(
|
15
|
+
status: 200,
|
16
|
+
body: json_response('meeting','get'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' }
|
18
|
+
)
|
15
19
|
end
|
16
20
|
|
17
|
-
it "requires a '
|
21
|
+
it "requires a 'meeting' argument" do
|
18
22
|
expect {
|
19
|
-
zc.meeting_get(filter_key(args, :
|
20
|
-
}.to raise_error(
|
21
|
-
end
|
22
|
-
|
23
|
-
it "requires a 'id' argument" do
|
24
|
-
expect {
|
25
|
-
zc.meeting_get(filter_key(args, :id))
|
26
|
-
}.to raise_error(ArgumentError)
|
23
|
+
zc.meeting_get(filter_key(args, :meeting_id))
|
24
|
+
}.to raise_error(Zoom::ParameterMissing, [:meeting_id].to_s)
|
27
25
|
end
|
28
26
|
|
29
27
|
it 'returns a hash' do
|
@@ -33,27 +31,19 @@ xdescribe Zoom::Actions::Meeting do
|
|
33
31
|
it 'returns id and attributes' do
|
34
32
|
res = zc.meeting_get(args)
|
35
33
|
|
36
|
-
expect(res['id']).to eq(args[:
|
37
|
-
expect(res['
|
38
|
-
expect(res['
|
39
|
-
expect(res['
|
40
|
-
expect(res['
|
41
|
-
expect(res['start_url']).to eq('https://zoom.us/s/123456789?zpk=hs65q23kd9sqliy612h23k')
|
34
|
+
expect(res['id']).to eq(args[:meeting_id])
|
35
|
+
expect(res['topic']).to eq('Zoom Meeting Topic')
|
36
|
+
expect(res['start_time']).to eq('2020-05-05T21:00:00Z')
|
37
|
+
expect(res['join_url']).to eq('https://company.zoom.us/j/91538056781')
|
38
|
+
expect(res['start_url']).to eq('https://company.zoom.us/s/91538056781?zak=eyJ6bV...')
|
42
39
|
end
|
43
40
|
end
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
stub_request(
|
48
|
-
:post,
|
49
|
-
zoom_url('/meeting/get')
|
50
|
-
).to_return(body: json_response('error'))
|
51
|
-
end
|
52
|
-
|
53
|
-
it 'raises Zoom::Error exception' do
|
42
|
+
describe '#meeting_get! action' do
|
43
|
+
it 'raises NoMethodError exception' do
|
54
44
|
expect {
|
55
45
|
zc.meeting_get!(args)
|
56
|
-
}.to raise_error(
|
46
|
+
}.to raise_error(NoMethodError)
|
57
47
|
end
|
58
48
|
end
|
59
49
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::Meeting do
|
6
|
+
subject(:meeting_invitation) { zoom_client.meeting_invitation(args) }
|
7
|
+
|
8
|
+
let(:args) { { meeting_id: 91538056781 } }
|
9
|
+
|
10
|
+
describe '#meeting_invitation action' do
|
11
|
+
before do
|
12
|
+
stub_request(
|
13
|
+
:get, zoom_url("/meetings/#{args[:meeting_id]}/invitation")
|
14
|
+
).to_return(
|
15
|
+
status: 200,
|
16
|
+
body: json_response('meeting', 'invitation'),
|
17
|
+
headers: { 'Content-Type' => 'application/json' }
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
context 'without :meeting_id parameter provided' do
|
22
|
+
let(:args) { {} }
|
23
|
+
|
24
|
+
it "requires a 'meeting_id' argument" do
|
25
|
+
expect { meeting_invitation }.to(
|
26
|
+
raise_error(Zoom::ParameterMissing, %i[meeting_id].to_s)
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'when meeting_id parameter provided' do
|
32
|
+
let(:invitation) do
|
33
|
+
"Team Member is inviting you to a scheduled Zoom meeting.\r\n\r\n"\
|
34
|
+
"Topic: Test meeting\r\nTime: Sep 17, 2020 03:49 PM Kiev\r\n\r\n"\
|
35
|
+
"Join Zoom Meeting\r\nhttps://zoom.us/j/9451234446749?pwd=K3AwTGtdUVdqSnNVWnd6MaZxZnZEdz09\r\n\r\n"\
|
36
|
+
"Meeting ID: 943 1234 6721\r\nPasscode: DgA4yb\r\n\r\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'returns a hash' do
|
40
|
+
expect(meeting_invitation).to be_kind_of(Hash)
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'returns id and attributes' do
|
44
|
+
expect(meeting_invitation['invitation']).to eq(invitation)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::Meeting do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { meeting_id: '3qn1231nd', stream_url: 'owuj2n323hdns', stream_key: 'w02KPjeena' } }
|
8
|
+
let(:response) { zc.livestream(args) }
|
9
|
+
|
10
|
+
describe '#livestream action' do
|
11
|
+
context 'with 204 response' do
|
12
|
+
before :each do
|
13
|
+
stub_request(
|
14
|
+
:patch,
|
15
|
+
zoom_url("/meetings/#{args[:meeting_id]}/livestream")
|
16
|
+
).to_return(status: 204,
|
17
|
+
headers: { 'Content-Type' => 'application/json' })
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires meeting_id param" do
|
21
|
+
expect {
|
22
|
+
zc.livestream(filter_key(args, :meeting_id))
|
23
|
+
}.to raise_error(Zoom::ParameterMissing, [:meeting_id].to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'returns a hash' do
|
27
|
+
expect(response).to eq(204)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'with 300 response' do
|
32
|
+
before :each do
|
33
|
+
stub_request(
|
34
|
+
:patch,
|
35
|
+
zoom_url("/meetings/#{args[:meeting_id]}/livestream")
|
36
|
+
).to_return(status: 300,
|
37
|
+
body: json_response('meeting', 'live_stream', 'errors', 'missing_field'),
|
38
|
+
headers: { 'Content-Type' => 'application/json' })
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'raises an error' do
|
42
|
+
expect { response }.to raise_error(Zoom::Error)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'with 404 response' do
|
47
|
+
before :each do
|
48
|
+
stub_request(
|
49
|
+
:patch,
|
50
|
+
zoom_url("/meetings/#{args[:meeting_id]}/livestream")
|
51
|
+
).to_return(status: 404,
|
52
|
+
body: json_response('meeting', 'live_stream', 'errors', 'meeting_not_found'),
|
53
|
+
headers: { 'Content-Type' => 'application/json' })
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'raises an error' do
|
57
|
+
expect { response }.to raise_error(Zoom::Error)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -2,52 +2,58 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
|
5
|
+
describe Zoom::Actions::Meeting do
|
6
6
|
let(:zc) { zoom_client }
|
7
|
-
let(:args) { {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
7
|
+
let(:args) { { meeting_id: 91538056781, topic: 'Updated Topic' } }
|
8
|
+
|
9
|
+
describe '#meeting_update action' do
|
10
|
+
context 'with 204 response' do
|
11
|
+
before :each do
|
12
|
+
stub_request(
|
13
|
+
:patch,
|
14
|
+
zoom_url("/meetings/#{args[:meeting_id]}")
|
15
|
+
).to_return(
|
16
|
+
status: 204,
|
17
|
+
headers: { 'Content-Type' => 'application/json' }
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "requires a 'meeting_id' argument" do
|
22
|
+
expect {
|
23
|
+
zc.meeting_update(filter_key(args, :meeting_id))
|
24
|
+
}.to raise_error(Zoom::ParameterMissing, [:meeting_id].to_s)
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'returns a status code' do
|
28
|
+
expect(zc.meeting_update(args)).to eq 204
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'with 404 response' do
|
33
|
+
before :each do
|
34
|
+
stub_request(
|
35
|
+
:patch,
|
36
|
+
zoom_url("/meetings/invalid-meeting-id")
|
37
|
+
).to_return(
|
38
|
+
status: 404,
|
39
|
+
body: json_response('error', 'meeting_not_exist'),
|
40
|
+
headers: { 'Content-Type' => 'application/json' }
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'raises an error' do
|
45
|
+
expect {
|
46
|
+
zc.meeting_update(args.merge(meeting_id: 'invalid-meeting-id'))
|
47
|
+
}.to raise_error(Zoom::Error, { base: "Invalid meeting id." }.to_s)
|
48
|
+
end
|
38
49
|
end
|
39
50
|
end
|
40
51
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
).to_return(body: json_response('error'))
|
47
|
-
end
|
48
|
-
|
49
|
-
it 'raises Zoom::Error exception' do
|
50
|
-
expect { zc.meeting_update!(args) }.to raise_error(Zoom::Error)
|
52
|
+
describe '#meeting_update! action' do
|
53
|
+
it 'raises NoMethodError exception' do
|
54
|
+
expect {
|
55
|
+
zc.meeting_update!(args)
|
56
|
+
}.to raise_error(NoMethodError)
|
51
57
|
end
|
52
58
|
end
|
53
59
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe Zoom::Actions::Recording do
|
6
|
+
let(:zc) { zoom_client }
|
7
|
+
let(:args) { { recording_id: 'kEFomHcIRgqxZT8D086O6A', meeting_id: 933560800 } }
|
8
|
+
|
9
|
+
describe '#meeting_recording_file_delete action' do
|
10
|
+
before :each do
|
11
|
+
stub_request(
|
12
|
+
:delete,
|
13
|
+
zoom_url("/meetings/#{args[:meeting_id]}/recordings/#{args[:recording_id]}")
|
14
|
+
).to_return(
|
15
|
+
status: 204,
|
16
|
+
headers: { 'Content-Type' => 'application/json' }
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "requires a 'meeting_id' and 'recording_id' argument" do
|
21
|
+
expect {
|
22
|
+
zc.meeting_recording_file_delete(filter_key(args, :meeting_id))
|
23
|
+
}.to raise_error(Zoom::ParameterMissing)
|
24
|
+
expect {
|
25
|
+
zc.meeting_recording_file_delete(filter_key(args, :recording_id))
|
26
|
+
}.to raise_error(Zoom::ParameterMissing)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'returns a status code' do
|
30
|
+
expect(zc.meeting_recording_file_delete(args)).to eq 204
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|