zoom_rb 0.8.7 → 0.11.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 +15 -0
- data/Gemfile.lock +85 -51
- data/Makefile +1 -1
- data/README.md +33 -1
- data/lib/zoom/actions/account.rb +35 -60
- data/lib/zoom/actions/billing.rb +38 -0
- data/lib/zoom/actions/dashboard.rb +33 -0
- data/lib/zoom/actions/groups.rb +17 -0
- data/lib/zoom/actions/im/chat.rb +18 -6
- data/lib/zoom/actions/meeting.rb +68 -49
- data/lib/zoom/actions/phone.rb +27 -0
- data/lib/zoom/actions/recording.rb +25 -16
- data/lib/zoom/actions/report.rb +10 -35
- data/lib/zoom/actions/roles.rb +41 -0
- data/lib/zoom/actions/sip_audio.rb +75 -0
- data/lib/zoom/actions/token.rb +35 -0
- data/lib/zoom/actions/user.rb +58 -73
- data/lib/zoom/actions/webinar.rb +47 -48
- data/lib/zoom/client.rb +32 -13
- 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 +12 -31
- data/lib/zoom/version.rb +5 -0
- 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/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/meeting_not_exist.json +4 -0
- data/spec/fixtures/error/next_page_token_invalid.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/get.json +5 -0
- data/spec/fixtures/groups/list.json +15 -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.json +19 -0
- data/spec/fixtures/report/meeting/participants.json +17 -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/telephone_report_spec.rb → fixtures/user/update_password.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/{group → groups}/create_spec.rb +0 -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/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 +2 -2
- 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_password_spec.rb +29 -0
- data/spec/lib/zoom/actions/user/update_spec.rb +2 -2
- 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/client_spec.rb +85 -7
- data/spec/lib/zoom/params_spec.rb +23 -3
- data/spec/lib/zoom/utils_spec.rb +12 -17
- data/spec/spec_helper.rb +23 -2
- data/zoom_rb.gemspec +6 -2
- metadata +318 -110
- 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/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/report/webinar_details_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/webinar_polls_report_spec.rb +0 -0
- data/spec/lib/zoom/actions/report/webinar_qa_report_spec.rb +0 -0
- 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,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
module Zoom
|
4
|
+
module Actions
|
5
|
+
module Token
|
6
|
+
def access_tokens(*args)
|
7
|
+
options = Zoom::Params.new(Utils.extract_options!(args))
|
8
|
+
options.require(%i[auth_code redirect_uri])
|
9
|
+
response = self.class.post("/oauth/token?grant_type=authorization_code&code=#{options[:auth_code]}&redirect_uri=#{options[:redirect_uri]}", headers: oauth_request_headers, base_uri: 'https://zoom.us/')
|
10
|
+
Utils.parse_response(response)
|
11
|
+
end
|
12
|
+
|
13
|
+
def refresh_tokens(*args)
|
14
|
+
options = Zoom::Params.new(Utils.extract_options!(args))
|
15
|
+
options.require(:refresh_token)
|
16
|
+
response = self.class.post("/oauth/token?grant_type=refresh_token&refresh_token=#{options[:refresh_token]}", headers: oauth_request_headers, base_uri: 'https://zoom.us/')
|
17
|
+
Utils.parse_response(response)
|
18
|
+
end
|
19
|
+
|
20
|
+
def data_compliance(*args)
|
21
|
+
options = Zoom::Params.new(Utils.extract_options!(args))
|
22
|
+
options.require(%i[client_id user_id account_id deauthorization_event_received compliance_completed])
|
23
|
+
response = self.class.post("/oauth/data/compliance", body: options.to_json, headers: oauth_request_headers, base_uri: 'https://zoom.us/')
|
24
|
+
Utils.parse_response response
|
25
|
+
end
|
26
|
+
|
27
|
+
def revoke_tokens(*args)
|
28
|
+
options = Zoom::Params.new(Utils.extract_options!(args))
|
29
|
+
options.require(%i[access_token])
|
30
|
+
response = self.class.post("/oauth/revoke?token=#{options[:access_token]}", headers: oauth_request_headers, base_uri: 'https://zoom.us/')
|
31
|
+
Utils.parse_response(response)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/zoom/actions/user.rb
CHANGED
@@ -5,8 +5,8 @@ module Zoom
|
|
5
5
|
module User
|
6
6
|
def user_list(*args)
|
7
7
|
params = Zoom::Params.new(Utils.extract_options!(args))
|
8
|
-
params.permit(%i[status page_size page_number])
|
9
|
-
response = self.class.get('/users', query: params
|
8
|
+
params.permit(%i[status page_size role_id page_number include_fields next_page_token])
|
9
|
+
response = self.class.get('/users', query: params, headers: request_headers)
|
10
10
|
Utils.parse_response(response)
|
11
11
|
end
|
12
12
|
|
@@ -15,133 +15,118 @@ module Zoom
|
|
15
15
|
require_param_keys = %i[action email type]
|
16
16
|
require_param_keys.append(:password) if params[:action] == 'autoCreate'
|
17
17
|
params.require(require_param_keys)
|
18
|
-
params.permit_value(:action, Zoom::Constants::
|
19
|
-
Utils.parse_response self.class.post('/users', body: { action: params[:action], user_info: params.except(:action) }.to_json,
|
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, 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)
|
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),
|
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)
|
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)
|
41
|
-
|
42
|
-
|
43
|
-
|
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))
|
41
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
42
|
+
params.require(:user_id)
|
43
|
+
Utils.parse_response(self.class.get("/users/#{params[:user_id]}/assistants", query: params.except(:user_id), headers: request_headers))
|
46
44
|
end
|
47
45
|
|
48
46
|
def user_assistants_create(*args)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
Utils.parse_response self.class.post("/users/#{options.slice!(:id)}/assistants", body: options, query: { access_token: access_token })
|
47
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
48
|
+
params.require(:user_id).permit(:assistants)
|
49
|
+
Utils.parse_response self.class.post("/users/#{params[:user_id]}/assistants", body: params.except(:user_id).to_json, headers: request_headers)
|
53
50
|
end
|
54
51
|
|
55
52
|
def user_assistants_delete_all(*args)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
Utils.parse_response self.class.delete("/users/#{options.slice!(:id)}/assistants", body: options, query: { access_token: access_token })
|
53
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
54
|
+
params.require(:user_id)
|
55
|
+
Utils.parse_response(self.class.delete("/users/#{params[:user_id]}/assistants", query: params.except(:user_id), headers: request_headers))
|
60
56
|
end
|
61
57
|
|
62
58
|
def user_assistants_delete(*args)
|
63
|
-
|
64
|
-
|
65
|
-
|
59
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
60
|
+
params.require(%i[user_id assistant_id])
|
61
|
+
Utils.parse_response(self.class.delete("/users/#{params[:user_id]}/assistants/#{params[:assistant_id]}", query: params.except(:user_id, :assistant_id), headers: request_headers))
|
66
62
|
end
|
67
63
|
|
68
64
|
def user_schedulers_list(*args)
|
69
|
-
|
70
|
-
|
71
|
-
|
65
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
66
|
+
params.require(:user_id)
|
67
|
+
Utils.parse_response(self.class.get("/users/#{params[:user_id]}/schedulers", query: params.except(:user_id), headers: request_headers))
|
72
68
|
end
|
73
69
|
|
74
70
|
def user_schedulers_delete_all(*args)
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
72
|
+
params.require(:user_id)
|
73
|
+
Utils.parse_response(self.class.delete("/users/#{params[:user_id]}/schedulers", query: params.except(:user_id), headers: request_headers))
|
78
74
|
end
|
79
75
|
|
80
76
|
def user_schedulers_delete(*args)
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
85
|
-
|
86
|
-
def user_upload_picture(*args)
|
87
|
-
# TODO: implement user_upload_picture
|
88
|
-
# options = Utils.extract_options!(args)
|
89
|
-
raise Zoom::NotImplemented, 'user_upload_picture is not yet implemented'
|
77
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
78
|
+
params.require(%i[user_id scheduler_id])
|
79
|
+
Utils.parse_response(self.class.delete("/users/#{params[:user_id]}/schedulers/#{params[:scheduler_id]}", query: params.except(:user_id, :scheduler_id), headers: request_headers))
|
90
80
|
end
|
91
81
|
|
92
82
|
def user_settings_get(*args)
|
93
|
-
|
94
|
-
|
95
|
-
|
83
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
84
|
+
params.require(:id).permit(:login_type)
|
85
|
+
Utils.parse_response self.class.get("/users/#{params[:id]}/settings", query: params.except(:id), headers: request_headers)
|
96
86
|
end
|
97
87
|
|
98
88
|
def user_settings_update(*args)
|
99
|
-
|
100
|
-
|
101
|
-
|
89
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
90
|
+
params.require(:id).permit(%i[schedule_meeting in_meeting email_notification recording telephony feature tsp])
|
91
|
+
Utils.parse_response self.class.patch("/users/#{params[:id]}/settings", body: params.except(:id).to_json, headers: request_headers)
|
102
92
|
end
|
103
93
|
|
104
|
-
def
|
105
|
-
|
106
|
-
|
107
|
-
|
94
|
+
def user_email_check(*args)
|
95
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
96
|
+
params.require(:email)
|
97
|
+
Utils.parse_response(self.class.get('/users/email', query: params.slice(:email), headers: request_headers))
|
108
98
|
end
|
109
99
|
|
110
|
-
def
|
111
|
-
|
112
|
-
|
113
|
-
|
100
|
+
def user_recordings_list(*args)
|
101
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
102
|
+
params.require(:id).permit(%i[page_size next_page_token mc trash from to trash_type])
|
103
|
+
Utils.parse_response self.class.get("/users/#{params[:id]}/recordings", query: params.except(:id), headers: request_headers)
|
114
104
|
end
|
115
105
|
|
116
|
-
def
|
117
|
-
|
118
|
-
|
119
|
-
|
106
|
+
def user_token(*args)
|
107
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
108
|
+
params.require(:user_id).permit(%i[type ttl])
|
109
|
+
Utils.parse_response self.class.get("/users/#{params[:user_id]}/token", query: params.except(:user_id), headers: request_headers)
|
120
110
|
end
|
121
111
|
|
122
|
-
def
|
123
|
-
|
124
|
-
|
125
|
-
|
112
|
+
def user_permissions(*args)
|
113
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
114
|
+
params.require(:user_id)
|
115
|
+
Utils.parse_response self.class.get("/users/#{params[:user_id]}/permissions", headers: request_headers)
|
126
116
|
end
|
127
117
|
|
128
|
-
def
|
129
|
-
|
130
|
-
|
131
|
-
|
118
|
+
def user_vanity_name(*args)
|
119
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
120
|
+
params.require(:vanity_name)
|
121
|
+
Utils.parse_response self.class.get("/users/vanity_name", query: params.slice(:vanity_name), headers: request_headers)
|
132
122
|
end
|
133
123
|
|
134
|
-
def
|
135
|
-
|
136
|
-
|
137
|
-
|
124
|
+
def user_password_update(*args)
|
125
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
126
|
+
params.require(:id).permit(%i[password])
|
127
|
+
Utils.parse_response self.class.patch("/users/#{params[:id]}/password", body: params.except(:id), headers: request_headers)
|
138
128
|
end
|
139
129
|
|
140
|
-
def user_vanity_name_check(*args)
|
141
|
-
# TODO: implement user_vanity_name_check
|
142
|
-
# options = Utils.extract_options!(args)
|
143
|
-
raise Zoom::NotImplemented, 'user_vanity_name_check is not yet implemented'
|
144
|
-
end
|
145
130
|
end
|
146
131
|
end
|
147
132
|
end
|
data/lib/zoom/actions/webinar.rb
CHANGED
@@ -5,14 +5,19 @@ module Zoom
|
|
5
5
|
module Webinar
|
6
6
|
RECURRENCE_KEYS = %i[type repeat_interval weekly_days monthly_day monthly_week
|
7
7
|
monthly_week_day end_times end_date_time].freeze
|
8
|
-
SETTINGS_KEYS = %i[panelists_video practice_session hd_video approval_type
|
8
|
+
SETTINGS_KEYS = %i[host_video panelists_video practice_session hd_video approval_type
|
9
9
|
registration_type audio auto_recording enforce_login
|
10
10
|
enforce_login_domains alternative_hosts close_registration
|
11
|
-
show_share_button allow_multiple_devices
|
11
|
+
show_share_button allow_multiple_devices on_demand
|
12
|
+
request_permission_to_unmute_participants global_dial_in_countries
|
13
|
+
contact_name contact_email registrants_restrict_number
|
14
|
+
post_webinar_survey survey_url registrants_email_notification
|
15
|
+
meeting_authentication authentication_option
|
16
|
+
authentication_domains registrants_confirmation_email question_answer].freeze
|
12
17
|
def webinar_list(*args)
|
13
18
|
params = Zoom::Params.new(Utils.extract_options!(args))
|
14
|
-
params.require(:host_id).permit(
|
15
|
-
Utils.parse_response self.class.get("/users/#{params[:host_id]}/webinars", query: params.
|
19
|
+
params.require(:host_id).permit(%i[page_size page_number])
|
20
|
+
Utils.parse_response self.class.get("/users/#{params[:host_id]}/webinars", query: params.except(:host_id), headers: request_headers)
|
16
21
|
end
|
17
22
|
|
18
23
|
def webinar_create(*args)
|
@@ -21,15 +26,15 @@ module Zoom
|
|
21
26
|
:timezone, :password, :agenda,
|
22
27
|
recurrence: RECURRENCE_KEYS,
|
23
28
|
settings: SETTINGS_KEYS)
|
24
|
-
# process recurrence keys based on constants
|
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,
|
29
|
+
# TODO: process recurrence keys based on constants
|
30
|
+
# TODO: process settings keys based on constants
|
31
|
+
Utils.parse_response self.class.post("/users/#{params[:host_id]}/webinars", body: params.except(:host_id).to_json, headers: request_headers)
|
27
32
|
end
|
28
33
|
|
29
34
|
def webinar_get(*args)
|
30
35
|
params = Zoom::Params.new(Utils.extract_options!(args))
|
31
36
|
params.require(:id)
|
32
|
-
Utils.parse_response self.class.get("/webinars/#{params[:id]}",
|
37
|
+
Utils.parse_response self.class.get("/webinars/#{params[:id]}", headers: request_headers)
|
33
38
|
end
|
34
39
|
|
35
40
|
def webinar_update(*args)
|
@@ -38,71 +43,65 @@ module Zoom
|
|
38
43
|
:timezone, :password, :agenda,
|
39
44
|
recurrence: RECURRENCE_KEYS,
|
40
45
|
settings: SETTINGS_KEYS)
|
41
|
-
Utils.parse_response self.class.patch("/webinars/#{params[:id]}", body: params.except(:id).to_json,
|
46
|
+
Utils.parse_response self.class.patch("/webinars/#{params[:id]}", body: params.except(:id).to_json, headers: request_headers)
|
42
47
|
end
|
43
48
|
|
44
49
|
def webinar_delete(*args)
|
45
50
|
params = Zoom::Params.new(Utils.extract_options!(args))
|
46
51
|
params.require(:id).permit(:occurrence_id)
|
47
|
-
Utils.parse_response self.class.delete("/webinars/#{params[:id]}", query: params.except(:id)
|
48
|
-
end
|
49
|
-
|
50
|
-
def webinar_status_update(*args)
|
51
|
-
# TODO: implement webinar_panelists_list
|
52
|
-
# options = Utils.extract_options!(args)
|
53
|
-
raise Zoom::NotImplemented, 'webinar_status_update is not yet implemented'
|
54
|
-
end
|
55
|
-
|
56
|
-
def webinar_panelists_list(*args)
|
57
|
-
# TODO: implement webinar_panelists_list
|
58
|
-
# options = Utils.extract_options!(args)
|
59
|
-
raise Zoom::NotImplemented, 'webinar_panelists_list is not yet implemented'
|
60
|
-
end
|
61
|
-
|
62
|
-
def webinar_panelist_add(*args)
|
63
|
-
# TODO: implement webinar_panelist_add
|
64
|
-
# options = Utils.extract_options!(args)
|
65
|
-
raise Zoom::NotImplemented, 'webinar_panelist_add is not yet implemented'
|
66
|
-
end
|
67
|
-
|
68
|
-
def webinar_panelists_delete_all(*args)
|
69
|
-
# TODO: implement webinar_panelists_delete_all
|
70
|
-
# options = Utils.extract_options!(args)
|
71
|
-
raise Zoom::NotImplemented, 'webinar_panelists_delete_all is not yet implemented'
|
72
|
-
end
|
73
|
-
|
74
|
-
def webinar_panelist_delete(*args)
|
75
|
-
# TODO: implement webinar_panelist_delete
|
76
|
-
# options = Utils.extract_options!(args)
|
77
|
-
raise Zoom::NotImplemented, 'webinar_panelist_delete is not yet implemented'
|
52
|
+
Utils.parse_response self.class.delete("/webinars/#{params[:id]}", query: params.except(:id), headers: request_headers)
|
78
53
|
end
|
79
54
|
|
80
55
|
def webinar_registrants_list(*args)
|
81
56
|
params = Zoom::Params.new(Utils.extract_options!(args))
|
82
57
|
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)
|
58
|
+
Utils.parse_response self.class.get("/webinars/#{params[:id]}/registrants", query: params.except(:id), headers: request_headers)
|
84
59
|
end
|
85
60
|
|
86
61
|
def webinar_registrant_add(*args)
|
87
62
|
params = Zoom::Params.new(Utils.extract_options!(args))
|
88
|
-
params.require(
|
63
|
+
params.require(%i[id email first_name last_name])
|
89
64
|
.permit(%i[occurrence_ids address city country zip state phone
|
90
65
|
industry org job_title purchasing_time_frame role_in_purchase_process
|
91
66
|
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)
|
67
|
+
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
68
|
end
|
94
69
|
|
95
70
|
def webinar_registrants_status_update(*args)
|
96
71
|
params = Zoom::Params.new(Utils.extract_options!(args))
|
97
|
-
params.require(
|
72
|
+
params.require(%i[id action])
|
98
73
|
.permit(:occurrence_id, registrants: [])
|
99
|
-
Utils.parse_response self.class.put("/webinars/#{params[:id]}/registrants/status", body: params.except(:id, :
|
74
|
+
Utils.parse_response self.class.put("/webinars/#{params[:id]}/registrants/status", body: params.except(:id, :occurrence_id).to_json, query: params.slice(:occurrence_id), headers: request_headers)
|
100
75
|
end
|
101
76
|
|
102
77
|
def past_webinar_list(*args)
|
103
|
-
|
104
|
-
|
105
|
-
|
78
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
79
|
+
params.require(:id)
|
80
|
+
Utils.parse_response self.class.get("/past_webinars/#{params[:id]}/instances", headers: request_headers)
|
81
|
+
end
|
82
|
+
|
83
|
+
def webinar_registrant_get(*args)
|
84
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
85
|
+
params.require(%i[webinar_id id]).permit(:occurrence_id)
|
86
|
+
Utils.parse_response self.class.get("/webinars/#{params[:webinar_id]}/registrants/#{params[:id]}", query: params.except(:webinar_id, :id), headers: request_headers)
|
87
|
+
end
|
88
|
+
|
89
|
+
def webinar_polls_list(*args)
|
90
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
91
|
+
params.require(:webinar_id)
|
92
|
+
Utils.parse_response self.class.get("/webinars/#{params[:webinar_id]}/polls", headers: request_headers)
|
93
|
+
end
|
94
|
+
|
95
|
+
def webinar_poll_get(*args)
|
96
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
97
|
+
params.require(%i[webinar_id poll_id])
|
98
|
+
Utils.parse_response self.class.get("/webinars/#{params[:webinar_id]}/polls/#{params[:poll_id]}", headers: request_headers)
|
99
|
+
end
|
100
|
+
|
101
|
+
def webinar_panelist_list(*args)
|
102
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
103
|
+
params.require(:webinar_id)
|
104
|
+
Utils.parse_response self.class.get("/webinars/#{params[:webinar_id]}/panelists", headers: request_headers)
|
106
105
|
end
|
107
106
|
end
|
108
107
|
end
|
data/lib/zoom/client.rb
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'httparty'
|
4
|
-
require 'json'
|
5
|
-
require 'jwt'
|
6
4
|
|
7
5
|
module Zoom
|
8
6
|
class Client
|
9
7
|
include HTTParty
|
10
8
|
include Actions::Account
|
11
|
-
include Actions::
|
9
|
+
include Actions::Billing
|
10
|
+
include Actions::Dashboard
|
11
|
+
include Actions::Groups
|
12
12
|
include Actions::M323Device
|
13
|
-
include Actions::User
|
14
13
|
include Actions::Meeting
|
15
|
-
include Actions::
|
16
|
-
include Actions::Webinar
|
17
|
-
include Actions::Report
|
14
|
+
include Actions::Phone
|
18
15
|
include Actions::Recording
|
16
|
+
include Actions::Report
|
17
|
+
include Actions::Roles
|
18
|
+
include Actions::SipAudio
|
19
|
+
include Actions::Token
|
20
|
+
include Actions::User
|
21
|
+
include Actions::Webinar
|
19
22
|
include Actions::IM::Chat
|
20
23
|
include Actions::IM::Group
|
21
24
|
|
@@ -23,14 +26,30 @@ module Zoom
|
|
23
26
|
headers 'Accept' => 'application/json'
|
24
27
|
headers 'Content-Type' => 'application/json'
|
25
28
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
def headers
|
30
|
+
{
|
31
|
+
'Accept' => 'application/json',
|
32
|
+
'Content-Type' => 'application/json',
|
33
|
+
}
|
30
34
|
end
|
31
35
|
|
32
|
-
def
|
33
|
-
|
36
|
+
def oauth_request_headers
|
37
|
+
{
|
38
|
+
'Authorization' => "Basic #{auth_token}"
|
39
|
+
}.merge(headers)
|
40
|
+
end
|
41
|
+
|
42
|
+
def request_headers
|
43
|
+
{
|
44
|
+
'Authorization' => "Bearer #{access_token}"
|
45
|
+
}.merge(headers)
|
46
|
+
end
|
47
|
+
|
48
|
+
def auth_token
|
49
|
+
Base64.encode64("#{Zoom.configuration.api_key}:#{Zoom.configuration.api_secret}").delete("\n")
|
34
50
|
end
|
35
51
|
end
|
36
52
|
end
|
53
|
+
|
54
|
+
require 'zoom/clients/jwt'
|
55
|
+
require 'zoom/clients/oauth'
|