Method: Bandwidth::Client#initialize

Defined in:
lib/bandwidth/client.rb

#initialize(timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 1, environment: Environment::PRODUCTION, base_url: 'https://www.example.com', 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', web_rtc_basic_auth_user_name: 'TODO: Replace', web_rtc_basic_auth_password: 'TODO: Replace', config: nil) ⇒ Client

Returns a new instance of Client.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/bandwidth/client.rb', line 31

def initialize(timeout: 60, max_retries: 0, retry_interval: 1,
               backoff_factor: 1, environment: Environment::PRODUCTION,
               base_url: 'https://www.example.com',
               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',
               web_rtc_basic_auth_user_name: 'TODO: Replace',
               web_rtc_basic_auth_password: 'TODO: Replace', config: nil)
  @config = if config.nil?
              Configuration.new(timeout: timeout, max_retries: max_retries,
                                retry_interval: retry_interval,
                                backoff_factor: backoff_factor,
                                environment: environment,
                                base_url: base_url,
                                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,
                                web_rtc_basic_auth_user_name: web_rtc_basic_auth_user_name,
                                web_rtc_basic_auth_password: web_rtc_basic_auth_password)
            else
              config
            end
end