Class: Bing::Ads::API::V11::Services::CustomerManagement

Inherits:
Base
  • Object
show all
Defined in:
lib/bing/ads/api/v11/services/customer_management.rb

Overview

Bing::Ads::API::V11::Services::CustomerManagement

Instance Attribute Summary

Attributes inherited from Base

#environment, #retry_attempts, #soap_client

Instance Method Summary collapse

Methods inherited from Base

#call, #response_body

Constructor Details

#initialize(options = {}) ⇒ CustomerManagement



8
9
10
# File 'lib/bing/ads/api/v11/services/customer_management.rb', line 8

def initialize(options = {})
  super(options)
end

Instance Method Details

#get_accounts_info(customer_id = @customer_id, only_parent_accounts = false) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/bing/ads/api/v11/services/customer_management.rb', line 12

def get_accounts_info(customer_id = @customer_id, only_parent_accounts = false)
  payload = {
    customer_id: customer_id,
    only_parent_accounts: (only_parent_accounts == true).to_s
  }
  response = call(:get_accounts_info, payload.compact)
  response_body = response_body(response, __method__)
  response_body[:accounts_info][:account_info]
end