lib/bandwidth/configuration.rb in bandwidth-sdk-3.6.0 vs lib/bandwidth/configuration.rb in bandwidth-sdk-3.7.0
- old
+ new
@@ -15,11 +15,12 @@
class Server
SERVER = [
DEFAULT = 'default'.freeze,
MESSAGINGDEFAULT = 'MessagingDefault'.freeze,
TWOFACTORAUTHDEFAULT = 'TwoFactorAuthDefault'.freeze,
- VOICEDEFAULT = 'VoiceDefault'.freeze
+ VOICEDEFAULT = 'VoiceDefault'.freeze,
+ WEBRTCDEFAULT = 'WebRtcDefault'.freeze
].freeze
end
# All configuration including auth info and base URI for the API access
# are configured in this class.
@@ -35,10 +36,12 @@
attr_reader :messaging_basic_auth_password
attr_reader :two_factor_auth_basic_auth_user_name
attr_reader :two_factor_auth_basic_auth_password
attr_reader :voice_basic_auth_user_name
attr_reader :voice_basic_auth_password
+ attr_reader :web_rtc_basic_auth_user_name
+ attr_reader :web_rtc_basic_auth_password
class << self
attr_reader :environments
end
@@ -47,11 +50,13 @@
messaging_basic_auth_user_name: 'TODO: Replace',
messaging_basic_auth_password: 'TODO: Replace',
two_factor_auth_basic_auth_user_name: 'TODO: Replace',
two_factor_auth_basic_auth_password: 'TODO: Replace',
voice_basic_auth_user_name: 'TODO: Replace',
- voice_basic_auth_password: 'TODO: Replace')
+ voice_basic_auth_password: 'TODO: Replace',
+ web_rtc_basic_auth_user_name: 'TODO: Replace',
+ web_rtc_basic_auth_password: 'TODO: Replace')
# The value to use for connection timeout
@timeout = timeout
# The number of times to retry an endpoint call if it fails
@max_retries = max_retries
@@ -82,10 +87,16 @@
@voice_basic_auth_user_name = voice_basic_auth_user_name
# The password to use with basic authentication
@voice_basic_auth_password = voice_basic_auth_password
+ # The username to use with basic authentication
+ @web_rtc_basic_auth_user_name = web_rtc_basic_auth_user_name
+
+ # The password to use with basic authentication
+ @web_rtc_basic_auth_password = web_rtc_basic_auth_password
+
# The Http Client to use for making requests.
@http_client = create_http_client
end
def clone_with(timeout: nil, max_retries: nil, retry_interval: nil,
@@ -93,11 +104,13 @@
messaging_basic_auth_user_name: nil,
messaging_basic_auth_password: nil,
two_factor_auth_basic_auth_user_name: nil,
two_factor_auth_basic_auth_password: nil,
voice_basic_auth_user_name: nil,
- voice_basic_auth_password: nil)
+ voice_basic_auth_password: nil,
+ web_rtc_basic_auth_user_name: nil,
+ web_rtc_basic_auth_password: nil)
timeout ||= self.timeout
max_retries ||= self.max_retries
retry_interval ||= self.retry_interval
backoff_factor ||= self.backoff_factor
environment ||= self.environment
@@ -105,21 +118,25 @@
messaging_basic_auth_password ||= self.messaging_basic_auth_password
two_factor_auth_basic_auth_user_name ||= self.two_factor_auth_basic_auth_user_name
two_factor_auth_basic_auth_password ||= self.two_factor_auth_basic_auth_password
voice_basic_auth_user_name ||= self.voice_basic_auth_user_name
voice_basic_auth_password ||= self.voice_basic_auth_password
+ web_rtc_basic_auth_user_name ||= self.web_rtc_basic_auth_user_name
+ web_rtc_basic_auth_password ||= self.web_rtc_basic_auth_password
Configuration.new(
timeout: timeout, max_retries: max_retries,
retry_interval: retry_interval, backoff_factor: backoff_factor,
environment: environment,
messaging_basic_auth_user_name: messaging_basic_auth_user_name,
messaging_basic_auth_password: messaging_basic_auth_password,
two_factor_auth_basic_auth_user_name: two_factor_auth_basic_auth_user_name,
two_factor_auth_basic_auth_password: two_factor_auth_basic_auth_password,
voice_basic_auth_user_name: voice_basic_auth_user_name,
- voice_basic_auth_password: voice_basic_auth_password
+ voice_basic_auth_password: voice_basic_auth_password,
+ web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name,
+ web_rtc_basic_auth_password: web_rtc_basic_auth_password
)
end
def create_http_client
FaradayClient.new(timeout: timeout, max_retries: max_retries,
@@ -131,10 +148,11 @@
ENVIRONMENTS = {
Environment::PRODUCTION => {
Server::DEFAULT => 'api.bandwidth.com',
Server::MESSAGINGDEFAULT => 'https://messaging.bandwidth.com/api/v2',
Server::TWOFACTORAUTHDEFAULT => 'https://mfa.bandwidth.com/api/v1/',
- Server::VOICEDEFAULT => 'https://voice.bandwidth.com'
+ Server::VOICEDEFAULT => 'https://voice.bandwidth.com',
+ Server::WEBRTCDEFAULT => 'https://api.webrtc.bandwidth.com/v1'
}
}.freeze
# Generates the appropriate base URI for the environment and the server.
# @param [Configuration::Server] The server enum for which the base URI is