class BingAdsRubySdk::Api

Attributes

header[R]

Public Class Methods

new(version: DEFAULT_SDK_VERSION, environment: :production, developer_token:, client_id:, oauth_store:, client_secret: nil) click to toggle source

@param version [Symbol] API version, used to choose WSDL configuration version @param environment [Symbol] @option environment [Symbol] :production Use the production WSDL configuration @option environment [Symbol] :sandbox Use the sandbox WSDL configuration @param developer_token @param client_id

# File lib/bing_ads_ruby_sdk/api.rb, line 26
def initialize(version: DEFAULT_SDK_VERSION,
               environment: :production,
               developer_token:,
               client_id:,
               oauth_store:,
               client_secret: nil)
  @version = version
  @environment = environment
  @header = Header.new(
    developer_token: developer_token,
    client_id: client_id,
    client_secret: client_secret,
    store: oauth_store
  )
end

Public Instance Methods

ad_insight() click to toggle source
# File lib/bing_ads_ruby_sdk/api.rb, line 42
def ad_insight
  build_service(BingAdsRubySdk::Services::AdInsight)
end
bulk() click to toggle source
# File lib/bing_ads_ruby_sdk/api.rb, line 46
def bulk
  build_service(BingAdsRubySdk::Services::Bulk)
end
campaign_management() click to toggle source
# File lib/bing_ads_ruby_sdk/api.rb, line 50
def campaign_management
  build_service(BingAdsRubySdk::Services::CampaignManagement)
end
customer_billing() click to toggle source
# File lib/bing_ads_ruby_sdk/api.rb, line 54
def customer_billing
  build_service(BingAdsRubySdk::Services::CustomerBilling)
end
customer_management() click to toggle source
# File lib/bing_ads_ruby_sdk/api.rb, line 58
def customer_management
  build_service(BingAdsRubySdk::Services::CustomerManagement)
end
reporting() click to toggle source
# File lib/bing_ads_ruby_sdk/api.rb, line 62
def reporting
  build_service(BingAdsRubySdk::Services::Reporting)
end
set_customer(account_id:, customer_id:) click to toggle source
# File lib/bing_ads_ruby_sdk/api.rb, line 66
def set_customer(account_id:, customer_id:)
  header.set_customer(account_id: account_id, customer_id: customer_id)
end

Private Instance Methods

build_service(klass) click to toggle source
# File lib/bing_ads_ruby_sdk/api.rb, line 72
def build_service(klass)
  klass.new(
    BingAdsRubySdk::SoapClient.new(
      version: @version,
      environment: @environment,
      header: header,
      service_name: klass.service
    )
  )
end