update zoom user settings after creating zoom user
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require './lib/zoom_wrapper_monkeypatch'
|
||||
|
||||
class ZoomGateway
|
||||
class AuthenticationError < StandardError; end
|
||||
class MeetingExpired < StandardError; end
|
||||
@@ -82,6 +86,21 @@ class ZoomGateway
|
||||
type: self.class.USER_TYPE
|
||||
})
|
||||
|
||||
# Update user with custom settings
|
||||
custom_defaults = {
|
||||
id: host_user["id"],
|
||||
in_meeting: {
|
||||
auto_saving_chat: true,
|
||||
co_host: true,
|
||||
non_verbal_feedback: true,
|
||||
breakout_room: true,
|
||||
group_hd: true,
|
||||
far_end_camera_control: true,
|
||||
allow_live_streaming: true
|
||||
}
|
||||
}
|
||||
@client.user_settings_update custom_defaults
|
||||
|
||||
# Assign role to user
|
||||
@client.roles_assign role_id: host_role["id"], members: [{id: host_user["id"]}]
|
||||
|
||||
|
||||
25
lib/zoom_wrapper_monkeypatch.rb
Normal file
25
lib/zoom_wrapper_monkeypatch.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Zoom
|
||||
module Actions
|
||||
module User
|
||||
def user_settings_update(*args)
|
||||
params = Zoom::Params.new(Utils.extract_options!(args))
|
||||
permitted_in_meeting_params = %i[
|
||||
auto_saving_chat
|
||||
co_host
|
||||
non_verbal_feedback
|
||||
breakout_room
|
||||
group_hd
|
||||
far_end_camera_control
|
||||
allow_live_streaming
|
||||
]
|
||||
permitted_params = { in_meeting: permitted_in_meeting_params }
|
||||
params.require(:id).permit permitted_params
|
||||
request_body = params.except(:id).to_json
|
||||
resp = self.class.patch("/users/#{params[:id]}/settings", body: request_body, headers: request_headers)
|
||||
Utils.parse_response resp
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user