Module: ConnectStoopid
- Defined in:
- lib/connect-stoopid/company.rb,
lib/connect-stoopid.rb,
lib/connect-stoopid/time-entry.rb,
lib/connect-stoopid/reporting-client.rb
Overview
ConnectStoopid::ReportingClient Provides an interface to the ConnectWise Reporting API
Defined Under Namespace
Classes: Company, ReportingClient, TimeEntry
Constant Summary collapse
- VERSION =
"0.1.4"
Class Attribute Summary collapse
-
.soap_client ⇒ Object
Returns the value of attribute soap_client.
-
.wsdl ⇒ Object
Returns the value of attribute wsdl.
Class Method Summary collapse
- .base_soap_hash ⇒ Object
-
.connect(company, username, password, options = {}) ⇒ Object
Parameters: psa_address – The hostname of your ConnectWise PSA, ie.
- .log_client_message(message, level = :error) ⇒ Object
Class Attribute Details
.soap_client ⇒ Object
Returns the value of attribute soap_client.
12 13 14 |
# File 'lib/connect-stoopid.rb', line 12 def soap_client @soap_client end |
.wsdl ⇒ Object
Returns the value of attribute wsdl.
11 12 13 |
# File 'lib/connect-stoopid.rb', line 11 def wsdl @wsdl end |
Class Method Details
.base_soap_hash ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/connect-stoopid.rb', line 54 def base_soap_hash = { "credentials" => { "CompanyId" => @company, "IntegratorLoginId" => @username, "IntegratorPassword" => @password } } return end |
.connect(company, username, password, options = {}) ⇒ Object
Parameters: psa_address – The hostname of your ConnectWise PSA, ie. con.companyconnect.net company – Company id used when logging into ConnectWise username – ConnectWise Integration username password – ConnectWise Integration password options – Override the default ReportingClient options
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/connect-stoopid.rb', line 24 def connect(company, username, password, = {}) @company = company @username = username @password = password @client_options = { :client_logging => true, :client_logging_level => :error, :soap_version => 2, :soap_logging => false, :soap_logging_level => :fatal } @client_options.merge!() @soap_client = Savon.client({ :wsdl => @wsdl, :soap_version => @client_options[:soap_version], :log => @client_options[:soap_logging], :log_level => @client_options[:soap_logging_level] }) end |
.log_client_message(message, level = :error) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/connect-stoopid.rb', line 46 def (, level = :error) if logging if LOG_LEVELS[level] >= LOG_LEVELS[@client_options[:client_logging_level]] puts "#{self.class.to_s.split("::").last} Logger -- #{}" end end end |