Class: AdCenterClient
- Inherits:
-
Object
- Object
- AdCenterClient
- Includes:
- SOAP::RPC
- Defined in:
- lib/adcenter_client.rb
Constant Summary collapse
- VERSION =
'8.0.3'
- 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
-
#ad_intelligence_service ⇒ Object
connection to ad intelligence service.
-
#administration_service ⇒ Object
connection to administration service.
-
#campaign_management_service ⇒ Object
connection to campaign management service.
-
#customer_billing_service ⇒ Object
connection to customer billing service.
-
#customer_management_service ⇒ Object
connection to customer management service.
-
#entities ⇒ Object
reference to wrapper entities.
-
#notification_service ⇒ Object
connection to notification service.
-
#optimizer_service ⇒ Object
connection to optimizer service.
-
#options ⇒ Object
unused, but should be used to pass “other” options to the class.
-
#reporting_service ⇒ Object
connection to reporting service.
Instance Method Summary collapse
-
#initialize(credentials, opts = {}, sandbox_flag = false) ⇒ AdCenterClient
constructor
- credentials
- Hash of credential data opts
- unused sandbox_flag
-
bool value.
Constructor Details
permalink #initialize(credentials, opts = {}, sandbox_flag = false) ⇒ AdCenterClient
- credentials
-
Hash of credential data
- opts
-
unused
- sandbox_flag
-
bool value
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/adcenter_client.rb', line 75 def initialize(credentials, opts={}, sandbox_flag=false) unless credentials_valid?(credentials) warn "*** credentials appear invalid" warn credentials.to_yaml end = 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
permalink #ad_intelligence_service ⇒ Object
connection to ad intelligence service
30 31 32 |
# File 'lib/adcenter_client.rb', line 30 def ad_intelligence_service @ad_intelligence_service end |
permalink #administration_service ⇒ Object
connection to administration service
32 33 34 |
# File 'lib/adcenter_client.rb', line 32 def administration_service @administration_service end |
permalink #campaign_management_service ⇒ Object
connection to campaign management service
34 35 36 |
# File 'lib/adcenter_client.rb', line 34 def campaign_management_service @campaign_management_service end |
permalink #customer_billing_service ⇒ Object
connection to customer billing service
36 37 38 |
# File 'lib/adcenter_client.rb', line 36 def customer_billing_service @customer_billing_service end |
permalink #customer_management_service ⇒ Object
connection to customer management service
38 39 40 |
# File 'lib/adcenter_client.rb', line 38 def customer_management_service @customer_management_service end |
permalink #entities ⇒ Object
reference to wrapper entities
46 47 48 |
# File 'lib/adcenter_client.rb', line 46 def entities @entities end |
permalink #notification_service ⇒ Object
connection to notification service
40 41 42 |
# File 'lib/adcenter_client.rb', line 40 def notification_service @notification_service end |
permalink #optimizer_service ⇒ Object
connection to optimizer service
42 43 44 |
# File 'lib/adcenter_client.rb', line 42 def optimizer_service @optimizer_service end |
permalink #options ⇒ Object
unused, but should be used to pass “other” options to the class
28 29 30 |
# File 'lib/adcenter_client.rb', line 28 def end |
permalink #reporting_service ⇒ Object
connection to reporting service
44 45 46 |
# File 'lib/adcenter_client.rb', line 44 def reporting_service @reporting_service end |