zoom_rb 0.10.0 → 1.0.2
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/CHANGELOG.md +63 -0
- data/Gemfile.lock +83 -53
- data/Makefile +1 -1
- data/README.md +21 -7
- 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 -138
- data/lib/zoom/actions/webinar.rb +43 -90
- data/lib/zoom/actions.rb +59 -0
- data/lib/zoom/client.rb +27 -7
- data/lib/zoom/clients/oauth.rb +46 -3
- 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 +23 -15
- data/lib/zoom/version.rb +2 -2
- data/lib/{zoom.rb → zoom_rb.rb} +9 -3
- 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/managed_domains.json +7 -0
- data/spec/fixtures/account/options_update.json +7 -0
- data/spec/fixtures/account/settings_get.json +1 -1
- 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/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/poll_get.json +13 -0
- data/spec/fixtures/webinar/polls_list.json +16 -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/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 +5 -5
- 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/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 +18 -46
- data/spec/lib/zoom/actions/user/email_check_spec.rb +43 -0
- data/spec/lib/zoom/actions/user/get_spec.rb +10 -1
- data/spec/lib/zoom/actions/user/list_recordings_spec.rb +57 -0
- data/spec/lib/zoom/actions/user/list_spec.rb +32 -1
- 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_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_status_spec.rb +59 -0
- data/spec/lib/zoom/actions/user/vanity_name_spec.rb +51 -0
- data/spec/lib/zoom/actions/webinar/panelist_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_spec.rb +105 -0
- data/spec/lib/zoom/client_spec.rb +48 -1
- data/spec/lib/zoom/params_spec.rb +23 -3
- data/spec/lib/zoom/utils_spec.rb +13 -8
- data/spec/spec_helper.rb +15 -2
- data/zoom_rb.gemspec +1 -1
- metadata +321 -111
- 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
data/lib/zoom/actions/webinar.rb
CHANGED
@@ -3,113 +3,66 @@
|
|
3
3
|
module Zoom
|
4
4
|
module Actions
|
5
5
|
module Webinar
|
6
|
+
extend Zoom::Actions
|
7
|
+
|
6
8
|
RECURRENCE_KEYS = %i[type repeat_interval weekly_days monthly_day monthly_week
|
7
9
|
monthly_week_day end_times end_date_time].freeze
|
8
|
-
SETTINGS_KEYS = %i[panelists_video practice_session hd_video approval_type
|
10
|
+
SETTINGS_KEYS = %i[host_video panelists_video practice_session hd_video approval_type
|
9
11
|
registration_type audio auto_recording enforce_login
|
10
12
|
enforce_login_domains alternative_hosts close_registration
|
11
|
-
show_share_button allow_multiple_devices
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
def webinar_create(*args)
|
19
|
-
params = Zoom::Params.new(Utils.extract_options!(args))
|
20
|
-
params.require(:host_id).permit(:topic, :type, :start_time, :duration,
|
21
|
-
:timezone, :password, :agenda,
|
22
|
-
recurrence: RECURRENCE_KEYS,
|
23
|
-
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, headers: request_headers)
|
27
|
-
end
|
13
|
+
show_share_button allow_multiple_devices on_demand
|
14
|
+
request_permission_to_unmute_participants global_dial_in_countries
|
15
|
+
contact_name contact_email registrants_restrict_number
|
16
|
+
post_webinar_survey survey_url registrants_email_notification
|
17
|
+
meeting_authentication authentication_option
|
18
|
+
authentication_domains registrants_confirmation_email question_answer].freeze
|
28
19
|
|
29
|
-
|
30
|
-
|
31
|
-
params.require(:id)
|
32
|
-
Utils.parse_response self.class.get("/webinars/#{params[:id]}", headers: request_headers)
|
33
|
-
end
|
20
|
+
get 'webinar_list', '/users/:host_id/webinars',
|
21
|
+
permit: %i[page_size page_number]
|
34
22
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
23
|
+
# TODO: process recurrence keys based on constants
|
24
|
+
# TODO: process settings keys based on constants
|
25
|
+
post 'webinar_create', '/users/:host_id/webinars',
|
26
|
+
permit: [
|
27
|
+
:topic, :type, :start_time, :duration, :timezone, :password, :agenda,
|
28
|
+
{ recurrence: RECURRENCE_KEYS, settings: SETTINGS_KEYS }
|
29
|
+
]
|
43
30
|
|
44
|
-
|
45
|
-
params = Zoom::Params.new(Utils.extract_options!(args))
|
46
|
-
params.require(:id).permit(:occurrence_id)
|
47
|
-
Utils.parse_response self.class.delete("/webinars/#{params[:id]}", query: params.except(:id), headers: request_headers)
|
48
|
-
end
|
31
|
+
get 'webinar_get', '/webinars/:id'
|
49
32
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
33
|
+
patch 'webinar_update', '/webinars/:id',
|
34
|
+
permit: [
|
35
|
+
:topic, :type, :start_time, :duration, :timezone, :password, :agenda,
|
36
|
+
{ recurrence: RECURRENCE_KEYS, settings: SETTINGS_KEYS }
|
37
|
+
]
|
55
38
|
|
56
|
-
|
57
|
-
|
58
|
-
# options = Utils.extract_options!(args)
|
59
|
-
raise Zoom::NotImplemented, 'webinar_panelists_list is not yet implemented'
|
60
|
-
end
|
39
|
+
delete 'webinar_delete', '/webinars/:id',
|
40
|
+
permit: :occurrence_id
|
61
41
|
|
62
|
-
|
63
|
-
|
64
|
-
# options = Utils.extract_options!(args)
|
65
|
-
raise Zoom::NotImplemented, 'webinar_panelist_add is not yet implemented'
|
66
|
-
end
|
42
|
+
get 'webinar_registrants_list', '/webinars/:id/registrants',
|
43
|
+
permit: %i[occurrence_id status page_size page_number]
|
67
44
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
45
|
+
post 'webinar_registrant_add', '/webinars/:id/registrants',
|
46
|
+
require: %i[email first_name last_name],
|
47
|
+
permit: %i[
|
48
|
+
occurrence_ids address city country zip state phone industry org job_title
|
49
|
+
purchasing_time_frame role_in_purchase_process no_of_employees comments custom_questions
|
50
|
+
]
|
73
51
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
raise Zoom::NotImplemented, 'webinar_panelist_delete is not yet implemented'
|
78
|
-
end
|
52
|
+
put 'webinar_registrants_status_update', '/webinars/:id/registrants/status',
|
53
|
+
require: :action,
|
54
|
+
permit: [ :occurrence_id, registrants: [] ]
|
79
55
|
|
80
|
-
|
81
|
-
params = Zoom::Params.new(Utils.extract_options!(args))
|
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), headers: request_headers)
|
84
|
-
end
|
56
|
+
get 'past_webinar_list', '/past_webinars/:id/instances'
|
85
57
|
|
86
|
-
|
87
|
-
|
88
|
-
params.require(:id, :email, :first_name, :last_name)
|
89
|
-
.permit(%i[occurrence_ids address city country zip state phone
|
90
|
-
industry org job_title purchasing_time_frame role_in_purchase_process
|
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), headers: request_headers)
|
93
|
-
end
|
58
|
+
get 'webinar_registrant_get', '/webinars/:webinar_id/registrants/:id',
|
59
|
+
permit: :occurrence_id
|
94
60
|
|
95
|
-
|
96
|
-
params = Zoom::Params.new(Utils.extract_options!(args))
|
97
|
-
params.require(:id, :action)
|
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), headers: request_headers)
|
100
|
-
end
|
61
|
+
get 'webinar_polls_list', '/webinars/:webinar_id/polls'
|
101
62
|
|
102
|
-
|
103
|
-
params = Zoom::Params.new(Utils.extract_options!(args))
|
104
|
-
params.require(:id)
|
105
|
-
Utils.parse_response self.class.get("/past_webinars/#{params[:id]}/instances", headers: request_headers)
|
106
|
-
end
|
63
|
+
get 'webinar_poll_get', '/webinars/:webinar_id/polls/:poll_id'
|
107
64
|
|
108
|
-
|
109
|
-
params = Zoom::Params.new(Utils.extract_options!(args))
|
110
|
-
params.require(:webinar_id, :id).permit(:occurrence_id)
|
111
|
-
Utils.parse_response self.class.get("/webinars/#{params[:webinar_id]}/registrants/#{params[:id]}", query: params.except(:webinar_id, :id), headers: request_headers)
|
112
|
-
end
|
65
|
+
get 'webinar_panelist_list', '/webinars/:webinar_id/panelists'
|
113
66
|
end
|
114
67
|
end
|
115
68
|
end
|
data/lib/zoom/actions.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Zoom
|
4
|
+
module Actions
|
5
|
+
def self.extract_path_keys(path)
|
6
|
+
path.scan(/:\w+/).map { |match| match[1..].to_sym }
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.parse_path(path, path_keys, params)
|
10
|
+
parsed_path = path.dup
|
11
|
+
path_keys.each do |key|
|
12
|
+
value = params[key].to_s
|
13
|
+
parsed_path = parsed_path.sub(":#{key}", value)
|
14
|
+
end
|
15
|
+
parsed_path
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.determine_request_options(client, oauth)
|
19
|
+
if oauth
|
20
|
+
{
|
21
|
+
headers: client.oauth_request_headers,
|
22
|
+
base_uri: 'https://zoom.us/'
|
23
|
+
}
|
24
|
+
else
|
25
|
+
{ headers: client.request_headers }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.make_request(client, method, parsed_path, params, request_options)
|
30
|
+
case method
|
31
|
+
when :get
|
32
|
+
request_options[:query] = params
|
33
|
+
when :post, :put, :patch
|
34
|
+
request_options[:body] = params.to_json
|
35
|
+
end
|
36
|
+
client.class.public_send(method, parsed_path, **request_options)
|
37
|
+
end
|
38
|
+
|
39
|
+
[:get, :post, :patch, :put, :delete].each do |method|
|
40
|
+
define_method(method) do |name, path, options={}|
|
41
|
+
required, permitted, oauth = options.values_at :require, :permit, :oauth
|
42
|
+
required = Array(required) unless required.is_a?(Hash)
|
43
|
+
permitted = Array(permitted) unless permitted.is_a?(Hash)
|
44
|
+
|
45
|
+
define_method(name) do |*args|
|
46
|
+
path_keys = Zoom::Actions.extract_path_keys(path)
|
47
|
+
params = Zoom::Params.new(Utils.extract_options!(args))
|
48
|
+
parsed_path = Zoom::Actions.parse_path(path, path_keys, params)
|
49
|
+
request_options = Zoom::Actions.determine_request_options(self, oauth)
|
50
|
+
params = params.require(path_keys) unless path_keys.empty?
|
51
|
+
params_without_required = required.empty? ? params : params.require(required)
|
52
|
+
params_without_required.permit(permitted) unless permitted.empty?
|
53
|
+
response = Zoom::Actions.make_request(self, method, parsed_path, params, request_options)
|
54
|
+
Utils.parse_response(response)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/zoom/client.rb
CHANGED
@@ -6,14 +6,19 @@ module Zoom
|
|
6
6
|
class Client
|
7
7
|
include HTTParty
|
8
8
|
include Actions::Account
|
9
|
-
include Actions::
|
9
|
+
include Actions::Billing
|
10
|
+
include Actions::Dashboard
|
11
|
+
include Actions::Groups
|
10
12
|
include Actions::M323Device
|
11
|
-
include Actions::User
|
12
13
|
include Actions::Meeting
|
13
|
-
include Actions::
|
14
|
-
include Actions::Webinar
|
15
|
-
include Actions::Report
|
14
|
+
include Actions::Phone
|
16
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
|
17
22
|
include Actions::IM::Chat
|
18
23
|
include Actions::IM::Group
|
19
24
|
|
@@ -21,13 +26,28 @@ module Zoom
|
|
21
26
|
headers 'Accept' => 'application/json'
|
22
27
|
headers 'Content-Type' => 'application/json'
|
23
28
|
|
24
|
-
def
|
29
|
+
def headers
|
25
30
|
{
|
26
31
|
'Accept' => 'application/json',
|
27
32
|
'Content-Type' => 'application/json',
|
28
|
-
'Authorization' => "Bearer #{access_token}"
|
29
33
|
}
|
30
34
|
end
|
35
|
+
|
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")
|
50
|
+
end
|
31
51
|
end
|
32
52
|
end
|
33
53
|
|
data/lib/zoom/clients/oauth.rb
CHANGED
@@ -3,14 +3,57 @@
|
|
3
3
|
module Zoom
|
4
4
|
class Client
|
5
5
|
class OAuth < Zoom::Client
|
6
|
+
attr_reader :access_token, :refresh_token, :expires_in, :expires_at
|
7
|
+
|
8
|
+
# Auth_token is sent in the header
|
9
|
+
# (auth_code, auth_token, redirect_uri) -> oauth API
|
10
|
+
# Returns (access_token, refresh_token)
|
11
|
+
#
|
12
|
+
# (auth_token, refresh_token) -> oauth refresh API
|
13
|
+
# Returns (access_token, refresh_token)
|
14
|
+
#
|
6
15
|
def initialize(config)
|
7
|
-
Zoom::Params.new(config).
|
16
|
+
Zoom::Params.new(config).permit( %i[auth_token auth_code redirect_uri access_token refresh_token timeout])
|
17
|
+
Zoom::Params.new(config).require_one_of(%i[access_token refresh_token auth_code])
|
18
|
+
if (config.keys & [:auth_code, :redirect_uri]).any?
|
19
|
+
Zoom::Params.new(config).require( %i[auth_code redirect_uri])
|
20
|
+
end
|
21
|
+
|
8
22
|
config.each { |k, v| instance_variable_set("@#{k}", v) }
|
9
23
|
self.class.default_timeout(@timeout || 20)
|
10
24
|
end
|
11
25
|
|
12
|
-
def
|
13
|
-
|
26
|
+
def auth
|
27
|
+
refresh_token ? refresh : oauth
|
28
|
+
end
|
29
|
+
|
30
|
+
def refresh
|
31
|
+
response = refresh_tokens(refresh_token: @refresh_token)
|
32
|
+
set_tokens(response)
|
33
|
+
response
|
34
|
+
end
|
35
|
+
|
36
|
+
def oauth
|
37
|
+
response = access_tokens(auth_code: @auth_code, redirect_uri: @redirect_uri)
|
38
|
+
set_tokens(response)
|
39
|
+
response
|
40
|
+
end
|
41
|
+
|
42
|
+
def revoke
|
43
|
+
response = revoke_tokens(access_token: @access_token)
|
44
|
+
set_tokens(response)
|
45
|
+
response
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def set_tokens(response)
|
51
|
+
if response.is_a?(Hash) && !response.key?(:error)
|
52
|
+
@access_token = response["access_token"]
|
53
|
+
@refresh_token = response["refresh_token"]
|
54
|
+
@expires_in = response["expires_in"]
|
55
|
+
@expires_at = @expires_in ? (Time.now + @expires_in).to_i : nil
|
56
|
+
end
|
14
57
|
end
|
15
58
|
end
|
16
59
|
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
module Zoom
|
2
|
+
module Constants
|
3
|
+
module Account
|
4
|
+
module Settings
|
5
|
+
PERMITTED_OPTIONS = %i[meeting_authentication recording_authentication]
|
6
|
+
|
7
|
+
PERMITTED_KEYS = {
|
8
|
+
schedule_meeting: %i[
|
9
|
+
host_video
|
10
|
+
participant_video
|
11
|
+
audio_type
|
12
|
+
join_before_host
|
13
|
+
enforce_login
|
14
|
+
enforce_login_with_domains
|
15
|
+
enforce_login_domains
|
16
|
+
not_store_meeting_topic
|
17
|
+
force_pmi_jbh_password
|
18
|
+
require_password_for_scheduling_new_meetings
|
19
|
+
require_password_for_scheduled_meetings
|
20
|
+
require_password_for_instant_meetings
|
21
|
+
require_password_for_pmi_meetings
|
22
|
+
use_pmi_for_scheduled_meetings
|
23
|
+
use_pmi_for_instant_meetings
|
24
|
+
],
|
25
|
+
in_meeting: %i[
|
26
|
+
e2e_encryption
|
27
|
+
chat
|
28
|
+
private_chat
|
29
|
+
auto_saving_chat
|
30
|
+
feedback
|
31
|
+
post_meeting_feedback
|
32
|
+
co_host
|
33
|
+
polling
|
34
|
+
attendee_on_hold
|
35
|
+
show_meeting_control_toolbar
|
36
|
+
allow_show_zoom_windows
|
37
|
+
annotation
|
38
|
+
whiteboard
|
39
|
+
webinar_question_answer
|
40
|
+
anonymous_question_answer
|
41
|
+
breakout_room
|
42
|
+
closed_caption
|
43
|
+
far_end_camera_control
|
44
|
+
group_hd
|
45
|
+
virtual_background
|
46
|
+
watermark
|
47
|
+
alert_guest_join
|
48
|
+
auto_answer
|
49
|
+
p2p_connetion
|
50
|
+
p2p_ports
|
51
|
+
ports_range
|
52
|
+
sending_default_email_invites
|
53
|
+
use_html_format_email
|
54
|
+
dscp_marking
|
55
|
+
dscp_audio
|
56
|
+
dscp_video
|
57
|
+
stereo_audio
|
58
|
+
original_audio
|
59
|
+
screen_sharing
|
60
|
+
remote_control
|
61
|
+
],
|
62
|
+
email_notification: %i[
|
63
|
+
cloud_recording_avaliable_reminder
|
64
|
+
jbh_reminder
|
65
|
+
cancel_meeting_reminder
|
66
|
+
low_host_count_reminder
|
67
|
+
alternative_host_reminder
|
68
|
+
],
|
69
|
+
zoom_rooms: %i[
|
70
|
+
upcoming_meeting_alert
|
71
|
+
start_airplay_manually
|
72
|
+
weekly_system_restart
|
73
|
+
list_meetings_with_calendar
|
74
|
+
zr_post_meeting_feedback
|
75
|
+
ultrasonic
|
76
|
+
force_private_meeting
|
77
|
+
hide_host_information
|
78
|
+
cmr_for_instant_meeting
|
79
|
+
auto_start_stop_scheduled_meetings
|
80
|
+
],
|
81
|
+
security: %i[
|
82
|
+
admin_change_name_pic
|
83
|
+
import_photos_from_devices
|
84
|
+
hide_billing_info
|
85
|
+
],
|
86
|
+
recording: %i[
|
87
|
+
local_recording
|
88
|
+
cloud_recording
|
89
|
+
record_speaker_view
|
90
|
+
record_gallery_view
|
91
|
+
record_audio_file
|
92
|
+
save_chat_text
|
93
|
+
show_timestamp
|
94
|
+
recording_audio_transcript
|
95
|
+
auto_recording
|
96
|
+
cloud_recording_download
|
97
|
+
cloud_recording_download_host
|
98
|
+
account_user_access_recording
|
99
|
+
auto_delete_cmr
|
100
|
+
auto_delete_cmr_days
|
101
|
+
],
|
102
|
+
telephony: %i[
|
103
|
+
third_party_audio
|
104
|
+
audio_conference_info
|
105
|
+
],
|
106
|
+
tsp: [
|
107
|
+
:call_out,
|
108
|
+
:show_international_numbers_link,
|
109
|
+
:display_toll_free_numbers,
|
110
|
+
{ call_out_countries: [] }
|
111
|
+
],
|
112
|
+
integration: %i[
|
113
|
+
google_calendar
|
114
|
+
google_drive
|
115
|
+
dropbox
|
116
|
+
box
|
117
|
+
microsoft_one_drive
|
118
|
+
kubi
|
119
|
+
],
|
120
|
+
feature: :meeting_capacity
|
121
|
+
}.freeze
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'account/options/pay_modes'
|
4
|
+
require_relative 'account/settings/permitted_settings'
|
5
|
+
require_relative 'meeting/approval_types'
|
6
|
+
require_relative 'meeting/audio_type'
|
7
|
+
require_relative 'meeting/auto_recording'
|
8
|
+
require_relative 'meeting/registration_types'
|
9
|
+
require_relative 'meeting/types'
|
10
|
+
require_relative 'recurrence/monthly_weeks'
|
11
|
+
require_relative 'recurrence/types'
|
12
|
+
require_relative 'recurrence/weekly_days'
|
13
|
+
require_relative 'user/create_types'
|
14
|
+
require_relative 'user/types'
|
15
|
+
require_relative 'webinar/approval_types'
|
16
|
+
require_relative 'webinar/audio_type'
|
17
|
+
require_relative 'webinar/auto_recording'
|
18
|
+
require_relative 'webinar/registration_types'
|
19
|
+
require_relative 'webinar/types'
|
20
|
+
|
21
|
+
module Zoom
|
22
|
+
module Constants
|
23
|
+
IM_GROUP_TYPES = {
|
24
|
+
'normal' => 'Only members can see the group automatically. Other people can search members in the group.', # default
|
25
|
+
'shared' => 'All people in the account can see the group and members automatically',
|
26
|
+
'restricted' => 'Nobody can see the group or search members except the members in the group'
|
27
|
+
}.freeze
|
28
|
+
|
29
|
+
REGISTRANT_STATUS_ACTIONS = {
|
30
|
+
'Approve registrant' => 'approve',
|
31
|
+
'Cancel registrant' => 'cancel',
|
32
|
+
'Deny registrant' => 'deny'
|
33
|
+
}.freeze # no default
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Zoom
|
2
|
+
module Constants
|
3
|
+
module Meeting
|
4
|
+
REGISTRATION_TYPES = {
|
5
|
+
'Attendees register once and can attend any of the occurrences' => 1, # default
|
6
|
+
'Attendees need to register for each occurrence to attend' => 2,
|
7
|
+
'Attendees register once and can choose one or more occurrences to attend' => 3
|
8
|
+
}.freeze
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Zoom
|
2
|
+
module Constants
|
3
|
+
module User
|
4
|
+
CREATE_TYPES = {
|
5
|
+
'create' => 'User will get an email sent from Zoom. There is a confirmation link in this email. User will then need to click this link to activate their account to the Zoom service. The user can set or change their password in Zoom.',
|
6
|
+
'autoCreate' => 'This action is provided for enterprise customer who has a managed domain. This feature is disabled by default because of the security risk involved in creating a user who does not belong to your domain without notifying the user.',
|
7
|
+
'custCreate' => 'This action is provided for API partner only. User created in this way has no password and is not able to log into the Zoom web site or client.',
|
8
|
+
'ssoCreate' => 'This action is provided for enabled “Pre-provisioning SSO User” option. User created in this way has no password. If it is not a basic user, will generate a Personal Vanity URL using user name (no domain) of the provisioning email. If user name or pmi is invalid or occupied, will use random number/random personal vanity URL.'
|
9
|
+
}.freeze # no default
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|