lib/zoom/client.rb in zoom_rb-0.9.1 vs lib/zoom/client.rb in zoom_rb-0.10.0

- old
+ new

@@ -1,10 +1,8 @@ # frozen_string_literal: true require 'httparty' -require 'json' -require 'jwt' module Zoom class Client include HTTParty include Actions::Account @@ -21,24 +19,17 @@ base_uri 'https://api.zoom.us/v2' headers 'Accept' => 'application/json' headers 'Content-Type' => 'application/json' - def initialize(config) - Utils.require_params(%i[api_key api_secret], config) - config.each { |k, v| instance_variable_set("@#{k}", v) } - self.class.default_timeout(@timeout) - end - def request_headers { 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'Authorization' => "Bearer #{access_token}" } end - - def access_token - JWT.encode({ iss: @api_key, exp: Time.now.to_i + @timeout }, @api_secret, 'HS256', { typ: 'JWT' }) - end end end + +require 'zoom/clients/jwt' +require 'zoom/clients/oauth'