Class: Bing::Ads::API::SOAPClient
- Inherits:
-
Object
- Object
- Bing::Ads::API::SOAPClient
- Defined in:
- lib/bing/ads/api/soap_client.rb
Overview
Bing::Ads::API::SOAPClient
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#authentication_token ⇒ Object
Returns the value of attribute authentication_token.
-
#client_settings ⇒ Object
Returns the value of attribute client_settings.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#developer_token ⇒ Object
Returns the value of attribute developer_token.
-
#namespace_identifier ⇒ Object
Returns the value of attribute namespace_identifier.
-
#password ⇒ Object
Returns the value of attribute password.
-
#savon_client ⇒ Object
Returns the value of attribute savon_client.
-
#username ⇒ Object
Returns the value of attribute username.
-
#wsdl_url ⇒ Object
Returns the value of attribute wsdl_url.
Instance Method Summary collapse
- #call(operation:, payload: {}) ⇒ Object
- #client(settings) ⇒ Object
-
#initialize(options) ⇒ SOAPClient
constructor
A new instance of SOAPClient.
Constructor Details
#initialize(options) ⇒ SOAPClient
Returns a new instance of SOAPClient.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bing/ads/api/soap_client.rb', line 10 def initialize() @customer_id = [:customer_id] @account_id = [:account_id] @developer_token = [:developer_token] @wsdl_url = [:wsdl_url] @namespace_identifier = [:namespace_identifier] @authentication_token = [:authentication_token] @username = [:username] @password = [:password] @client_settings = [:client_settings] @log_level = [:log_level] || :error end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
6 7 8 |
# File 'lib/bing/ads/api/soap_client.rb', line 6 def account_id @account_id end |
#authentication_token ⇒ Object
Returns the value of attribute authentication_token.
7 8 9 |
# File 'lib/bing/ads/api/soap_client.rb', line 7 def authentication_token @authentication_token end |
#client_settings ⇒ Object
Returns the value of attribute client_settings.
6 7 8 |
# File 'lib/bing/ads/api/soap_client.rb', line 6 def client_settings @client_settings end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
6 7 8 |
# File 'lib/bing/ads/api/soap_client.rb', line 6 def customer_id @customer_id end |
#developer_token ⇒ Object
Returns the value of attribute developer_token.
6 7 8 |
# File 'lib/bing/ads/api/soap_client.rb', line 6 def developer_token @developer_token end |
#namespace_identifier ⇒ Object
Returns the value of attribute namespace_identifier.
7 8 9 |
# File 'lib/bing/ads/api/soap_client.rb', line 7 def namespace_identifier @namespace_identifier end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/bing/ads/api/soap_client.rb', line 7 def password @password end |
#savon_client ⇒ Object
Returns the value of attribute savon_client.
8 9 10 |
# File 'lib/bing/ads/api/soap_client.rb', line 8 def savon_client @savon_client end |
#username ⇒ Object
Returns the value of attribute username.
7 8 9 |
# File 'lib/bing/ads/api/soap_client.rb', line 7 def username @username end |
#wsdl_url ⇒ Object
Returns the value of attribute wsdl_url.
6 7 8 |
# File 'lib/bing/ads/api/soap_client.rb', line 6 def wsdl_url @wsdl_url end |
Instance Method Details
#call(operation:, payload: {}) ⇒ Object
23 24 25 |
# File 'lib/bing/ads/api/soap_client.rb', line 23 def call(operation:, payload: {}) client(client_settings).call(operation, message: payload) end |
#client(settings) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/bing/ads/api/soap_client.rb', line 27 def client(settings) return savon_client if savon_client settings = { convert_request_keys_to: :camelcase, wsdl: wsdl_url, namespace_identifier: namespace_identifier, soap_header: soap_header, log: true, log_level: @log_level, pretty_print_xml: true } settings.merge!(client_settings) if client_settings @savon_client = Savon.client(settings) end |