Class: AdCenterClient

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

Constant Summary collapse

VERSION =
'7.0.3'
ENDPOINTS_PRODUCTION =

endpoints to be used in production

{
  :administration_service => "https://adcenterapi.microsoft.com/Api/Advertiser/v7/Administration/AdministrationService.svc?wsdl",
  :campaign_management_service => "https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?wsdl",
  :customer_billing_service => "https://sharedservices.adcenterapi.microsoft.com/Api/Billing/v7/CustomerBillingService.svc?wsdl",
  :customer_management_service => "https://sharedservices.adcenterapi.microsoft.com/Api/CustomerManagement/v7/CustomerManagementService.svc?wsdl",
  :notification_management => "https://adcenterapi.microsoft.com/Api/Advertiser/v6/NotificationManagement/NotificationManagement.asmx?wsdl",
  :reporting_service => "https://adcenterapi.microsoft.com/Api/Advertiser/v7/Reporting/ReportingService.svc?wsdl",
  :secure_data_management_service => "https://securityservices.adcenterapi.microsoft.com/Api/SecureDataManagement/v7/SecureDataManagementService.svc?wsdl",
}
ENDPOINTS_SANDBOX =

endpoints to be used in sandbox

{
  :administration_service => "https://sandboxapi.adcenter.microsoft.com/Api/Advertiser/v7/Administration/AdministrationService.svc?wsdl",
  :campaign_management_service => "https://sandboxapi.adcenter.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?wsdl",
  :customer_billing_service => "https://sharedservices-sbx.adcenterapi.microsoft.com/Api/Billing/v7/CustomerBillingService.svc?wsdl",
  :customer_management_service => "https://sharedservices-sbx.adcenterapi.microsoft.com/Api/CustomerManagement/v7/CustomerManagementService.svc?wsdl",
  :notification_management => "https://sandboxapi.adcenter.microsoft.com/Api/Advertiser/v6/NotificationManagement/NotificationManagement.asmx?wsdl",
  :reporting_service => nil,
  :secure_data_management_service => "https://securityservices-sbx.adcenterapi.microsoft.com/Api/SecureDataManagement/v7/SecureDataManagementService.svc?wsdl",
}

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



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/adcenter_client.rb', line 69

def initialize(credentials, opts={}, sandbox_flag=false)
  unless credentials_valid?(credentials)
    warn "*** credentials appear invalid"
    warn credentials.to_yaml
  end
  @options = opts
  @entities = AdCenterWrapper
  @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_management = NotificationManagement.new(select_endpoint('notification_management', sandbox_flag), credentials)
  @reporting_service = ReportingService.new(select_endpoint('reporting_service', sandbox_flag), credentials)
  @secure_data_management_service = SecureDataManagementService.new(select_endpoint('secure_data_management_service', sandbox_flag), credentials)
end

Instance Attribute Details

#administration_serviceObject

connection to administration service



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

def administration_service
  @administration_service
end

#campaign_management_serviceObject

connection to campaign management service



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

def campaign_management_service
  @campaign_management_service
end

#customer_billing_serviceObject

connection to customer billing service



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

def customer_billing_service
  @customer_billing_service
end

#customer_management_serviceObject

connection to customer management service



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

def customer_management_service
  @customer_management_service
end

#entitiesObject

reference to wrapper entities



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

def entities
  @entities
end

#notification_managementObject

connection to notification management



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

def notification_management
  @notification_management
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#reporting_serviceObject

connection to reporting service



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

def reporting_service
  @reporting_service
end

#secure_data_management_serviceObject

connection to secure data management service



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

def secure_data_management_service
  @secure_data_management_service
end