zoom_markazuna 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +66 -0
  3. data/.gitignore +20 -0
  4. data/Gemfile +5 -0
  5. data/Gemfile.lock +95 -0
  6. data/LICENSE +22 -0
  7. data/Makefile +5 -0
  8. data/README.md +65 -0
  9. data/lib/zoom.rb +51 -0
  10. data/lib/zoom/actions/account.rb +93 -0
  11. data/lib/zoom/actions/group.rb +8 -0
  12. data/lib/zoom/actions/im/chat.rb +27 -0
  13. data/lib/zoom/actions/im/group.rb +10 -0
  14. data/lib/zoom/actions/m323_device.rb +8 -0
  15. data/lib/zoom/actions/meeting.rb +89 -0
  16. data/lib/zoom/actions/metrics.rb +27 -0
  17. data/lib/zoom/actions/recording.rb +33 -0
  18. data/lib/zoom/actions/report.rb +55 -0
  19. data/lib/zoom/actions/user.rb +146 -0
  20. data/lib/zoom/actions/webinar.rb +115 -0
  21. data/lib/zoom/client.rb +35 -0
  22. data/lib/zoom/clients/jwt.rb +22 -0
  23. data/lib/zoom/clients/oauth.rb +17 -0
  24. data/lib/zoom/constants.rb +103 -0
  25. data/lib/zoom/error.rb +10 -0
  26. data/lib/zoom/interface.rb +6 -0
  27. data/lib/zoom/params.rb +71 -0
  28. data/lib/zoom/utils.rb +49 -0
  29. data/lib/zoom/version.rb +5 -0
  30. data/spec/fixtures/account/list.json +18 -0
  31. data/spec/fixtures/account/settings_get.json +120 -0
  32. data/spec/fixtures/chat/get.json +16 -0
  33. data/spec/fixtures/chat/list.json +16 -0
  34. data/spec/fixtures/error/already_exists.json +4 -0
  35. data/spec/fixtures/error/not_found.json +4 -0
  36. data/spec/fixtures/error/user_not_exist.json +4 -0
  37. data/spec/fixtures/error/validation.json +10 -0
  38. data/spec/fixtures/mc_recording_list.json +51 -0
  39. data/spec/fixtures/meeting/create.json +29 -0
  40. data/spec/fixtures/meeting/delete.json +4 -0
  41. data/spec/fixtures/meeting/end.json +4 -0
  42. data/spec/fixtures/meeting/get.json +34 -0
  43. data/spec/fixtures/meeting/list.json +32 -0
  44. data/spec/fixtures/meeting/live.json +32 -0
  45. data/spec/fixtures/meeting/register.json +7 -0
  46. data/spec/fixtures/meeting/update.json +4 -0
  47. data/spec/fixtures/metrics_crc.json +105 -0
  48. data/spec/fixtures/metrics_meetingdetail.json +32 -0
  49. data/spec/fixtures/metrics_meetings.json +26 -0
  50. data/spec/fixtures/recording_delete.json +4 -0
  51. data/spec/fixtures/recording_get.json +37 -0
  52. data/spec/fixtures/recording_list.json +51 -0
  53. data/spec/fixtures/report/webinar/participants.json +18 -0
  54. data/spec/fixtures/report_getaccountreport.json +23 -0
  55. data/spec/fixtures/report_getdailyreport.json +83 -0
  56. data/spec/fixtures/report_getuserreport.json +24 -0
  57. data/spec/fixtures/user/assistant/delete.json +5 -0
  58. data/spec/fixtures/user/assistant/set.json +5 -0
  59. data/spec/fixtures/user/autocreate.json +51 -0
  60. data/spec/fixtures/user/autocreate2.json +51 -0
  61. data/spec/fixtures/user/create.json +7 -0
  62. data/spec/fixtures/user/custcreate.json +10 -0
  63. data/spec/fixtures/user/delete.json +0 -0
  64. data/spec/fixtures/user/get.json +23 -0
  65. data/spec/fixtures/user/getbyemail.json +8 -0
  66. data/spec/fixtures/user/list.json +23 -0
  67. data/spec/fixtures/user/pending.json +56 -0
  68. data/spec/fixtures/user/permanent_delete.json +4 -0
  69. data/spec/fixtures/user/settings_get.json +74 -0
  70. data/spec/fixtures/user/update.json +0 -0
  71. data/spec/fixtures/webinar/create.json +29 -0
  72. data/spec/fixtures/webinar/delete.json +0 -0
  73. data/spec/fixtures/webinar/list.json +20 -0
  74. data/spec/fixtures/webinar/past_webinar_list.json +8 -0
  75. data/spec/fixtures/webinar/registrant/add.json +7 -0
  76. data/spec/fixtures/webinar/registrant/get.json +25 -0
  77. data/spec/fixtures/webinar/registrant/list.json +36 -0
  78. data/spec/fixtures/webinar/update.json +0 -0
  79. data/spec/fixtures/webinar_delete.json +4 -0
  80. data/spec/fixtures/webinar_end.json +4 -0
  81. data/spec/fixtures/webinar_get.json +17 -0
  82. data/spec/fixtures/webinar_update.json +4 -0
  83. data/spec/lib/zoom/actions/account/list_spec.rb +58 -0
  84. data/spec/lib/zoom/actions/account/settings_get_spec.rb +50 -0
  85. data/spec/lib/zoom/actions/group/create_spec.rb +3 -0
  86. data/spec/lib/zoom/actions/group/delete_spec.rb +3 -0
  87. data/spec/lib/zoom/actions/group/edit_spec.rb +3 -0
  88. data/spec/lib/zoom/actions/group/get_spec.rb +3 -0
  89. data/spec/lib/zoom/actions/group/list_spec.rb +3 -0
  90. data/spec/lib/zoom/actions/group/member/add_spec.rb +3 -0
  91. data/spec/lib/zoom/actions/group/member/delete_spec.rb +3 -0
  92. data/spec/lib/zoom/actions/group/member/list_spec.rb +3 -0
  93. data/spec/lib/zoom/actions/im/chat/get_spec.rb +64 -0
  94. data/spec/lib/zoom/actions/im/chat/list_spec.rb +58 -0
  95. data/spec/lib/zoom/actions/im/group/create_spec.rb +3 -0
  96. data/spec/lib/zoom/actions/im/group/delete_spec.rb +3 -0
  97. data/spec/lib/zoom/actions/im/group/edit_spec.rb +3 -0
  98. data/spec/lib/zoom/actions/im/group/get_spec.rb +3 -0
  99. data/spec/lib/zoom/actions/im/group/list_spec.rb +3 -0
  100. data/spec/lib/zoom/actions/im/group/member/add_spec.rb +3 -0
  101. data/spec/lib/zoom/actions/im/group/member/delete_spec.rb +3 -0
  102. data/spec/lib/zoom/actions/im/group/member/list_spec.rb +3 -0
  103. data/spec/lib/zoom/actions/m323/device/create_spec.rb +3 -0
  104. data/spec/lib/zoom/actions/m323/device/delete_spec.rb +3 -0
  105. data/spec/lib/zoom/actions/m323/device/list_spec.rb +3 -0
  106. data/spec/lib/zoom/actions/m323/device/update_spec.rb +3 -0
  107. data/spec/lib/zoom/actions/ma/account/billing_update_spec.rb +3 -0
  108. data/spec/lib/zoom/actions/ma/account/create_spec.rb +3 -0
  109. data/spec/lib/zoom/actions/ma/account/delete_spec.rb +3 -0
  110. data/spec/lib/zoom/actions/ma/account/get_spec.rb +3 -0
  111. data/spec/lib/zoom/actions/ma/account/list_spec.rb +3 -0
  112. data/spec/lib/zoom/actions/ma/account/plan/add_spec.rb +0 -0
  113. data/spec/lib/zoom/actions/ma/account/plan/get_spec.rb +0 -0
  114. data/spec/lib/zoom/actions/ma/account/plan/subscribe_spec.rb +3 -0
  115. data/spec/lib/zoom/actions/ma/account/plan/update_spec.rb +3 -0
  116. data/spec/lib/zoom/actions/meeting/create_spec.rb +63 -0
  117. data/spec/lib/zoom/actions/meeting/delete_spec.rb +55 -0
  118. data/spec/lib/zoom/actions/meeting/end_spec.rb +55 -0
  119. data/spec/lib/zoom/actions/meeting/get_spec.rb +59 -0
  120. data/spec/lib/zoom/actions/meeting/list_spec.rb +48 -0
  121. data/spec/lib/zoom/actions/meeting/live_spec.rb +43 -0
  122. data/spec/lib/zoom/actions/meeting/register_spec.rb +45 -0
  123. data/spec/lib/zoom/actions/meeting/update_spec.rb +53 -0
  124. data/spec/lib/zoom/actions/metrics/crc_spec.rb +48 -0
  125. data/spec/lib/zoom/actions/metrics/im_spec.rb +3 -0
  126. data/spec/lib/zoom/actions/metrics/meetingdetail_spec.rb +51 -0
  127. data/spec/lib/zoom/actions/metrics/meetings_spec.rb +61 -0
  128. data/spec/lib/zoom/actions/metrics/qos_spec.rb +3 -0
  129. data/spec/lib/zoom/actions/metrics/webinardetail_spec.rb +3 -0
  130. data/spec/lib/zoom/actions/metrics/webinars_spec.rb +3 -0
  131. data/spec/lib/zoom/actions/metrics/zoomroomdetail_spec.rb +3 -0
  132. data/spec/lib/zoom/actions/metrics/zoomrooms_spec.rb +3 -0
  133. data/spec/lib/zoom/actions/recording/delete_spec.rb +52 -0
  134. data/spec/lib/zoom/actions/recording/get_spec.rb +66 -0
  135. data/spec/lib/zoom/actions/recording/list_spec.rb +51 -0
  136. data/spec/lib/zoom/actions/recording/mc_list_spec.rb +51 -0
  137. data/spec/lib/zoom/actions/report/daily_report_spec.rb +0 -0
  138. data/spec/lib/zoom/actions/report/hosts_report_spec.rb +0 -0
  139. data/spec/lib/zoom/actions/report/meeting_details_report_spec.rb +0 -0
  140. data/spec/lib/zoom/actions/report/meeting_participants_report_spec.rb +0 -0
  141. data/spec/lib/zoom/actions/report/meeting_polls_report_spec.rb +0 -0
  142. data/spec/lib/zoom/actions/report/meetings_report_spec.rb +0 -0
  143. data/spec/lib/zoom/actions/report/telephone_report_spec.rb +0 -0
  144. data/spec/lib/zoom/actions/report/webinar_details_report_spec.rb +0 -0
  145. data/spec/lib/zoom/actions/report/webinar_participants_report_spec.rb +44 -0
  146. data/spec/lib/zoom/actions/report/webinar_polls_report_spec.rb +0 -0
  147. data/spec/lib/zoom/actions/report/webinar_qa_report_spec.rb +0 -0
  148. data/spec/lib/zoom/actions/user/activate_spec.rb +3 -0
  149. data/spec/lib/zoom/actions/user/assistant/delete_spec.rb +3 -0
  150. data/spec/lib/zoom/actions/user/assistant/set_spec.rb +3 -0
  151. data/spec/lib/zoom/actions/user/autocreate2_spec.rb +59 -0
  152. data/spec/lib/zoom/actions/user/autocreate_spec.rb +58 -0
  153. data/spec/lib/zoom/actions/user/checkemail_spec.rb +3 -0
  154. data/spec/lib/zoom/actions/user/checkzpk_spec.rb +3 -0
  155. data/spec/lib/zoom/actions/user/create_spec.rb +102 -0
  156. data/spec/lib/zoom/actions/user/custcreate_spec.rb +59 -0
  157. data/spec/lib/zoom/actions/user/deactivate_spec.rb +3 -0
  158. data/spec/lib/zoom/actions/user/delete_spec.rb +44 -0
  159. data/spec/lib/zoom/actions/user/get_spec.rb +54 -0
  160. data/spec/lib/zoom/actions/user/getbyemail_spec.rb +54 -0
  161. data/spec/lib/zoom/actions/user/list_spec.rb +50 -0
  162. data/spec/lib/zoom/actions/user/revoketoken_spec.rb +3 -0
  163. data/spec/lib/zoom/actions/user/settings_get_spec.rb +56 -0
  164. data/spec/lib/zoom/actions/user/update_spec.rb +45 -0
  165. data/spec/lib/zoom/actions/user/updatepassword_spec.rb +3 -0
  166. data/spec/lib/zoom/actions/webinar/attendees_list_spec.rb +3 -0
  167. data/spec/lib/zoom/actions/webinar/create_spec.rb +59 -0
  168. data/spec/lib/zoom/actions/webinar/delete_spec.rb +44 -0
  169. data/spec/lib/zoom/actions/webinar/end_spec.rb +3 -0
  170. data/spec/lib/zoom/actions/webinar/get_spec.rb +66 -0
  171. data/spec/lib/zoom/actions/webinar/list_registration_spec.rb +3 -0
  172. data/spec/lib/zoom/actions/webinar/list_spec.rb +50 -0
  173. data/spec/lib/zoom/actions/webinar/panelists_spec.rb +3 -0
  174. data/spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb +44 -0
  175. data/spec/lib/zoom/actions/webinar/polls_spec.rb +3 -0
  176. data/spec/lib/zoom/actions/webinar/questions_spec.rb +3 -0
  177. data/spec/lib/zoom/actions/webinar/register_spec.rb +3 -0
  178. data/spec/lib/zoom/actions/webinar/registrants/add_spec.rb +64 -0
  179. data/spec/lib/zoom/actions/webinar/registrants/get_spec.rb +49 -0
  180. data/spec/lib/zoom/actions/webinar/registrants/list_spec.rb +43 -0
  181. data/spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb +42 -0
  182. data/spec/lib/zoom/actions/webinar/registration_cancel_spec.rb +3 -0
  183. data/spec/lib/zoom/actions/webinar/registration_spec.rb +3 -0
  184. data/spec/lib/zoom/actions/webinar/update_spec.rb +44 -0
  185. data/spec/lib/zoom/actions/webinar/uuid_list_spec.rb +3 -0
  186. data/spec/lib/zoom/client_spec.rb +76 -0
  187. data/spec/lib/zoom/params_spec.rb +81 -0
  188. data/spec/lib/zoom/utils_spec.rb +48 -0
  189. data/spec/spec_helper.rb +43 -0
  190. data/zoom_rb.gemspec +33 -0
  191. metadata +518 -0
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+
5
+ module Zoom
6
+ class Client
7
+ include HTTParty
8
+ include Actions::Account
9
+ include Actions::Group
10
+ include Actions::M323Device
11
+ include Actions::User
12
+ include Actions::Meeting
13
+ include Actions::Metrics
14
+ include Actions::Webinar
15
+ include Actions::Report
16
+ include Actions::Recording
17
+ include Actions::IM::Chat
18
+ include Actions::IM::Group
19
+
20
+ base_uri 'https://api.zoom.us/v2'
21
+ headers 'Accept' => 'application/json'
22
+ headers 'Content-Type' => 'application/json'
23
+
24
+ def request_headers
25
+ {
26
+ 'Accept' => 'application/json',
27
+ 'Content-Type' => 'application/json',
28
+ 'Authorization' => "Bearer #{access_token}"
29
+ }
30
+ end
31
+ end
32
+ end
33
+
34
+ require 'zoom/clients/jwt'
35
+ require 'zoom/clients/oauth'
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+ require 'jwt'
3
+
4
+ module Zoom
5
+ class Client
6
+ class JWT < Zoom::Client
7
+
8
+ def initialize(config)
9
+ Zoom::Params.new(config).require(:api_key, :api_secret)
10
+ config.each { |k, v| instance_variable_set("@#{k}", v) }
11
+ self.class.default_timeout(@timeout || 20)
12
+ end
13
+
14
+ def access_token
15
+ ::JWT.encode({ iss: @api_key, exp: Time.now.to_i + @timeout }, @api_secret, 'HS256', { typ: 'JWT' })
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+
22
+
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ class Client
5
+ class OAuth < Zoom::Client
6
+ def initialize(config)
7
+ Zoom::Params.new(config).require(:access_token)
8
+ config.each { |k, v| instance_variable_set("@#{k}", v) }
9
+ self.class.default_timeout(@timeout || 20)
10
+ end
11
+
12
+ def access_token
13
+ @access_token
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ class Constants
5
+ ACCOUNT_OPTIONS_PAY_MODES = { 'Master account holder pays' => 'master', # default
6
+ 'Sub account holder pays' => 'sub'
7
+ }.freeze
8
+
9
+ IM_GROUP_TYPES = { 'Only members can see the group automatically. Other people can search members in the group.' => 'normal', # default
10
+ 'All people in the account can see the group and members automatically' => 'shared',
11
+ 'Nobody can see the group or search members except the members in the group' => 'restricted'
12
+ }.freeze
13
+
14
+ RECURRENCE_TYPES = { 'Daily' => 1,
15
+ 'Weekly' => 2,
16
+ 'Monthly' => 3
17
+ }.freeze # no default
18
+
19
+ RECURRENCE_WEEKLY_DAYS = { 'Sunday' => 1,
20
+ 'Monday' => 2,
21
+ 'Tuesday' => 3,
22
+ 'Wednesday' => 4,
23
+ 'Thursday' => 5,
24
+ 'Friday' => 6,
25
+ 'Saturday' => 7
26
+ }.freeze # no default
27
+
28
+ RECURRENCE_MONTHLY_WEEKS = { 'Last week' => -1,
29
+ 'First week' => 1,
30
+ 'Second week' => 2,
31
+ 'Third week' => 3,
32
+ 'Fourth week' => 4
33
+ }.freeze # no default
34
+
35
+ MEETING_TYPES = { 'Instant Meeting' => 1,
36
+ 'Scheduled Meeting' => 2, # default
37
+ 'Recurring Meeting with no fixed time' => 3,
38
+ 'Recurring Meeting with fixed time' => 8
39
+ }.freeze
40
+
41
+ MEETING_APPROVAL_TYPES = { 'Automatically Approve' => 0,
42
+ 'Manually Approve' => 1,
43
+ 'No Registration Required' => 2 # default
44
+ }.freeze
45
+
46
+ MEETING_REGISTRATION_TYPES = { 'Attendees register once and can attend any of the occurrences' => 1, # default
47
+ 'Attendees need to register for each occurrence to attend' => 2,
48
+ 'Attendees register once and can choose one or more occurrences to attend' => 3
49
+ }.freeze
50
+
51
+ MEETING_AUDIO_TYPE = { 'Both Telephony and VoIP' => 'both', # default
52
+ 'Telephony only' => 'telephony',
53
+ 'VoIP only' => 'voip'
54
+ }.freeze
55
+
56
+ MEETING_AUTO_RECORDING = { 'Record to local device' => 'local',
57
+ 'Record to cloud' => 'cloud',
58
+ 'No Recording' => 'none' # default
59
+ }.freeze
60
+
61
+ REGISTRANT_STATUS_ACTIONS = { 'Approve registrant' => 'approve',
62
+ 'Cancel registrant' => 'cancel',
63
+ 'Deny registrant' => 'deny'
64
+ }.freeze # no default
65
+
66
+ WEBINAR_TYPES = { 'Webinar' => 5, # default
67
+ 'Recurring Webinar with no fixed time' => 6,
68
+ 'Recurring Webinar with fixed time' => 9
69
+ }.freeze
70
+
71
+ WEBINAR_APPROVAL_TYPES = { 'Automatically Approve' => 0,
72
+ 'Manually Approve' => 1,
73
+ 'No Registration Required' => 2 # default
74
+ }.freeze
75
+
76
+ WEBINAR_REGISTRATION_TYPES = { 'Attendees register once and can attend any of the occurrences' => 1, # default
77
+ 'Attendees need to register for each occurrence to attend' => 2,
78
+ 'Attendees register once and can choose one or more occurrences to attend' => 3
79
+ }.freeze
80
+
81
+ WEBINAR_AUDIO_TYPE = { 'Both Telephony and VoIP' => 'both', # default
82
+ 'Telephony only' => 'telephony',
83
+ 'VoIP only' => 'voip'
84
+ }.freeze
85
+
86
+ WEBINAR_AUTO_RECORDING = { 'Record to local device' => 'local',
87
+ 'Record to cloud' => 'cloud',
88
+ 'No Recording' => 'none' # default
89
+ }.freeze
90
+
91
+ USER_TYPES = { 'basic' => 1,
92
+ 'pro' => 2,
93
+ 'corp' => 3
94
+ }.freeze # no default
95
+
96
+ USER_CREATE_TYPES = {
97
+ '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.',
98
+ '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.',
99
+ '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.',
100
+ '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.'
101
+ }.freeze # no default
102
+ end
103
+ end
data/lib/zoom/error.rb ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ class Error < StandardError; end
5
+ class GatewayTimeout < StandardError; end
6
+ class NotImplemented < StandardError; end
7
+ class ParameterMissing < StandardError; end
8
+ class ParameterNotPermitted < StandardError; end
9
+ class ParameterValueNotPermitted < StandardError; end
10
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Interface
5
+ end
6
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ class Params < SimpleDelegator
5
+ # delegate :keys, :key?, :has_key?, :values, :has_value?, :value?, :empty?,
6
+ # :include?, :as_json, :to_s, :each_key, to: :@parameters
7
+
8
+ def initialize(parameters = {})
9
+ @parameters = parameters
10
+ super
11
+ end
12
+
13
+
14
+ def require(*keys)
15
+ missing_keys = find_missing_keys(keys.flatten)
16
+ return self.class.new(except(keys)) if missing_keys.empty?
17
+ raise Zoom::ParameterMissing, missing_keys.to_s
18
+ end
19
+
20
+ def permit(*filters)
21
+ permitted_keys = filters.flatten.each_with_object([]) do |filter, array|
22
+ case filter
23
+ when Symbol, String
24
+ array << filter
25
+ when Hash
26
+ array << hash_filter(filter)
27
+ end
28
+ end
29
+ non_permitted_params = @parameters.keys - permitted_keys.flatten
30
+ raise Zoom::ParameterNotPermitted, non_permitted_params.to_s unless non_permitted_params.empty?
31
+ end
32
+
33
+ def except(*keys)
34
+ dup.except!(keys.flatten)
35
+ end
36
+
37
+ def except!(keys)
38
+ keys.each { |key| delete(key) }
39
+ self
40
+ end
41
+
42
+ EMPTY_ARRAY = [].freeze
43
+ EMPTY_HASH = {}.freeze
44
+
45
+ def hash_filter(filter)
46
+ # Slicing filters out non-declared keys.
47
+ slice(*filter.keys).each do |key, value|
48
+ next unless value
49
+ next unless key? key
50
+ next if filter[key] == EMPTY_ARRAY
51
+ next if filter[key] == EMPTY_HASH
52
+ # Declaration { user: :name } or { user: [:name, :age, { address: ... }] }.
53
+ self.class.new(value).permit(filter[key])
54
+ end
55
+ filter.keys
56
+ end
57
+
58
+ def find_missing_keys(keys)
59
+ keys.each_with_object([]) do |k, array|
60
+ array << k if self[k].nil?
61
+ end
62
+ end
63
+
64
+ def permit_value(key, values)
65
+ value = @parameters[key]
66
+ if !values.include?(value)
67
+ raise Zoom::ParameterValueNotPermitted, "#{key}: #{value}"
68
+ end
69
+ end
70
+ end
71
+ end
data/lib/zoom/utils.rb ADDED
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ class Utils
5
+ class << self
6
+ def argument_error(name)
7
+ name ? ArgumentError.new("You must provide #{name}") : ArgumentError.new
8
+ end
9
+
10
+ def exclude_argument_error(name)
11
+ name ? ArgumentError.new("Unrecognized parameter #{name}") : ArgumentError.new
12
+ end
13
+
14
+ def raise_if_error!(response)
15
+ if response&.[]('code') && response['code'] >= 300
16
+ error_hash = { base: response['message']}
17
+ raise Error, error_hash unless response['errors']
18
+ error_hash[response['message']] = response['errors']
19
+ raise Error, error_hash
20
+ else
21
+ response
22
+ end
23
+ end
24
+
25
+ def parse_response(http_response)
26
+ raise_if_error!(http_response.parsed_response) || http_response.code
27
+ end
28
+
29
+ def extract_options!(array)
30
+ array.last.is_a?(::Hash) ? array.pop : {}
31
+ end
32
+
33
+ def validate_password(password)
34
+ password_regex = /\A[a-zA-Z0-9@-_*]{0,10}\z/
35
+ raise(Error , 'Invalid Password') unless password[password_regex].nil?
36
+ end
37
+
38
+ def process_datetime_params!(params, options)
39
+ params = [params] unless params.is_a? Array
40
+ params.each do |param|
41
+ if options[param] && options[param].kind_of?(Time)
42
+ options[param] = options[param].strftime('%FT%TZ')
43
+ end
44
+ end
45
+ options
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ VERSION = '0.10.0'
5
+ end
@@ -0,0 +1,18 @@
1
+ {
2
+ "page_count": 1,
3
+ "page_number": 1,
4
+ "page_size": 10,
5
+ "total_records": 1,
6
+ "accounts": [
7
+ {
8
+ "id": "string [uuid]",
9
+ "account_name": "string",
10
+ "owner_email": "string",
11
+ "account_type": "string",
12
+ "seats": "integer",
13
+ "subscription_start_time": "string [date-time]",
14
+ "subscription_end_time": "string [date-time]",
15
+ "created_at": "string [date-time]"
16
+ }
17
+ ]
18
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "schedule_meting": {
3
+ "host_video": false,
4
+ "participant_video": false,
5
+ "audio_type": "both",
6
+ "join_before_host": false,
7
+ "use_pmi_for_scheduled_meetings": false,
8
+ "use_pmi_for_instant_meetings": false,
9
+ "enforce_login": false,
10
+ "enforce_login_with_domains": false,
11
+ "enforce_login_domains": "example.com",
12
+ "not_store_meeting_topic": false,
13
+ "force_pmi_jbh_password": false
14
+ },
15
+ "in_meeting": {
16
+ "e2e_encryption": false,
17
+ "chat": false,
18
+ "private_chat": false,
19
+ "auto_saving_chat": false,
20
+ "entry_exit_chime": "host",
21
+ "record_play_own_voice": false,
22
+ "file_transfer": false,
23
+ "feedback": false,
24
+ "post_meeting_feedback": false,
25
+ "co_host": false,
26
+ "polling": false,
27
+ "attendee_on_hold": false,
28
+ "show_meeting_control_toolbar": false,
29
+ "allow_show_zoom_windows": false,
30
+ "annotation": false,
31
+ "whiteboard": false,
32
+ "webinar_question_answer": false,
33
+ "anonymous_question_answer": false,
34
+ "breakout_room": false,
35
+ "closed_caption": false,
36
+ "far_end_camera_control": false,
37
+ "group_hd": false,
38
+ "virtual_background": false,
39
+ "watermark": false,
40
+ "alert_guest_join": false,
41
+ "auto_answer": false,
42
+ "p2p_connetion": false,
43
+ "p2p_ports": false,
44
+ "ports_range": "55,56",
45
+ "sending_default_email_invites": false,
46
+ "use_html_format_email": false,
47
+ "dscp_marking": false,
48
+ "dscp_audio": 42,
49
+ "dscp_video": 43,
50
+ "stereo_audio": false,
51
+ "original_audio": false,
52
+ "screen_sharing": false,
53
+ "remote_control": false,
54
+ "attention_tracking": false
55
+ },
56
+ "email_notification": {
57
+ "cloud_recording_avaliable_reminder": false,
58
+ "jbh_reminder": false,
59
+ "cancel_meeting_reminder": false,
60
+ "low_host_count_reminder": false,
61
+ "alternative_host_reminder": false,
62
+ "schedule_for_reminder": false
63
+ },
64
+ "zoom_rooms": {
65
+ "upcoming_meeting_alert": false,
66
+ "start_airplay_manually": false,
67
+ "weekly_system_restart": false,
68
+ "list_meetings_with_calendar": false,
69
+ "zr_post_meeting_feedback": false,
70
+ "ultrasonic": false,
71
+ "force_private_meeting": false,
72
+ "hide_host_information": false,
73
+ "cmr_for_instant_meeting": false,
74
+ "auto_start_stop_scheduled_meetings": false
75
+ },
76
+ "security": {
77
+ "admin_change_name_pic": false,
78
+ "import_photos_from_devices": false,
79
+ "hide_billing_info": false
80
+ },
81
+ "recording": {
82
+ "local_recording": false,
83
+ "cloud_recording": false,
84
+ "record_speaker_view": false,
85
+ "record_gallery_view": false,
86
+ "record_audio_file": false,
87
+ "save_chat_text": false,
88
+ "show_timestamp": false,
89
+ "recording_audio_transcript": false,
90
+ "auto_recording": "local",
91
+ "cloud_recording_download": false,
92
+ "cloud_recording_download_host": false,
93
+ "account_user_access_recording": false,
94
+ "auto_delete_cmr": false,
95
+ "auto_delete_cmr_days": 60
96
+ },
97
+ "telephony": {
98
+ "third_party_audio": false,
99
+ "audio_conference_info": "Magic third party auto conference info"
100
+ },
101
+ "tsp": {
102
+ "call_out": false,
103
+ "call_out_countries": [
104
+ "US"
105
+ ],
106
+ "show_international_numbers_link": false,
107
+ "display_toll_free_numbers": false
108
+ },
109
+ "integration": {
110
+ "google_calendar": false,
111
+ "google_drive": false,
112
+ "dropbox": false,
113
+ "box": false,
114
+ "microsoft_one_drive": false,
115
+ "kubi": false
116
+ },
117
+ "feature": {
118
+ "meeting_capacity": 500
119
+ }
120
+ }