zoom_rb 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +1 -1
  3. data/.gitignore +2 -1
  4. data/CHANGELOG.md +53 -0
  5. data/Gemfile.lock +85 -51
  6. data/Makefile +1 -1
  7. data/README.md +31 -3
  8. data/lib/zoom/actions/account.rb +18 -76
  9. data/lib/zoom/actions/billing.rb +41 -0
  10. data/lib/zoom/actions/dashboard.rb +22 -0
  11. data/lib/zoom/actions/groups.rb +19 -0
  12. data/lib/zoom/actions/im/chat.rb +13 -14
  13. data/lib/zoom/actions/meeting.rb +38 -63
  14. data/lib/zoom/actions/phone.rb +15 -0
  15. data/lib/zoom/actions/recording.rb +13 -22
  16. data/lib/zoom/actions/report.rb +8 -43
  17. data/lib/zoom/actions/roles.rb +24 -0
  18. data/lib/zoom/actions/sip_audio.rb +34 -0
  19. data/lib/zoom/actions/token.rb +26 -0
  20. data/lib/zoom/actions/user.rb +66 -139
  21. data/lib/zoom/actions/webinar.rb +43 -84
  22. data/lib/zoom/actions.rb +49 -0
  23. data/lib/zoom/client.rb +27 -16
  24. data/lib/zoom/clients/jwt.rb +22 -0
  25. data/lib/zoom/clients/oauth.rb +60 -0
  26. data/lib/zoom/constants/account/options/pay_modes.rb +12 -0
  27. data/lib/zoom/constants/account/settings/permitted_settings.rb +125 -0
  28. data/lib/zoom/constants/constants.rb +35 -0
  29. data/lib/zoom/constants/meeting/approval_types.rb +11 -0
  30. data/lib/zoom/constants/meeting/audio_type.rb +11 -0
  31. data/lib/zoom/constants/meeting/auto_recording.rb +11 -0
  32. data/lib/zoom/constants/meeting/registration_types.rb +11 -0
  33. data/lib/zoom/constants/meeting/types.rb +12 -0
  34. data/lib/zoom/constants/recurrence/monthly_weeks.rb +13 -0
  35. data/lib/zoom/constants/recurrence/types.rb +11 -0
  36. data/lib/zoom/constants/recurrence/weekly_days.rb +15 -0
  37. data/lib/zoom/constants/user/create_types.rb +12 -0
  38. data/lib/zoom/constants/user/types.rb +11 -0
  39. data/lib/zoom/constants/webinar/approval_types.rb +11 -0
  40. data/lib/zoom/constants/webinar/audio_type.rb +11 -0
  41. data/lib/zoom/constants/webinar/auto_recording.rb +11 -0
  42. data/lib/zoom/constants/webinar/registration_types.rb +11 -0
  43. data/lib/zoom/constants/webinar/types.rb +11 -0
  44. data/lib/zoom/error.rb +9 -1
  45. data/lib/zoom/params.rb +51 -12
  46. data/lib/zoom/utils.rb +22 -38
  47. data/lib/zoom/version.rb +2 -2
  48. data/lib/{zoom.rb → zoom_rb.rb} +12 -5
  49. data/spec/fixtures/account/create.json +6 -0
  50. data/spec/{lib/zoom/actions/report/hosts_report_spec.rb → fixtures/account/delete.json} +0 -0
  51. data/spec/fixtures/account/get.json +13 -0
  52. data/spec/fixtures/account/list.json +18 -0
  53. data/spec/fixtures/account/managed_domains.json +7 -0
  54. data/spec/fixtures/account/options_update.json +7 -0
  55. data/spec/fixtures/account/settings_get.json +120 -0
  56. data/spec/{lib/zoom/actions/report/meeting_polls_report_spec.rb → fixtures/account/settings_update.json} +0 -0
  57. data/spec/fixtures/account/trusted_domains.json +3 -0
  58. data/spec/fixtures/billing/get.json +12 -0
  59. data/spec/fixtures/billing/plans_list.json +44 -0
  60. data/spec/fixtures/billing/plans_subscribe.json +30 -0
  61. data/spec/fixtures/billing/plans_usage.json +30 -0
  62. data/spec/{lib/zoom/actions/report/meetings_report_spec.rb → fixtures/billing/update.json} +0 -0
  63. data/spec/fixtures/chat/channels/get.json +5 -0
  64. data/spec/fixtures/chat/users/channels/list.json +17 -0
  65. data/spec/fixtures/dashboard/crc.json +104 -0
  66. data/spec/fixtures/dashboard/meeting/detail.json +20 -0
  67. data/spec/fixtures/dashboard/meeting/participants.json +56 -0
  68. data/spec/fixtures/{metrics_meetings.json → dashboard/meetings.json} +1 -2
  69. data/spec/fixtures/error/admin_cannot_activated.json +4 -0
  70. data/spec/fixtures/error/channel_not_found.json +4 -0
  71. data/spec/fixtures/error/group_does_not_exist.json +4 -0
  72. data/spec/fixtures/error/group_not_belong_to_account.json +4 -0
  73. data/spec/fixtures/error/group_not_exist.json +4 -0
  74. data/spec/fixtures/error/meeting_not_exist.json +4 -0
  75. data/spec/fixtures/error/next_page_token_invalid.json +4 -0
  76. data/spec/fixtures/error/not_found_administrator.json +4 -0
  77. data/spec/fixtures/error/unauthorized_request.json +4 -0
  78. data/spec/fixtures/error/user_not_exist.json +1 -1
  79. data/spec/fixtures/groups/create.json +5 -0
  80. data/spec/fixtures/groups/get.json +5 -0
  81. data/spec/fixtures/groups/list.json +15 -0
  82. data/spec/{lib/zoom/actions/report/telephone_report_spec.rb → fixtures/groups/update.json} +0 -0
  83. data/spec/fixtures/meeting/add_registrant.json +7 -0
  84. data/spec/fixtures/meeting/create.json +31 -16
  85. data/spec/fixtures/meeting/get.json +43 -33
  86. data/spec/fixtures/meeting/invitation.json +3 -0
  87. data/spec/fixtures/meeting/live_stream/errors/meeting_not_found.json +4 -0
  88. data/spec/fixtures/meeting/live_stream/errors/missing_field.json +10 -0
  89. data/spec/fixtures/{recording_get.json → recording/get.json} +17 -6
  90. data/spec/fixtures/recording/list.json +53 -0
  91. data/spec/fixtures/recording/settings/get.json +7 -0
  92. data/spec/fixtures/report/meeting/participants.json +17 -0
  93. data/spec/fixtures/report/meeting.json +19 -0
  94. data/spec/fixtures/roles/assign.json +4 -0
  95. data/spec/fixtures/roles/create.json +9 -0
  96. data/spec/fixtures/roles/get.json +11 -0
  97. data/spec/fixtures/roles/list.json +29 -0
  98. data/spec/fixtures/roles/members.json +15 -0
  99. data/spec/fixtures/sip_audio/sip_trunks_get.json +19 -0
  100. data/spec/fixtures/sip_audio/sip_trunks_internal_callout_countries_add.json +10 -0
  101. data/spec/fixtures/sip_audio/sip_trunks_internal_callout_country_list.json +15 -0
  102. data/spec/fixtures/sip_audio/sip_trunks_internal_numbers_add.json +14 -0
  103. data/spec/fixtures/sip_audio/sip_trunks_internal_numbers_list.json +16 -0
  104. data/spec/fixtures/sip_audio/sip_trunks_numbers_assign.json +7 -0
  105. data/spec/fixtures/sip_audio/sip_trunks_numbers_list.json +9 -0
  106. data/spec/fixtures/token/access_token.json +7 -0
  107. data/spec/fixtures/token/data_compliance.json +8 -0
  108. data/spec/fixtures/token/refresh_token.json +7 -0
  109. data/spec/fixtures/user/assistant/create.json +4 -0
  110. data/spec/fixtures/user/assistant/list.json +8 -0
  111. data/spec/fixtures/user/email_check.json +3 -0
  112. data/spec/fixtures/user/get.json +35 -21
  113. data/spec/fixtures/user/list.json +17 -13
  114. data/spec/fixtures/user/permissions.json +65 -0
  115. data/spec/fixtures/user/recording/list.json +50 -0
  116. data/spec/fixtures/user/scheduler/list.json +12 -0
  117. data/spec/fixtures/user/settings_get.json +74 -0
  118. data/spec/fixtures/user/token.json +3 -0
  119. data/spec/{lib/zoom/actions/report/webinar_details_report_spec.rb → fixtures/user/update_email.json} +0 -0
  120. data/spec/{lib/zoom/actions/report/webinar_polls_report_spec.rb → fixtures/user/update_password.json} +0 -0
  121. data/spec/{lib/zoom/actions/report/webinar_qa_report_spec.rb → fixtures/user/update_status.json} +0 -0
  122. data/spec/fixtures/user/vanity_name.json +3 -0
  123. data/spec/fixtures/webinar/panelist_list.json +12 -0
  124. data/spec/fixtures/webinar/past_webinar_list.json +8 -0
  125. data/spec/fixtures/webinar/poll_get.json +13 -0
  126. data/spec/fixtures/webinar/polls_list.json +16 -0
  127. data/spec/fixtures/webinar/registrant/get.json +25 -0
  128. data/spec/lib/zoom/actions/account/create_spec.rb +68 -0
  129. data/spec/lib/zoom/actions/account/delete_spec.rb +44 -0
  130. data/spec/lib/zoom/actions/account/get_locked_settings_spec.rb +43 -0
  131. data/spec/lib/zoom/actions/account/get_spec.rb +43 -0
  132. data/spec/lib/zoom/actions/account/list_spec.rb +58 -0
  133. data/spec/lib/zoom/actions/account/managed_domains_spec.rb +43 -0
  134. data/spec/lib/zoom/actions/account/options_update_spec.rb +58 -0
  135. data/spec/lib/zoom/actions/account/settings_get_spec.rb +50 -0
  136. data/spec/lib/zoom/actions/account/settings_update_spec.rb +55 -0
  137. data/spec/lib/zoom/actions/account/trusted_domains_spec.rb +43 -0
  138. data/spec/lib/zoom/actions/billing/get_spec.rb +48 -0
  139. data/spec/lib/zoom/actions/billing/plans_list_spec.rb +48 -0
  140. data/spec/lib/zoom/actions/billing/plans_subscribe_spec.rb +69 -0
  141. data/spec/lib/zoom/actions/billing/plans_usage_spec.rb +48 -0
  142. data/spec/lib/zoom/actions/billing/update_spec.rb +64 -0
  143. data/spec/lib/zoom/actions/dashboard/crc_spec.rb +33 -0
  144. data/spec/lib/zoom/actions/dashboard/meeting_details_spec.rb +62 -0
  145. data/spec/lib/zoom/actions/dashboard/meeting_participants_spec.rb +74 -0
  146. data/spec/lib/zoom/actions/dashboard/meetings_spec.rb +63 -0
  147. data/spec/lib/zoom/actions/groups/create_spec.rb +98 -0
  148. data/spec/lib/zoom/actions/{group → groups}/delete_spec.rb +0 -0
  149. data/spec/lib/zoom/actions/{group → groups}/edit_spec.rb +0 -0
  150. data/spec/lib/zoom/actions/groups/get_spec.rb +62 -0
  151. data/spec/lib/zoom/actions/groups/list_spec.rb +47 -0
  152. data/spec/lib/zoom/actions/{group → groups}/member/add_spec.rb +0 -0
  153. data/spec/lib/zoom/actions/{group → groups}/member/delete_spec.rb +0 -0
  154. data/spec/lib/zoom/actions/{group → groups/member}/list_spec.rb +0 -0
  155. data/spec/lib/zoom/actions/groups/update_spec.rb +59 -0
  156. data/spec/lib/zoom/actions/im/chat/channels/get_spec.rb +64 -0
  157. data/spec/lib/zoom/actions/im/chat/users/channels/get_spec.rb +45 -0
  158. data/spec/lib/zoom/actions/meeting/add_registrant_spec.rb +30 -0
  159. data/spec/lib/zoom/actions/meeting/create_spec.rb +13 -13
  160. data/spec/lib/zoom/actions/meeting/delete_spec.rb +17 -34
  161. data/spec/lib/zoom/actions/meeting/get_spec.rb +21 -31
  162. data/spec/lib/zoom/actions/meeting/invitation_spec.rb +48 -0
  163. data/spec/lib/zoom/actions/meeting/livestream_spec.rb +61 -0
  164. data/spec/lib/zoom/actions/meeting/update_spec.rb +48 -42
  165. data/spec/lib/zoom/actions/recording/file_delete_spec.rb +33 -0
  166. data/spec/lib/zoom/actions/recording/get_spec.rb +19 -35
  167. data/spec/lib/zoom/actions/recording/list_spec.rb +20 -26
  168. data/spec/lib/zoom/actions/recording/settings/get_spec.rb +42 -0
  169. data/spec/lib/zoom/actions/recording/settings/update_spec.rb +32 -0
  170. data/spec/lib/zoom/actions/report/meeting_details_report_spec.rb +44 -0
  171. data/spec/lib/zoom/actions/report/meeting_participants_report_spec.rb +44 -0
  172. data/spec/lib/zoom/actions/report/webinar_participants_report_spec.rb +2 -2
  173. data/spec/lib/zoom/actions/roles/assign_spec.rb +25 -0
  174. data/spec/lib/zoom/actions/roles/create_spec.rb +55 -0
  175. data/spec/lib/zoom/actions/roles/get_spec.rb +37 -0
  176. data/spec/lib/zoom/actions/roles/list_spec.rb +28 -0
  177. data/spec/lib/zoom/actions/roles/members_spec.rb +35 -0
  178. data/spec/lib/zoom/actions/roles/unassign_spec.rb +34 -0
  179. data/spec/lib/zoom/actions/sip_audio/add_trunks_internal_callout_countries_spec.rb +25 -0
  180. data/spec/lib/zoom/actions/sip_audio/add_trunks_internal_numbers_spec.rb +25 -0
  181. data/spec/lib/zoom/actions/sip_audio/assign_numbers_spec.rb +29 -0
  182. data/spec/lib/zoom/actions/sip_audio/delete_internal_callout_countries_spec.rb +44 -0
  183. data/spec/lib/zoom/actions/sip_audio/delete_trunk_internal_numbers_spec.rb +44 -0
  184. data/spec/lib/zoom/actions/sip_audio/delete_trunk_numbers_spec.rb +44 -0
  185. data/spec/lib/zoom/actions/sip_audio/delete_trunks_spec.rb +44 -0
  186. data/spec/lib/zoom/actions/sip_audio/get_trunks_spec.rb +50 -0
  187. data/spec/lib/zoom/actions/sip_audio/list_trunk_numbers_spec.rb +46 -0
  188. data/spec/lib/zoom/actions/sip_audio/list_trunks_internal_callout_country_spec.rb +53 -0
  189. data/spec/lib/zoom/actions/sip_audio/list_trunks_internal_numbers_spec.rb +53 -0
  190. data/spec/lib/zoom/actions/token/access_token_spec.rb +26 -0
  191. data/spec/lib/zoom/actions/token/data_compliance_spec.rb +41 -0
  192. data/spec/lib/zoom/actions/token/refresh_token_spec.rb +26 -0
  193. data/spec/lib/zoom/actions/user/assistant/create_spec.rb +59 -0
  194. data/spec/lib/zoom/actions/user/assistant/delete_all_spec.rb +44 -0
  195. data/spec/lib/zoom/actions/user/assistant/delete_spec.rb +48 -1
  196. data/spec/lib/zoom/actions/user/assistant/list_spec.rb +53 -0
  197. data/spec/lib/zoom/actions/user/create_spec.rb +20 -48
  198. data/spec/lib/zoom/actions/user/delete_spec.rb +2 -2
  199. data/spec/lib/zoom/actions/user/email_check_spec.rb +43 -0
  200. data/spec/lib/zoom/actions/user/get_spec.rb +12 -3
  201. data/spec/lib/zoom/actions/user/list_recordings_spec.rb +57 -0
  202. data/spec/lib/zoom/actions/user/list_spec.rb +34 -3
  203. data/spec/lib/zoom/actions/user/permissions_spec.rb +52 -0
  204. data/spec/lib/zoom/actions/user/scheduler/delete_all_spec.rb +44 -0
  205. data/spec/lib/zoom/actions/user/scheduler/delete_spec.rb +50 -0
  206. data/spec/lib/zoom/actions/user/scheduler/list_spec.rb +53 -0
  207. data/spec/lib/zoom/actions/user/settings_get_spec.rb +56 -0
  208. data/spec/lib/zoom/actions/user/settings_update_spec.rb +50 -0
  209. data/spec/lib/zoom/actions/user/token_spec.rb +61 -0
  210. data/spec/lib/zoom/actions/user/update_email_spec.rb +59 -0
  211. data/spec/lib/zoom/actions/user/update_password_spec.rb +29 -0
  212. data/spec/lib/zoom/actions/user/update_spec.rb +2 -2
  213. data/spec/lib/zoom/actions/user/update_status_spec.rb +59 -0
  214. data/spec/lib/zoom/actions/user/vanity_name_spec.rb +51 -0
  215. data/spec/lib/zoom/actions/webinar/create_spec.rb +49 -44
  216. data/spec/lib/zoom/actions/webinar/delete_spec.rb +3 -3
  217. data/spec/lib/zoom/actions/webinar/get_spec.rb +1 -1
  218. data/spec/lib/zoom/actions/webinar/list_spec.rb +2 -2
  219. data/spec/lib/zoom/actions/webinar/panelist_list_spec.rb +44 -0
  220. data/spec/lib/zoom/actions/webinar/past_webinar_list_spec.rb +44 -0
  221. data/spec/lib/zoom/actions/webinar/poll_get_spec.rb +47 -0
  222. data/spec/lib/zoom/actions/webinar/polls_list_spec.rb +44 -0
  223. data/spec/lib/zoom/actions/webinar/registrants/add_spec.rb +2 -2
  224. data/spec/lib/zoom/actions/webinar/registrants/get_spec.rb +49 -0
  225. data/spec/lib/zoom/actions/webinar/registrants/list_spec.rb +2 -2
  226. data/spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb +1 -1
  227. data/spec/lib/zoom/actions/webinar/update_spec.rb +2 -2
  228. data/spec/lib/zoom/actions_spec.rb +84 -0
  229. data/spec/lib/zoom/client_spec.rb +85 -7
  230. data/spec/lib/zoom/params_spec.rb +23 -3
  231. data/spec/lib/zoom/utils_spec.rb +13 -18
  232. data/spec/spec_helper.rb +23 -2
  233. data/zoom_rb.gemspec +1 -1
  234. metadata +343 -112
  235. data/.ruby-version +0 -1
  236. data/lib/zoom/actions/group.rb +0 -8
  237. data/lib/zoom/actions/metrics.rb +0 -27
  238. data/lib/zoom/constants.rb +0 -103
  239. data/spec/fixtures/meeting/delete.json +0 -4
  240. data/spec/fixtures/meeting/end.json +0 -4
  241. data/spec/fixtures/meeting/live.json +0 -32
  242. data/spec/fixtures/meeting/register.json +0 -7
  243. data/spec/fixtures/meeting/update.json +0 -4
  244. data/spec/fixtures/metrics_crc.json +0 -105
  245. data/spec/fixtures/metrics_meetingdetail.json +0 -32
  246. data/spec/fixtures/recording_delete.json +0 -4
  247. data/spec/fixtures/recording_list.json +0 -51
  248. data/spec/fixtures/user/assistant/delete.json +0 -5
  249. data/spec/lib/zoom/actions/group/create_spec.rb +0 -3
  250. data/spec/lib/zoom/actions/group/get_spec.rb +0 -3
  251. data/spec/lib/zoom/actions/group/member/list_spec.rb +0 -3
  252. data/spec/lib/zoom/actions/meeting/end_spec.rb +0 -55
  253. data/spec/lib/zoom/actions/meeting/live_spec.rb +0 -43
  254. data/spec/lib/zoom/actions/meeting/register_spec.rb +0 -45
  255. data/spec/lib/zoom/actions/metrics/crc_spec.rb +0 -48
  256. data/spec/lib/zoom/actions/metrics/im_spec.rb +0 -3
  257. data/spec/lib/zoom/actions/metrics/meetingdetail_spec.rb +0 -51
  258. data/spec/lib/zoom/actions/metrics/meetings_spec.rb +0 -61
  259. data/spec/lib/zoom/actions/metrics/qos_spec.rb +0 -3
  260. data/spec/lib/zoom/actions/metrics/webinardetail_spec.rb +0 -3
  261. data/spec/lib/zoom/actions/metrics/webinars_spec.rb +0 -3
  262. data/spec/lib/zoom/actions/metrics/zoomroomdetail_spec.rb +0 -3
  263. data/spec/lib/zoom/actions/metrics/zoomrooms_spec.rb +0 -3
  264. data/spec/lib/zoom/actions/recording/delete_spec.rb +0 -52
  265. data/spec/lib/zoom/actions/recording/mc_list_spec.rb +0 -51
  266. data/spec/lib/zoom/actions/user/activate_spec.rb +0 -3
  267. data/spec/lib/zoom/actions/user/checkemail_spec.rb +0 -3
  268. data/spec/lib/zoom/actions/user/checkzpk_spec.rb +0 -3
  269. data/spec/lib/zoom/actions/user/deactivate_spec.rb +0 -3
  270. data/spec/lib/zoom/actions/user/revoketoken_spec.rb +0 -3
  271. data/spec/lib/zoom/actions/user/updatepassword_spec.rb +0 -3
  272. data/spec/lib/zoom/actions/webinar/panelists_spec.rb +0 -3
  273. data/spec/lib/zoom/actions/webinar/polls_spec.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 711b71ce15443f695b228ee36d51501e18b2b5132ab3b2c473d1d8300ea64720
4
- data.tar.gz: 4f967a6b7e73adc1450d7ea51defb7380fa6c660c83922a01ba696f91950a25f
3
+ metadata.gz: e9d0d18470f4f9f7f62c286725f5b30c704e1f73fb2cb543723cfbc1e36eed4a
4
+ data.tar.gz: 6266834d04ea88468eb40d42a30c19e15774f02b322a69eb5535c6569b88fb05
5
5
  SHA512:
6
- metadata.gz: 7d57f4998d48c7999a9a404688120312173d5c613a82069717ffd414dd8ad744dc1695e085436160fc7deb96350a86e689d053fea94ed6eeec0225ac77fd5ead
7
- data.tar.gz: eff852b6a1012dd45186560406d5afeb98ae77aa8a41d43c663ca1edfde5fd2f5bced5512fea05a71b1be7f14c681fdde51824009773ec468130dda437622f3b
6
+ metadata.gz: '028821632a4c9147d86975b00f87d1ff98b1d98cd2adb419a07f551b8f6186f2ed28699b7666e6e2d2765d736df4ece5e8c1b8c51c24cb9c87ed960ba27c8a93'
7
+ data.tar.gz: bb2088f723fb1f9c0b6780fb81dafe26c0a893298a1c03108dcc14d4e4c6a3070e57543f8ea7953047e2aa75435a55ec88baffb5bd39033891d2f8617694e7c8
data/.circleci/config.yml CHANGED
@@ -9,7 +9,7 @@ jobs:
9
9
  CC_TEST_REPORTER_ID: c6c77975186cfe10e41d9548e9b4a4648f87b56cdbb70bd3896a5a58abf08421
10
10
  docker:
11
11
  # specify the version you desire here
12
- - image: circleci/ruby:2.5.1-node-browsers
12
+ - image: circleci/ruby:2.7-node-browsers
13
13
 
14
14
  # Specify service dependencies here if necessary
15
15
  # CircleCI maintains a library of pre-built images
data/.gitignore CHANGED
@@ -16,4 +16,5 @@ test/version_tmp
16
16
  tmp
17
17
  build_and_publish
18
18
  .rubocop*
19
- .DS_Store
19
+ .DS_Store
20
+ .ruby-version
data/CHANGELOG.md ADDED
@@ -0,0 +1,53 @@
1
+ # 1.0.0
2
+
3
+ The 1.0 release and a major refactor of all endpoint definitions.
4
+
5
+ ### Breaking Change
6
+ * The `user_create` endpoint now requires its arguments to match the actual Zoom API.
7
+ This is done to simplify the code and encourage consistency.
8
+ This means that instead of passing:
9
+ ```
10
+ {
11
+ action: 'create',
12
+ email: 'foo@bar.com',
13
+ type: 1,
14
+ first_name: 'Zoomie',
15
+ last_name: 'Userton',
16
+ password: 'testerino'
17
+ }
18
+ ```
19
+ You will instead have to pass:
20
+ ```
21
+ {
22
+ action: 'create',
23
+ user_info: {
24
+ email: 'foo@bar.com',
25
+ type: 1,
26
+ first_name: 'Zoomie',
27
+ last_name: 'Userton',
28
+ password: 'testerino'
29
+ }
30
+ }
31
+ ```
32
+ Zoom API reference for user creation: https://marketplace.zoom.us/docs/api-reference/zoom-api/users/usercreate
33
+
34
+ ### New features
35
+ * Greatly simplified new syntax when adding endpoints. This reduces repetition and makes it easier.
36
+ * On `user_settings_get`, permit `option` and `custom_query_fields`.
37
+ * Add `group_create` and `group_update`.
38
+
39
+ # 0.11.0
40
+
41
+ This is the first CHANGELOG entry.
42
+
43
+ ### New features:
44
+ * A lot of new endpoints
45
+
46
+ ### Fixes:
47
+ * Update README to say `require 'zoom'`
48
+ * Fix a typo in the README
49
+
50
+ ### Misc:
51
+ * Update gems
52
+ * Update bundler to 2.2
53
+ * Update Ruby to 2.7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zoom_rb (0.8.6)
4
+ zoom_rb (1.0.0)
5
5
  httparty (~> 0.13)
6
6
  json (>= 1.8)
7
7
  jwt
@@ -9,78 +9,112 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.5.2)
13
- public_suffix (>= 2.0.2, < 4.0)
14
- ast (2.4.0)
15
- coderay (1.1.2)
16
- crack (0.4.3)
17
- safe_yaml (~> 1.0.0)
18
- diff-lcs (1.3)
19
- docile (1.3.1)
20
- hashdiff (0.3.7)
21
- hint-rubocop_style (0.2.5)
22
- rubocop (>= 0.50.0)
23
- rubocop-rspec (>= 1.17.0)
24
- httparty (0.16.2)
12
+ activesupport (6.1.4)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 1.6, < 2)
15
+ minitest (>= 5.1)
16
+ tzinfo (~> 2.0)
17
+ zeitwerk (~> 2.3)
18
+ addressable (2.8.0)
19
+ public_suffix (>= 2.0.2, < 5.0)
20
+ ast (2.4.2)
21
+ byebug (11.1.3)
22
+ coderay (1.1.3)
23
+ concurrent-ruby (1.1.9)
24
+ crack (0.4.5)
25
+ rexml
26
+ diff-lcs (1.4.4)
27
+ docile (1.4.0)
28
+ hashdiff (1.0.1)
29
+ hint-rubocop_style (0.3.6)
30
+ rubocop (>= 0.78.0)
31
+ rubocop-performance (>= 1.3.0)
32
+ rubocop-rails (>= 2.0.0)
33
+ rubocop-rspec (>= 1.33.0)
34
+ httparty (0.20.0)
35
+ mime-types (~> 3.0)
25
36
  multi_xml (>= 0.5.2)
26
- jaro_winkler (1.5.1)
27
- json (2.1.0)
28
- jwt (2.1.0)
29
- method_source (0.9.0)
37
+ i18n (1.8.10)
38
+ concurrent-ruby (~> 1.0)
39
+ json (2.5.1)
40
+ jwt (2.3.0)
41
+ method_source (1.0.0)
42
+ mime-types (3.4.1)
43
+ mime-types-data (~> 3.2015)
44
+ mime-types-data (3.2021.1115)
45
+ minitest (5.14.4)
30
46
  multi_xml (0.6.0)
31
- parallel (1.12.1)
32
- parser (2.5.3.0)
33
- ast (~> 2.4.0)
34
- powerpack (0.1.2)
35
- pry (0.11.3)
36
- coderay (~> 1.1.0)
37
- method_source (~> 0.9.0)
38
- public_suffix (3.0.3)
47
+ parallel (1.20.1)
48
+ parser (3.0.2.0)
49
+ ast (~> 2.4.1)
50
+ pry (0.13.1)
51
+ coderay (~> 1.1)
52
+ method_source (~> 1.0)
53
+ pry-byebug (3.9.0)
54
+ byebug (~> 11.0)
55
+ pry (~> 0.13.0)
56
+ public_suffix (4.0.6)
57
+ rack (2.2.3)
39
58
  rainbow (3.0.0)
40
- rspec (3.8.0)
41
- rspec-core (~> 3.8.0)
42
- rspec-expectations (~> 3.8.0)
43
- rspec-mocks (~> 3.8.0)
44
- rspec-core (3.8.0)
45
- rspec-support (~> 3.8.0)
46
- rspec-expectations (3.8.2)
59
+ regexp_parser (2.1.1)
60
+ rexml (3.2.5)
61
+ rspec (3.10.0)
62
+ rspec-core (~> 3.10.0)
63
+ rspec-expectations (~> 3.10.0)
64
+ rspec-mocks (~> 3.10.0)
65
+ rspec-core (3.10.1)
66
+ rspec-support (~> 3.10.0)
67
+ rspec-expectations (3.10.1)
47
68
  diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.8.0)
49
- rspec-mocks (3.8.0)
69
+ rspec-support (~> 3.10.0)
70
+ rspec-mocks (3.10.2)
50
71
  diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.8.0)
52
- rspec-support (3.8.0)
72
+ rspec-support (~> 3.10.0)
73
+ rspec-support (3.10.2)
53
74
  rspec_junit_formatter (0.4.1)
54
75
  rspec-core (>= 2, < 4, != 2.12.0)
55
- rubocop (0.60.0)
56
- jaro_winkler (~> 1.5.1)
76
+ rubocop (1.18.3)
57
77
  parallel (~> 1.10)
58
- parser (>= 2.5, != 2.5.1.1)
59
- powerpack (~> 0.1)
78
+ parser (>= 3.0.0.0)
60
79
  rainbow (>= 2.2.2, < 4.0)
80
+ regexp_parser (>= 1.8, < 3.0)
81
+ rexml
82
+ rubocop-ast (>= 1.7.0, < 2.0)
61
83
  ruby-progressbar (~> 1.7)
62
- unicode-display_width (~> 1.4.0)
63
- rubocop-rspec (1.30.1)
64
- rubocop (>= 0.60.0)
65
- ruby-progressbar (1.10.0)
66
- safe_yaml (1.0.4)
84
+ unicode-display_width (>= 1.4.0, < 3.0)
85
+ rubocop-ast (1.8.0)
86
+ parser (>= 3.0.1.1)
87
+ rubocop-performance (1.11.4)
88
+ rubocop (>= 1.7.0, < 2.0)
89
+ rubocop-ast (>= 0.4.0)
90
+ rubocop-rails (2.11.3)
91
+ activesupport (>= 4.2.0)
92
+ rack (>= 1.1)
93
+ rubocop (>= 1.7.0, < 2.0)
94
+ rubocop-rspec (2.4.0)
95
+ rubocop (~> 1.0)
96
+ rubocop-ast (>= 1.1.0)
97
+ ruby-progressbar (1.11.0)
67
98
  simplecov (0.16.1)
68
99
  docile (~> 1.1)
69
100
  json (>= 1.8, < 3)
70
101
  simplecov-html (~> 0.10.0)
71
102
  simplecov-html (0.10.2)
72
- unicode-display_width (1.4.0)
73
- webmock (3.4.2)
103
+ tzinfo (2.0.4)
104
+ concurrent-ruby (~> 1.0)
105
+ unicode-display_width (2.0.0)
106
+ webmock (3.13.0)
74
107
  addressable (>= 2.3.6)
75
108
  crack (>= 0.3.2)
76
- hashdiff
109
+ hashdiff (>= 0.4.0, < 2.0.0)
110
+ zeitwerk (2.4.2)
77
111
 
78
112
  PLATFORMS
79
113
  ruby
80
114
 
81
115
  DEPENDENCIES
82
116
  hint-rubocop_style (~> 0)
83
- pry (~> 0)
117
+ pry-byebug
84
118
  rspec (~> 3.8)
85
119
  rspec_junit_formatter (~> 0.4.1)
86
120
  simplecov (~> 0.16.1)
@@ -88,4 +122,4 @@ DEPENDENCIES
88
122
  zoom_rb!
89
123
 
90
124
  BUNDLED WITH
91
- 1.17.1
125
+ 2.2.32
data/Makefile CHANGED
@@ -2,4 +2,4 @@ help:
2
2
  @echo "make console"
3
3
 
4
4
  console:
5
- irb -rubygems -I lib -r zoom.rb
5
+ irb -r rubygems -I lib -r zoom.rb
data/README.md CHANGED
@@ -18,20 +18,48 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- ```ruby
22
- require 'zoom'
21
+ The Zoom API uses OAuth or JWT to [Authenticate](https://marketplace.zoom.us/docs/api-reference/Authentication) API request. By default, a JWT client will be used.
23
22
 
23
+ ```ruby
24
24
  Zoom.configure do |c|
25
25
  c.api_key = 'xxx'
26
26
  c.api_secret = 'xxx'
27
27
  end
28
28
 
29
29
  zoom_client = Zoom.new
30
+ ```
31
+
32
+ To create an OAuth flow you need to make a call to auth, then create the client directly from an access token.
33
+
34
+ First you need to get an auth_code externally from:
35
+ ```
36
+ https://zoom.us/oauth/authorize?response_type=code&client_id=7lstjKqdwjett_kwjwDSEQ&redirect_uri=https://yourapp.com
37
+ ```
38
+
39
+ Which will result in a redirect to your app with code in the url params
30
40
 
41
+ then use this code to get an access token and a refresh token.
42
+
43
+ ```ruby
44
+ auth = Zoom::Client::OAuth.new(auth_code: auth_code, redirect_uri: redirect_uri, timeout: 15).auth
45
+
46
+ zoom_client = Zoom::Client::OAuth.new(access_token: auth['access_token'], timeout: 15)
47
+ ```
48
+
49
+ You can also make a call to refresh with auth using an auth_token and a refresh_token
50
+ ```ruby
51
+ client = Zoom::Client::OAuth.new(auth_token: auth_token, refresh_token: refresh_token).auth
52
+
53
+ zoom_client = Zoom::Client::OAuth.new(access_token: 'xxx', timeout: 15)
54
+ ```
55
+
56
+ With the zoom client, access the API
57
+
58
+ ```ruby
31
59
  user_list = zoom_client.user_list
32
60
  user_list['users'].each do |user|
33
61
  user_id = user['id']
34
- puts zoom_client.meeting_list(host_id: user_id)
62
+ puts zoom_client.meeting_list(user_id: user_id)
35
63
  end
36
64
 
37
65
  begin
@@ -3,91 +3,33 @@
3
3
  module Zoom
4
4
  module Actions
5
5
  module Account
6
- def account_list(*args)
7
- # TODO: implement accounts_list
8
- # options = Utils.extract_options!(args)
9
- raise Zoom::NotImplemented, 'accounts_list is not yet implemented'
10
- end
6
+ extend Zoom::Actions
11
7
 
12
- def account_create(*args)
13
- # TODO: implement accounts_create
14
- # options = Utils.extract_options!(args)
15
- raise Zoom::NotImplemented, 'accounts_create is not yet implemented'
16
- end
8
+ get 'account_list', '/accounts',
9
+ permit: %i[page_size page_number]
17
10
 
18
- def account_get(*args)
19
- # TODO: implement account_get
20
- # options = Utils.extract_options!(args)
21
- raise Zoom::NotImplemented, 'account_get is not yet implemented'
22
- end
11
+ post 'account_create', '/accounts',
12
+ require: %i[first_name last_name email password],
13
+ permit: { options: %i[share_rc room_connectors share_mc meeting_connectors pay_mode] }
23
14
 
24
- def account_delete(*args)
25
- # TODO: implement account_delete
26
- # options = Utils.extract_options!(args)
27
- raise Zoom::NotImplemented, 'account_delete is not yet implemented'
28
- end
15
+ get 'account_get', '/accounts/:account_id'
29
16
 
30
- def account_options_update(*args)
31
- # TODO: implement account_options_update
32
- # options = Utils.extract_options!(args)
33
- raise Zoom::NotImplemented, 'account_options_update is not yet implemented'
34
- end
17
+ delete 'account_delete', '/accounts/:account_id'
35
18
 
36
- def account_settings_get(*args)
37
- # TODO: implement account_settings_get
38
- # options = Utils.extract_options!(args)
39
- raise Zoom::NotImplemented, 'account_settings_get is not yet implemented'
40
- end
19
+ patch 'account_options_update', '/accounts/:account_id/options',
20
+ permit: %i[share_rc room_connectors share_mc meeting_connectors pay_mode]
41
21
 
42
- def account_settings_update(*args)
43
- # TODO: implement account_settings_update
44
- # options = Utils.extract_options!(args)
45
- raise Zoom::NotImplemented, 'account_settings_update is not yet implemented'
46
- end
22
+ get 'account_settings_get', '/accounts/:account_id/settings',
23
+ permit: :option
47
24
 
48
- # Billing related API Endpoints
25
+ patch 'account_settings_update', '/accounts/:account_id/settings',
26
+ permit: [:option, Zoom::Constants::Account::Settings::PERMITTED_KEYS]
49
27
 
50
- def account_billing_get(*args)
51
- # TODO: implement account_billing_get
52
- # options = Utils.extract_options!(args)
53
- raise Zoom::NotImplemented, 'account_billing_get is not yet implemented'
54
- end
28
+ get 'account_managed_domains', '/accounts/:account_id/managed_domains'
55
29
 
56
- def account_billing_update(*args)
57
- # TODO: implement account_billing_update
58
- # options = Utils.extract_options!(args)
59
- raise Zoom::NotImplemented, 'account_billing_update is not yet implemented'
60
- end
30
+ get 'account_get_locked_settings', '/accounts/:account_id/lock_settings'
61
31
 
62
- def account_plans_list(*args)
63
- # TODO: implement account_plans_list
64
- # options = Utils.extract_options!(args)
65
- raise Zoom::NotImplemented, 'account_plans_list is not yet implemented'
66
- end
67
-
68
- def some_method(*args)
69
- # TODO: implement some_method
70
- # options = Utils.extract_options!(args)
71
- raise Zoom::NotImplemented, 'some_method is not yet implemented'
72
- end
73
-
74
- def some_method(*args)
75
- # TODO: implement some_method
76
- # options = Utils.extract_options!(args)
77
- raise Zoom::NotImplemented, 'some_method is not yet implemented'
78
- end
79
-
80
- def some_method(*args)
81
- # TODO: implement some_method
82
- # options = Utils.extract_options!(args)
83
- raise Zoom::NotImplemented, 'some_method is not yet implemented'
84
- end
85
-
86
- def some_method(*args)
87
- # TODO: implement some_method
88
- # options = Utils.extract_options!(args)
89
- raise Zoom::NotImplemented, 'some_method is not yet implemented'
90
- end
32
+ get 'account_trusted_domains', '/accounts/:account_id/trusted_domains'
91
33
  end
92
34
  end
93
- end
35
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module Billing
6
+ extend Zoom::Actions
7
+
8
+ get 'billing_get', '/accounts/:account_id/billing'
9
+
10
+ patch 'billing_update', '/accounts/:account_id/billing',
11
+ permit: %i[first_name last_name email phone_number address apt city state zip country]
12
+
13
+ get 'billing_plans_list', '/accounts/:account_id/plans'
14
+
15
+ get 'billing_plans_usage', '/accounts/:account_id/plans/usage'
16
+
17
+ post 'billing_plans_subscribe', '/accounts/:account_id/plans',
18
+ require: {
19
+ contact: %i[first_name last_name email phone_number address city state zip country],
20
+ plan_base: %i[type hosts]
21
+ },
22
+ permit: [
23
+ :plan_recording,
24
+ {
25
+ contact: %i[apt],
26
+ plan_zoom_rooms: %i[type hosts],
27
+ plan_room_connector: %i[type hosts],
28
+ plan_large_meeting: %i[type hosts],
29
+ plan_zoom_events: %i[type hosts],
30
+ plan_webinar: %i[type hosts],
31
+ plan_audio: %i[type tollfree_countries premium_countries callout_countries ddi_numbers],
32
+ plan_phone: {
33
+ plan_base: %i[type callout_countries],
34
+ plan_calling: %i[type hosts],
35
+ plan_number: %i[type hosts]
36
+ }
37
+ }
38
+ ]
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module Dashboard
6
+ extend Zoom::Actions
7
+
8
+ get 'dashboard_crc', '/metrics/crc',
9
+ require: %i[from to]
10
+
11
+ get 'dashboard_meetings', '/metrics/meetings',
12
+ require: %i[from to],
13
+ permit: %i[next_page_token page_size type]
14
+
15
+ get 'dashboard_meeting_details', '/metrics/meetings/:meeting_id',
16
+ permit: :type
17
+
18
+ get 'dashboard_meeting_participants', '/metrics/meetings/:meeting_id/participants',
19
+ permit: %i[next_page_token page_size type]
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Zoom
4
+ module Actions
5
+ module Groups
6
+ extend Zoom::Actions
7
+
8
+ get 'groups_list', '/groups'
9
+
10
+ get 'groups_get', '/groups/:group_id'
11
+
12
+ post 'group_create', '/groups',
13
+ permit: :name
14
+
15
+ patch 'group_update', '/groups/:group_id',
16
+ permit: :name
17
+ end
18
+ end
19
+ end
@@ -4,23 +4,22 @@ module Zoom
4
4
  module Actions
5
5
  module IM
6
6
  module Chat
7
+ extend Zoom::Actions
8
+
9
+ get 'get_chat_channels', '/chat/channels/:channel_id'
10
+
11
+ get 'get_chat_user_channels', '/chat/users/:user_id/channels',
12
+ permit: %i[next_page_token page_size]
13
+
7
14
  # Get chat messages for a specified period.
8
- def chat_get(*args)
9
- options = Utils.extract_options!(args)
10
- Utils.require_params(%i[access_token session_id from to], options)
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
+ # TODO: implement `next_page_token`, will be returned whenever the set of available chat history list exceeds 100. The expiration period is 30 minutes.
16
+ get 'chat_get', '/chat/get',
17
+ require: [ :access_token, :session_id, :from, :to ]
15
18
 
16
19
  # Get chat history list for a specified time period.
17
- def chat_list(*args)
18
- options = Utils.extract_options!(args)
19
- Utils.require_params(%i[access_token from to], options)
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
20
+ # TODO: implement `next_page_token`, will be returned whenever the set of available chat history list exceeds 100. The expiration period is 30 minutes.
21
+ get 'chat_list', '/chat/list',
22
+ require: [ :access_token, :from, :to ]
24
23
  end
25
24
  end
26
25
  end