Class: AdCenterClient

Inherits:
Object
  • Object
show all
Includes:
SOAP::RPC
Defined in:
lib/adcenter_client.rb

Constant Summary collapse

VERSION =
'8.0.0'
ENDPOINTS_PRODUCTION =

endpoints to be used in production

{
  :ad_intelligence_service => 'https://adcenterapi.microsoft.com/Api/Advertiser/v8/CampaignManagement/AdIntelligenceService.svc?wsdl',
  :administration_service => 'https://adcenterapi.microsoft.com/Api/Advertiser/v8/Administration/AdministrationService.svc?wsdl',
  :campaign_management_service => 'https://adcenterapi.microsoft.com/Api/Advertiser/v8/CampaignManagement/CampaignManagementService.svc?wsdl',
  :customer_billing_service => 'https://sharedservices.adcenterapi.microsoft.com/Api/Billing/v8/CustomerBillingService.svc?wsdl',
  :customer_management_service => 'https://sharedservices.adcenterapi.microsoft.com/Api/CustomerManagement/v8/CustomerManagementService.svc?wsdl',
  :notification_service => 'https://sharedservices.adcenterapi.microsoft.com/Api/Notification/v8/NotificationService.svc?wsdl',
  :optimizer_service => 'https://adcenterapi.microsoft.com/Api/Advertiser/v8/Optimizer/OptimizerService.svc?wsdl',
  :reporting_service => 'https://adcenterapi.microsoft.com/Api/Advertiser/v8/Reporting/ReportingService.svc?wsdl'
}
ENDPOINTS_SANDBOX =

endpoints to be used in sandbox

{ 
  :ad_intelligence_service => nil,
  :administration_service => nil,
  :campaign_management_service => nil,
  :customer_billing_service => nil,
  :customer_management_service => nil,
  :notification_service => nil,
  :optimizer_service => nil,
  :reporting_service => nil,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials, opts = {}, sandbox_flag = false) ⇒ AdCenterClient

credentials

Hash of credential data

opts

unused

sandbox_flag

bool value



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/adcenter_client.rb', line 74

def initialize(credentials, opts={}, sandbox_flag=false)
  unless credentials_valid?(credentials)
    warn "*** credentials appear invalid"
    warn credentials.to_yaml
  end
  @options = opts
  @entities = AdCenterWrapper
  @ad_intelligence_service = AdIntelligenceService.new(select_endpoint('ad_intelligence_service', sandbox_flag), credentials)
  @administration_service = AdministrationService.new(select_endpoint('administration_service', sandbox_flag), credentials)
  @campaign_management_service = CampaignManagementService.new(select_endpoint('campaign_management_service', sandbox_flag), credentials)
  @customer_billing_service = CustomerBillingService.new(select_endpoint('customer_billing_service', sandbox_flag), credentials)
  @customer_management_service = CustomerManagementService.new(select_endpoint('customer_management_service', sandbox_flag), credentials)
  @notification_service = NotificationService.new(select_endpoint('notification_service', sandbox_flag), credentials)
  @optimizer_service = ReportingService.new(select_endpoint('optimizer_service', sandbox_flag), credentials)
  @reporting_service = ReportingService.new(select_endpoint('reporting_service', sandbox_flag), credentials)
end

Instance Attribute Details

#ad_intelligence_serviceObject

connection to ad intelligence service



29
30
31
# File 'lib/adcenter_client.rb', line 29

def ad_intelligence_service
  @ad_intelligence_service
end

#administration_serviceObject

connection to administration service



31
32
33
# File 'lib/adcenter_client.rb', line 31

def administration_service
  @administration_service
end

#campaign_management_serviceObject

connection to campaign management service



33
34
35
# File 'lib/adcenter_client.rb', line 33

def campaign_management_service
  @campaign_management_service
end

#customer_billing_serviceObject

connection to customer billing service



35
36
37
# File 'lib/adcenter_client.rb', line 35

def customer_billing_service
  @customer_billing_service
end

#customer_management_serviceObject

connection to customer management service



37
38
39
# File 'lib/adcenter_client.rb', line 37

def customer_management_service
  @customer_management_service
end

#entitiesObject

reference to wrapper entities



45
46
47
# File 'lib/adcenter_client.rb', line 45

def entities
  @entities
end

#notification_serviceObject

connection to notification service



39
40
41
# File 'lib/adcenter_client.rb', line 39

def notification_service
  @notification_service
end

#optimizer_serviceObject

connection to optimizer service



41
42
43
# File 'lib/adcenter_client.rb', line 41

def optimizer_service
  @optimizer_service
end

#optionsObject

Returns the value of attribute options.



27
28
29
# File 'lib/adcenter_client.rb', line 27

def options
  @options
end

#reporting_serviceObject

connection to reporting service



43
44
45
# File 'lib/adcenter_client.rb', line 43

def reporting_service
  @reporting_service
end