lib/zoom/actions/user.rb in zoom_rb-0.8.2 vs lib/zoom/actions/user.rb in zoom_rb-0.8.3
- old
+ new
@@ -10,11 +10,14 @@
Utils.parse_response(response)
end
def user_create(*args)
params = Zoom::Params.new(Utils.extract_options!(args))
- params.require(%i[email type first_name last_name password])
- Utils.parse_response self.class.post('/users', body: { action: 'create', user_info: params }.to_json, query: { access_token: access_token })
+ require_param_keys = %i[action email type]
+ require_param_keys.append(:password) if params[:action] == 'autoCreate'
+ params.require(require_param_keys)
+ params.permit_value(:action, Zoom::Constants::USER_CREATE_TYPES.keys)
+ Utils.parse_response self.class.post('/users', body: { action: params[:action], user_info: params.except(:action) }.to_json, query: { access_token: access_token })
end
def user_get(*args)
params = Zoom::Params.new(Utils.extract_options!(args))
params.require(:id).permit(:login_type)