lib/twilio-ruby/rest/base_client.rb in twilio-ruby-4.10.0 vs lib/twilio-ruby/rest/base_client.rb in twilio-ruby-4.11.0

- old
+ new

@@ -24,12 +24,13 @@ def initialize(*args) options = args.last.is_a?(Hash) ? args.pop : {} options[:host] ||= self.class.host @config = Twilio::Util::ClientConfig.new options - @account_sid = args[0] || Twilio.account_sid + @username = args[0] || Twilio.account_sid @auth_token = args[1] || Twilio.auth_token + @account_sid = (args.size > 2 && args[2].is_a?(String) ? args[2] : args[0]) || Twilio.account_sid if @account_sid.nil? || @auth_token.nil? raise ArgumentError, 'Account SID and auth token are required' end set_up_connection @@ -47,10 +48,10 @@ params = twilify(args[0]) params = {} if params.empty? # build the full path unless already given path = build_full_path(path, params, method) unless args[1] request = method_class.new(path, HTTP_HEADERS) - request.basic_auth(@account_sid, @auth_token) + request.basic_auth(@username, @auth_token) request.form_data = params if [:post, :put].include?(method) connect_and_send(request) end end