Class: BingAdsRubySdk::Header
- Inherits:
-
Object
- Object
- BingAdsRubySdk::Header
- Defined in:
- lib/bing_ads_ruby_sdk/header.rb
Overview
Contains the SOAP Request header informations
Instance Method Summary collapse
-
#content ⇒ Hash
Authorization and identification data that will be added to the SOAP header.
-
#initialize(developer_token:, client_id:, store:) ⇒ Header
constructor
A new instance of Header.
- #set_customer(account_id:, customer_id:) ⇒ Object
Constructor Details
#initialize(developer_token:, client_id:, store:) ⇒ Header
Returns a new instance of Header.
9 10 11 12 13 14 |
# File 'lib/bing_ads_ruby_sdk/header.rb', line 9 def initialize(developer_token:, client_id:, store:) @developer_token = developer_token @client_id = client_id @oauth_store = store @customer = {} end |
Instance Method Details
#content ⇒ Hash
Returns Authorization and identification data that will be added to the SOAP header.
17 18 19 20 21 22 23 24 |
# File 'lib/bing_ads_ruby_sdk/header.rb', line 17 def content { "AuthenticationToken" => auth_handler.fetch_or_refresh, "DeveloperToken" => developer_token, "CustomerId" => customer[:customer_id], "CustomerAccountId" => customer[:account_id] } end |
#set_customer(account_id:, customer_id:) ⇒ Object
26 27 28 29 30 |
# File 'lib/bing_ads_ruby_sdk/header.rb', line 26 def set_customer(account_id:, customer_id:) customer[:account_id] = account_id customer[:customer_id] = customer_id self end |