Class: Zoom::Client::ServerToServerOAuth
- Inherits:
-
Zoom::Client
- Object
- Zoom::Client
- Zoom::Client::ServerToServerOAuth
- Defined in:
- lib/zoom/clients/server_to_server_oauth.rb
Constant Summary
Constants included from Actions::Webinar
Actions::Webinar::RECURRENCE_KEYS, Actions::Webinar::SETTINGS_KEYS
Constants included from Actions::Recording
Actions::Recording::RECORDING_SETTINGS_KEYS
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#expires_in ⇒ Object
readonly
Returns the value of attribute expires_in.
Instance Method Summary collapse
- #auth ⇒ Object
- #auth_token ⇒ Object
-
#initialize(config) ⇒ ServerToServerOAuth
constructor
A new instance of ServerToServerOAuth.
Methods inherited from Zoom::Client
#bearer_authorization_header, #headers, #oauth_request_headers, #request_headers
Methods included from Actions
determine_request_options, extract_path_keys, make_request, parse_path
Constructor Details
#initialize(config) ⇒ ServerToServerOAuth
Returns a new instance of ServerToServerOAuth.
8 9 10 11 12 13 14 |
# File 'lib/zoom/clients/server_to_server_oauth.rb', line 8 def initialize(config) Zoom::Params.new(config).permit(i[access_token account_id client_id client_secret timeout]) Zoom::Params.new(config).require_one_of(i[access_token account_id]) config.each { |k, v| instance_variable_set("@#{k}", v) } self.class.default_timeout(@timeout || 20) end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
6 7 8 |
# File 'lib/zoom/clients/server_to_server_oauth.rb', line 6 def access_token @access_token end |
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
6 7 8 |
# File 'lib/zoom/clients/server_to_server_oauth.rb', line 6 def expires_at @expires_at end |
#expires_in ⇒ Object (readonly)
Returns the value of attribute expires_in.
6 7 8 |
# File 'lib/zoom/clients/server_to_server_oauth.rb', line 6 def expires_in @expires_in end |
Instance Method Details
#auth ⇒ Object
16 17 18 19 20 |
# File 'lib/zoom/clients/server_to_server_oauth.rb', line 16 def auth response = access_tokens_account_credentials(account_id: @account_id) set_tokens(response) response end |
#auth_token ⇒ Object
22 23 24 25 26 |
# File 'lib/zoom/clients/server_to_server_oauth.rb', line 22 def auth_token return Base64.urlsafe_encode64("#{@client_id}:#{@client_secret}") if @client_id && @client_secret Base64.urlsafe_encode64("#{Zoom.configuration.api_key}:#{Zoom.configuration.api_secret}") end |