Method: PureCloud::ApiClient#update_params_for_auth!

Defined in:
lib/purecloud/api_client.rb

#update_params_for_auth!(header_params, query_params, auth_names) ⇒ Object

Update hearder and query params based on authentication settings.



255
256
257
258
259
260
261
262
263
264
265
# File 'lib/purecloud/api_client.rb', line 255

def update_params_for_auth!(header_params, query_params, auth_names)
  Array(auth_names).each do |auth_name|
    auth_setting = @config.auth_settings[auth_name]
    next unless auth_setting
    case auth_setting[:in]
    when 'header' then header_params[auth_setting[:key]] = auth_setting[:value]
    when 'query'  then query_params[auth_setting[:key]] = auth_setting[:value]
    else fail ArgumentError, 'Authentication token must be in `query` of `header`'
    end
  end
end