Skip to content
Open

2.0.0 #458

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require: rubocop-rspec
parallel: true

ignore:
- 'test/**/*':
- Layout/AlignHash
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'
source "https://rubygems.org"

gemspec
39 changes: 11 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,45 +1,30 @@
PATH
remote: .
specs:
zoom_rb (1.1.8)
zoom_rb (2.0.0)
httparty (>= 0.13)
json (>= 1.8)
jwt

GEM
remote: https://rubygems.org/
specs:
activesupport (7.0.4.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.2.2)
crack (0.4.5)
rexml
diff-lcs (1.5.0)
docile (1.4.0)
hashdiff (1.0.1)
hint-rubocop_style (0.3.6)
rubocop (>= 0.78.0)
rubocop-performance (>= 1.3.0)
rubocop-rails (>= 2.0.0)
rubocop-rspec (>= 1.33.0)
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
json (2.6.3)
jwt (2.7.0)
language_server-protocol (3.17.0.3)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.18.0)
multi_xml (0.6.0)
parallel (1.22.1)
parser (3.2.2.0)
Expand All @@ -51,7 +36,6 @@ GEM
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
public_suffix (5.0.1)
rack (3.0.7)
rainbow (3.1.1)
regexp_parser (2.7.0)
rexml (3.2.5)
Expand All @@ -70,27 +54,23 @@ GEM
rspec-support (3.12.0)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.49.0)
rubocop (1.48.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.2.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.26.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.17.1)
rubocop (~> 1.41)
rubocop-performance (1.17.1)
rubocop-performance (1.16.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.19.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-rspec (2.19.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
Expand All @@ -102,8 +82,10 @@ GEM
simplecov-html (0.12.3)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
standard (1.26.0)
language_server-protocol (~> 3.17.0.2)
rubocop (~> 1.48.1)
rubocop-performance (~> 1.16.0)
unicode-display_width (2.4.2)
webmock (3.18.1)
addressable (>= 2.8.0)
Expand All @@ -114,12 +96,13 @@ PLATFORMS
ruby

DEPENDENCIES
hint-rubocop_style
pry-byebug
rspec (>= 3.8)
rspec_junit_formatter (>= 0.4.1)
rubocop-rspec (>= 2.19.0)
simplecov (>= 0.22.0)
simplecov-lcov (>= 0.8.0)
standard (>= 1.25.0)
webmock (>= 3.4)
zoom_rb!

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ Or install it yourself as:

## Usage

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.
The Zoom API uses OAuth 2.0 to [Authenticate](https://developers.zoom.us/docs/api/rest/using-zoom-apis/#authentication) API request. By default, a `ServerToServerOAuth` client will be used.

```ruby
Zoom.configure do |c|
c.api_key = 'xxx'
c.api_secret = 'xxx'
c.account_id = 'xxx'
c.client_id = 'xxx'
c.client_secret = 'xxx'
end

zoom_client = Zoom.new
```

To create an OAuth flow you need to make a call to auth, then create the client directly from an access token.
To create a non-ServerToServer OAuth flow, you need to make a call to auth, then create the client directly from an access token.

First you need to get an auth_code externally from:
```
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require "bundler/gem_tasks"
require "bundler/gem_tasks"
14 changes: 7 additions & 7 deletions lib/zoom/actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
module Zoom
module Actions
def self.extract_path_keys(path)
path.scan(/:\w+/).map { |match| match[1..-1].to_sym }
path.scan(/:\w+/).map { |match| match[1..].to_sym }
end

def self.parse_path(path, path_keys, params)
parsed_path = path.dup
path_keys.each do |key|
value = params[key].to_s
parsed_path = parsed_path.sub(":#{key}", value)
value = params[key].to_s
parsed_path = parsed_path.sub(":#{key}", value)
end
parsed_path
end
Expand All @@ -19,10 +19,10 @@ def self.determine_request_options(client, oauth)
if oauth
{
headers: client.oauth_request_headers,
base_uri: 'https://zoom.us/'
base_uri: "https://zoom.us/"
}
else
{ headers: client.request_headers }
{headers: client.request_headers}
end
end

Expand All @@ -40,8 +40,8 @@ def self.make_request(args)
end

[:get, :post, :patch, :put, :delete].each do |method|
define_method(method) do |name, path, options={}|
required, permitted, oauth, args_to_params, headers =
define_method(method) do |name, path, options = {}|
required, permitted, oauth, args_to_params, _headers =
options.values_at :require, :permit, :oauth, :args_to_params, :headers
required = Array(required) unless required.is_a?(Hash)
permitted = Array(permitted) unless permitted.is_a?(Hash)
Expand Down
22 changes: 11 additions & 11 deletions lib/zoom/actions/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ module Actions
module Account
extend Zoom::Actions

get 'account_list', '/accounts',
get "account_list", "/accounts",
permit: %i[page_size page_number]

post 'account_create', '/accounts',
post "account_create", "/accounts",
require: %i[first_name last_name email password],
permit: { options: %i[share_rc room_connectors share_mc meeting_connectors pay_mode] }
permit: {options: %i[share_rc room_connectors share_mc meeting_connectors pay_mode]}

get 'account_get', '/accounts/:account_id'
get "account_get", "/accounts/:account_id"

delete 'account_delete', '/accounts/:account_id'
delete "account_delete", "/accounts/:account_id"

patch 'account_options_update', '/accounts/:account_id/options',
patch "account_options_update", "/accounts/:account_id/options",
permit: %i[share_rc room_connectors share_mc meeting_connectors pay_mode]

get 'account_settings_get', '/accounts/:account_id/settings',
get "account_settings_get", "/accounts/:account_id/settings",
permit: :option

patch 'account_settings_update', '/accounts/:account_id/settings',
patch "account_settings_update", "/accounts/:account_id/settings",
permit: [:option, Zoom::Constants::Account::Settings::PERMITTED_KEYS]

get 'account_managed_domains', '/accounts/:account_id/managed_domains'
get "account_managed_domains", "/accounts/:account_id/managed_domains"

get 'account_get_locked_settings', '/accounts/:account_id/lock_settings'
get "account_get_locked_settings", "/accounts/:account_id/lock_settings"

get 'account_trusted_domains', '/accounts/:account_id/trusted_domains'
get "account_trusted_domains", "/accounts/:account_id/trusted_domains"
end
end
end
12 changes: 6 additions & 6 deletions lib/zoom/actions/billing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ module Actions
module Billing
extend Zoom::Actions

get 'billing_get', '/accounts/:account_id/billing'
get "billing_get", "/accounts/:account_id/billing"

patch 'billing_update', '/accounts/:account_id/billing',
permit: %i[first_name last_name email phone_number address apt city state zip country]
patch "billing_update", "/accounts/:account_id/billing",
permit: %i[first_name last_name email phone_number address apt city state zip country]

get 'billing_plans_list', '/accounts/:account_id/plans'
get "billing_plans_list", "/accounts/:account_id/plans"

get 'billing_plans_usage', '/accounts/:account_id/plans/usage'
get "billing_plans_usage", "/accounts/:account_id/plans/usage"

post 'billing_plans_subscribe', '/accounts/:account_id/plans',
post "billing_plans_subscribe", "/accounts/:account_id/plans",
require: {
contact: %i[first_name last_name email phone_number address city state zip country],
plan_base: %i[type hosts]
Expand Down
8 changes: 4 additions & 4 deletions lib/zoom/actions/dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ module Actions
module Dashboard
extend Zoom::Actions

get 'dashboard_crc', '/metrics/crc',
get "dashboard_crc", "/metrics/crc",
require: %i[from to]

get 'dashboard_meetings', '/metrics/meetings',
get "dashboard_meetings", "/metrics/meetings",
require: %i[from to],
permit: %i[next_page_token page_size type]

get 'dashboard_meeting_details', '/metrics/meetings/:meeting_id',
get "dashboard_meeting_details", "/metrics/meetings/:meeting_id",
permit: :type

get 'dashboard_meeting_participants', '/metrics/meetings/:meeting_id/participants',
get "dashboard_meeting_participants", "/metrics/meetings/:meeting_id/participants",
permit: %i[next_page_token page_size type]
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/zoom/actions/groups.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ module Actions
module Groups
extend Zoom::Actions

get 'groups_list', '/groups'
get "groups_list", "/groups"

get 'groups_get', '/groups/:group_id'
get "groups_get", "/groups/:group_id"

post 'group_create', '/groups',
post "group_create", "/groups",
permit: :name

patch 'group_update', '/groups/:group_id',
patch "group_update", "/groups/:group_id",
permit: :name
end
end
Expand Down
12 changes: 6 additions & 6 deletions lib/zoom/actions/im/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ module IM
module Chat
extend Zoom::Actions

get 'get_chat_channels', '/chat/channels/:channel_id'
get "get_chat_channels", "/chat/channels/:channel_id"

get 'get_chat_user_channels', '/chat/users/:user_id/channels',
get "get_chat_user_channels", "/chat/users/:user_id/channels",
permit: %i[next_page_token page_size]

# Get chat messages for a specified period.
# TODO: implement `next_page_token`, will be returned whenever the set of available chat history list exceeds 100. The expiration period is 30 minutes.
get 'chat_get', '/chat/get',
require: [ :access_token, :session_id, :from, :to ]
get "chat_get", "/chat/get",
require: [:access_token, :session_id, :from, :to]

# Get chat history list for a specified time period.
# TODO: implement `next_page_token`, will be returned whenever the set of available chat history list exceeds 100. The expiration period is 30 minutes.
get 'chat_list', '/chat/list',
require: [ :access_token, :from, :to ]
get "chat_list", "/chat/list",
require: [:access_token, :from, :to]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/zoom/actions/im/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ module Group
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/zoom/actions/m323_device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module Actions
module M323Device
end
end
end
end
Loading