zoom_markazuna 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module IM
6
+ module Chat
7
+ # Get chat messages for a specified period.
8
+ def chat_get(*args)
9
+ options = Utils.extract_options!(args)
10
+ Zoom::Params.new(options).require(:access_token, :session_id, :from, :to)
11
+ # TODO handle date format for `from` and `to` params
12
+ # TODO implement `next_page_token`, will be returned whenever the set of available chat history list exceeds 100. The expiration period is 30 minutes.
13
+ Utils.parse_response self.class.post('/chat/get', query: options)
14
+ end
15
+
16
+ # Get chat history list for a specified time period.
17
+ def chat_list(*args)
18
+ options = Utils.extract_options!(args)
19
+ Zoom::Params.new(options).require(:access_token, :from, :to)
20
+ # TODO handle date format for `from` and `to` params
21
+ # TODO implement `next_page_token`, will be returned whenever the set of available chat history list exceeds 100. The expiration period is 30 minutes.
22
+ Utils.parse_response self.class.post('/chat/list', query: options)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module IM
6
+ module Group
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module M323Device
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module Meeting
6
+ # List all the scheduled meetings on Zoom.
7
+ def meeting_list(*args)
8
+ options = Zoom::Params.new(Utils.extract_options!(args))
9
+ options.require(%i[user_id])
10
+ Utils.parse_response self.class.get("/users/#{options[:user_id]}/meetings", query: options.except(:user_id), headers: request_headers)
11
+ end
12
+
13
+ # Create a meeting on Zoom, return the created meeting URL
14
+ def meeting_create(*args)
15
+ options = Zoom::Params.new(Utils.extract_options!(args))
16
+ options.require(%i[user_id])
17
+ Utils.process_datetime_params!(:start_time, options)
18
+ Utils.parse_response self.class.post("/users/#{options[:user_id]}/meetings", body: options.except(:user_id).to_json, headers: request_headers)
19
+ end
20
+
21
+ # Get a meeting on Zoom via meeting ID, return the meeting info.
22
+ def meeting_get(*args)
23
+ options = Zoom::Params.new(Utils.extract_options!(args))
24
+ options.require(%i[meeting_id])
25
+ Utils.parse_response self.class.get("/meetings/#{options[:meeting_id]}", headers: request_headers)
26
+ end
27
+
28
+ # Update meeting info on Zoom via meeting ID.
29
+ def meeting_update(*args)
30
+ options = Zoom::Params.new(Utils.extract_options!(args))
31
+ options.require(%i[meeting_id])
32
+ Utils.process_datetime_params!(:start_time, options)
33
+ # TODO Handle `topic` attr, Max of 300 characters.
34
+ # TODO Handle `timezone` attr, refer to the id value in timezone list JSON file. like "America/Los_Angeles"
35
+ # TODO Verify `password` attr, may only contain the following characters: a-z A-Z 0-9 @ - _
36
+ # TODO Handle `option_audio` attr, Can be "both", "telephony", "voip".
37
+ # TODO Handle `option_auto_record_type`, Can be "local", “cloud” or "none".
38
+ Utils.parse_response self.class.patch("/meetings/#{options[:meeting_id]}", body: options.except(:meeting_id).to_json, headers: request_headers)
39
+ end
40
+
41
+ # Delete a meeting on Zoom, return the deleted meeting ID.
42
+ def meeting_delete(*args)
43
+ options = Zoom::Params.new(Utils.extract_options!(args))
44
+ options.require(%i[meeting_id])
45
+ Utils.parse_response self.class.delete("/meetings/#{options[:meeting_id]}", query: options.except(:meeting_id), headers: request_headers)
46
+ end
47
+
48
+ # Update a meeting's status
49
+ def meeting_update_status(*args)
50
+ options = Zoom::Params.new(Utils.extract_options!(args))
51
+ options.require(%i[meeting_id])
52
+ Utils.parse_response self.class.put("/meetings/#{options[:meeting_id]}/status", body: options.except(:meeting_id).to_json, headers: request_headers)
53
+ end
54
+
55
+ # End a meeting on Zoom, return the deleted meeting ID.
56
+ def meeting_end(*args)
57
+ options = Utils.extract_options!(args)
58
+ meeting_update_status(options.merge(action: 'end'))
59
+ end
60
+
61
+ # Lists the live meetings on Zoom.
62
+ def meeting_live(*args)
63
+ options = Utils.extract_options!(args)
64
+ meeting_list(options.merge(type: 'live'))
65
+ end
66
+
67
+ # Register for a meeting.
68
+ def meeting_register(*args)
69
+ options = Zoom::Params.new(Utils.extract_options!(args))
70
+ options.require(%i[meeting_id email first_name last_name])
71
+ Utils.parse_response self.class.post("/meetings/#{options[:meeting_id]}/registrants", body: options.except(:meeting_id).to_json, headers: request_headers)
72
+ end
73
+
74
+ # Retrieve ended meeting details
75
+ def past_meeting_details(*args)
76
+ options = Zoom::Params.new(Utils.extract_options!(args))
77
+ options.require(%i[meeting_uuid])
78
+ Utils.parse_response self.class.get("/past_meetings/#{options[:meeting_uuid]}", headers: request_headers)
79
+ end
80
+
81
+ # Retrieve ended meeting participants
82
+ def past_meeting_participants(*args)
83
+ options = Zoom::Params.new(Utils.extract_options!(args))
84
+ options.require(%i[meeting_uuid])
85
+ Utils.parse_response self.class.get("/past_meetings/#{options[:meeting_uuid]}/participants", headers: request_headers)
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module Metrics
6
+ def metrics_crc(*args)
7
+ options = Utils.extract_options!(args)
8
+ Zoom::Params.new(options).require(:from, :to)
9
+ Utils.process_datetime_params!(%i[from to], options)
10
+ Utils.parse_response self.class.post('/metrics/crc', query: options)
11
+ end
12
+
13
+ def metrics_meetings(*args)
14
+ options = Utils.extract_options!(args)
15
+ Zoom::Params.new(options).require(:from, :to, :type)
16
+ Utils.process_datetime_params!(%i[from to], options)
17
+ Utils.parse_response self.class.post('/metrics/meetings', query: options)
18
+ end
19
+
20
+ def metrics_meetingdetail(*args)
21
+ options = Utils.extract_options!(args)
22
+ Zoom::Params.new(options).require(:meeting_id, :type)
23
+ Utils.parse_response self.class.post('/metrics/meetingdetail', query: options)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module Recording
6
+ def recording_list(*args)
7
+ options = Utils.extract_options!(args)
8
+ Zoom::Params.new(options).require(:host_id)
9
+ Utils.process_datetime_params!(%i[from to], options)
10
+ Utils.parse_response self.class.post('/recording/list', query: options)
11
+ end
12
+
13
+ def mc_recording_list(*args)
14
+ options = Utils.extract_options!(args)
15
+ Zoom::Params.new(options).require(:host_id)
16
+ Utils.process_datetime_params!(%i[from to], options)
17
+ Utils.parse_response self.class.post('/mc/recording/list', query: options)
18
+ end
19
+
20
+ def recording_get(*args)
21
+ options = Utils.extract_options!(args)
22
+ Zoom::Params.new(options).require(:meeting_id)
23
+ Utils.parse_response self.class.post('/recording/get', query: options)
24
+ end
25
+
26
+ def recording_delete(*args)
27
+ options = Utils.extract_options!(args)
28
+ Zoom::Params.new(options).require(:meeting_id)
29
+ Utils.parse_response self.class.post('/recording/delete', query: options)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module Report
6
+ def daily_report(*args)
7
+ params = Zoom::Params.new(Utils.extract_options!(args))
8
+ params.permit(:year, :month)
9
+ Utils.parse_response self.class.get('/report/daily', query: params, headers: request_headers)
10
+ end
11
+
12
+ def hosts_report(*args)
13
+ # TODO: implement hosts_report
14
+ end
15
+
16
+ def meetings_report(*args)
17
+ # TODO: implement meetings_report
18
+ end
19
+
20
+ def meeting_details_report(*args)
21
+ # TODO: implement meeting_details_report
22
+ end
23
+
24
+ def meeting_participants_report(*args)
25
+ # TODO: implement meeting_participants_report
26
+ end
27
+
28
+ def meeting_polls_report(*args)
29
+ # TODO: implement meeting_polls_report
30
+ end
31
+
32
+ def webinar_details_report(*args)
33
+ # TODO: implement webinar_details_report
34
+ end
35
+
36
+ def webinar_participants_report(*args)
37
+ params = Zoom::Params.new(Utils.extract_options!(args))
38
+ params.require(:id).permit(:page_size, :next_page_token)
39
+ Utils.parse_response self.class.get("/report/webinars/#{params[:id]}/participants", query: params.except(:id).merge(access_token: access_token))
40
+ end
41
+
42
+ def webinar_polls_report(*args)
43
+ # TODO: implement report_hosts
44
+ end
45
+
46
+ def webinar_qa_report(*args)
47
+ # TODO: implement report_hosts
48
+ end
49
+
50
+ def telephone_report(*args)
51
+ # TODO: implement report_hosts
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,146 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module User
6
+ def user_list(*args)
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, headers: request_headers)
10
+ Utils.parse_response(response)
11
+ end
12
+
13
+ def user_create(*args)
14
+ params = Zoom::Params.new(Utils.extract_options!(args))
15
+ require_param_keys = %i[action email type]
16
+ require_param_keys.append(:password) if params[:action] == 'autoCreate'
17
+ params.require(require_param_keys)
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
+ end
21
+
22
+ def user_get(*args)
23
+ params = Zoom::Params.new(Utils.extract_options!(args))
24
+ params.require(:id).permit(:login_type)
25
+ Utils.parse_response self.class.get("/users/#{params[:id]}", query: params.except(:id), headers: request_headers)
26
+ end
27
+
28
+ def user_update(*args)
29
+ params = Zoom::Params.new(Utils.extract_options!(args))
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), headers: request_headers)
32
+ end
33
+
34
+ def user_delete(*args)
35
+ params = Zoom::Params.new(Utils.extract_options!(args))
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), headers: request_headers)
38
+ end
39
+
40
+ def user_assistants_list(*args)
41
+ raise Zoom::NotImplemented, 'user_assistants_list is not yet implemented'
42
+ # TODO: implement user_assistants_list
43
+ # options = Utils.extract_options!(args)
44
+ Utils.parse_response self.class.get("/users/#{options.slice!(:id)}/assistants", query: options, headers: request_headers)
45
+ end
46
+
47
+ def user_assistants_create(*args)
48
+ raise Zoom::NotImplemented, 'user_assistants_create is not yet implemented'
49
+ # TODO: validate body attributes
50
+ options = Utils.extract_options!(args)
51
+ Utils.parse_response self.class.post("/users/#{options.slice!(:id)}/assistants", body: options, headers: request_headers)
52
+ end
53
+
54
+ def user_assistants_delete_all(*args)
55
+ raise Zoom::NotImplemented, 'user_assistants_delete_all is not yet implemented'
56
+ # TODO: implement user_assistants_delete_all
57
+ options = Utils.extract_options!(args)
58
+ Utils.parse_response self.class.delete("/users/#{options.slice!(:id)}/assistants", body: options, headers: request_headers)
59
+ end
60
+
61
+ def user_assistants_delete(*args)
62
+ # TODO: implement user_assistants_delete
63
+ # options = Utils.extract_options!(args)
64
+ raise Zoom::NotImplemented, 'user_assistants_delete is not yet implemented'
65
+ end
66
+
67
+ def user_schedulers_list(*args)
68
+ # TODO: implement user_schedulers_list
69
+ # options = Utils.extract_options!(args)
70
+ raise Zoom::NotImplemented, 'user_schedulers_list is not yet implemented'
71
+ end
72
+
73
+ def user_schedulers_delete_all(*args)
74
+ # TODO: implement user_schedulers_delete_all
75
+ # options = Utils.extract_options!(args)
76
+ raise Zoom::NotImplemented, 'user_schedulers_delete_all is not yet implemented'
77
+ end
78
+
79
+ def user_schedulers_delete(*args)
80
+ # TODO: implement user_schedulers_delete
81
+ # options = Utils.extract_options!(args)
82
+ raise Zoom::NotImplemented, 'user_schedulers_delete is not yet implemented'
83
+ end
84
+
85
+ def user_upload_picture(*args)
86
+ # TODO: implement user_upload_picture
87
+ # options = Utils.extract_options!(args)
88
+ raise Zoom::NotImplemented, 'user_upload_picture is not yet implemented'
89
+ end
90
+
91
+ def user_settings_get(*args)
92
+ params = Zoom::Params.new(Utils.extract_options!(args))
93
+ params.require(:id).permit(:login_type)
94
+ Utils.parse_response self.class.get("/users/#{params[:id]}/settings", query: params.except(:id), headers: request_headers)
95
+ end
96
+
97
+ def user_settings_update(*args)
98
+ # TODO: implement user_settings_update
99
+ # options = Utils.extract_options!(args)
100
+ raise Zoom::NotImplemented, 'user_settings_update is not yet implemented'
101
+ end
102
+
103
+ def user_status_update(*args)
104
+ # TODO: implement user_status_update
105
+ # options = Utils.extract_options!(args)
106
+ raise Zoom::NotImplemented, 'user_status_update is not yet implemented'
107
+ end
108
+
109
+ def user_password_update(*args)
110
+ # TODO: implement user_password_update
111
+ # options = Utils.extract_options!(args)
112
+ raise Zoom::NotImplemented, 'user_password_update is not yet implemented'
113
+ end
114
+
115
+ def user_permissions_get(*args)
116
+ # TODO: implement user_permissions_get
117
+ # options = Utils.extract_options!(args)
118
+ raise Zoom::NotImplemented, 'user_permissions_get is not yet implemented'
119
+ end
120
+
121
+ def user_token_get(*args)
122
+ # TODO: implement user_token_get
123
+ # options = Utils.extract_options!(args)
124
+ raise Zoom::NotImplemented, 'user_token_get is not yet implemented'
125
+ end
126
+
127
+ def user_token_delete(*args)
128
+ # TODO: implement user_token_delete
129
+ # options = Utils.extract_options!(args)
130
+ raise Zoom::NotImplemented, 'user_token_delete is not yet implemented'
131
+ end
132
+
133
+ def user_email_check(*args)
134
+ # TODO: implement user_email_check
135
+ # options = Utils.extract_options!(args)
136
+ raise Zoom::NotImplemented, 'user_email_check is not yet implemented'
137
+ end
138
+
139
+ def user_vanity_name_check(*args)
140
+ # TODO: implement user_vanity_name_check
141
+ # options = Utils.extract_options!(args)
142
+ raise Zoom::NotImplemented, 'user_vanity_name_check is not yet implemented'
143
+ end
144
+ end
145
+ end
146
+ end
@@ -0,0 +1,115 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module Webinar
6
+ RECURRENCE_KEYS = %i[type repeat_interval weekly_days monthly_day monthly_week
7
+ monthly_week_day end_times end_date_time].freeze
8
+ SETTINGS_KEYS = %i[panelists_video practice_session hd_video approval_type
9
+ registration_type audio auto_recording enforce_login
10
+ enforce_login_domains alternative_hosts close_registration
11
+ show_share_button allow_multiple_devices registrants_confirmation_email].freeze
12
+ def webinar_list(*args)
13
+ params = Zoom::Params.new(Utils.extract_options!(args))
14
+ params.require(:host_id).permit(:page_size, :page_number)
15
+ Utils.parse_response self.class.get("/users/#{params[:host_id]}/webinars", query: params, headers: request_headers)
16
+ end
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
28
+
29
+ def webinar_get(*args)
30
+ params = Zoom::Params.new(Utils.extract_options!(args))
31
+ params.require(:id)
32
+ Utils.parse_response self.class.get("/webinars/#{params[:id]}", headers: request_headers)
33
+ end
34
+
35
+ def webinar_update(*args)
36
+ params = Zoom::Params.new(Utils.extract_options!(args))
37
+ params.require(:id).permit(:topic, :type, :start_time, :duration,
38
+ :timezone, :password, :agenda,
39
+ recurrence: RECURRENCE_KEYS,
40
+ settings: SETTINGS_KEYS)
41
+ Utils.parse_response self.class.patch("/webinars/#{params[:id]}", body: params.except(:id).to_json, headers: request_headers)
42
+ end
43
+
44
+ def webinar_delete(*args)
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
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'
78
+ end
79
+
80
+ def webinar_registrants_list(*args)
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
85
+
86
+ def webinar_registrant_add(*args)
87
+ params = Zoom::Params.new(Utils.extract_options!(args))
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
94
+
95
+ def webinar_registrants_status_update(*args)
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
101
+
102
+ def past_webinar_list(*args)
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
107
+
108
+ def webinar_registrant_get(*args)
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
113
+ end
114
+ end
115
+ end