bing_ads_api_v9 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +74 -0
- data/lib/ads_common_for_bing_ads.rb +47 -0
- data/lib/ads_common_for_bing_ads/api_config.rb +41 -0
- data/lib/ads_common_for_bing_ads/auth/client_login_handler.rb +161 -0
- data/lib/ads_common_for_bing_ads/auth/oauth2_handler.rb +33 -0
- data/lib/ads_common_for_bing_ads/build/savon_generator.rb +23 -0
- data/lib/ads_common_for_bing_ads/build/savon_registry.rb +17 -0
- data/lib/ads_common_for_bing_ads/parameters_validator.rb +36 -0
- data/lib/ads_common_for_bing_ads/savon_headers/base_header_handler.rb +13 -0
- data/lib/ads_common_for_bing_ads/savon_headers/client_login_header_handler.rb +24 -0
- data/lib/ads_common_for_bing_ads/savon_headers/oauth_header_handler.rb +31 -0
- data/lib/ads_common_for_bing_ads/savon_headers_base_header_handler.rb +9 -0
- data/lib/ads_common_for_bing_ads/savon_service.rb +143 -0
- data/lib/bing_ads_api.rb +215 -0
- data/lib/bing_ads_api/api_config.rb +164 -0
- data/lib/bing_ads_api/client_login_header_handler.rb +21 -0
- data/lib/bing_ads_api/credential_handler.rb +91 -0
- data/lib/bing_ads_api/errors.rb +564 -0
- data/lib/bing_ads_api/report_header_handler.rb +46 -0
- data/lib/bing_ads_api/report_utils.rb +202 -0
- data/lib/bing_ads_api/v8/ad_intelligence_service.rb +86 -0
- data/lib/bing_ads_api/v8/ad_intelligence_service_registry.rb +30 -0
- data/lib/bing_ads_api/v8/administration_service.rb +38 -0
- data/lib/bing_ads_api/v8/administration_service_registry.rb +30 -0
- data/lib/bing_ads_api/v8/bulk_service.rb +42 -0
- data/lib/bing_ads_api/v8/bulk_service_registry.rb +30 -0
- data/lib/bing_ads_api/v8/campaign_management_service.rb +390 -0
- data/lib/bing_ads_api/v8/campaign_management_service_registry.rb +30 -0
- data/lib/bing_ads_api/v8/customer_billing_service.rb +62 -0
- data/lib/bing_ads_api/v8/customer_billing_service_registry.rb +30 -0
- data/lib/bing_ads_api/v8/customer_management_service.rb +162 -0
- data/lib/bing_ads_api/v8/customer_management_service_registry.rb +30 -0
- data/lib/bing_ads_api/v8/notification_service.rb +38 -0
- data/lib/bing_ads_api/v8/notification_service_registry.rb +30 -0
- data/lib/bing_ads_api/v8/optimizer_service.rb +46 -0
- data/lib/bing_ads_api/v8/optimizer_service_registry.rb +30 -0
- data/lib/bing_ads_api/v8/reporting_service.rb +38 -0
- data/lib/bing_ads_api/v8/reporting_service_registry.rb +30 -0
- data/lib/bing_ads_api/v9/ad_intelligence_service.rb +86 -0
- data/lib/bing_ads_api/v9/ad_intelligence_service_registry.rb +30 -0
- data/lib/bing_ads_api/v9/bulk_service.rb +58 -0
- data/lib/bing_ads_api/v9/bulk_service_registry.rb +30 -0
- data/lib/bing_ads_api/v9/campaign_management_service.rb +298 -0
- data/lib/bing_ads_api/v9/campaign_management_service_registry.rb +30 -0
- data/lib/bing_ads_api/v9/customer_billing_service.rb +66 -0
- data/lib/bing_ads_api/v9/customer_billing_service_registry.rb +30 -0
- data/lib/bing_ads_api/v9/customer_management_service.rb +154 -0
- data/lib/bing_ads_api/v9/customer_management_service_registry.rb +30 -0
- data/lib/bing_ads_api/v9/optimizer_service.rb +62 -0
- data/lib/bing_ads_api/v9/optimizer_service_registry.rb +30 -0
- data/lib/bing_ads_api/v9/reporting_service.rb +38 -0
- data/lib/bing_ads_api/v9/reporting_service_registry.rb +30 -0
- data/lib/bing_ads_api/version.rb +5 -0
- data/rakefile.rb +54 -0
- metadata +168 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
# Handles HTTP headers for AdHoc reporting requests.
|
2
|
+
|
3
|
+
module BingAdsApi
|
4
|
+
class ReportHeaderHandler
|
5
|
+
|
6
|
+
# Initializes a header handler.
|
7
|
+
#
|
8
|
+
# Args:
|
9
|
+
# - credential_handler: a header with credential data
|
10
|
+
# - auth_handler: a header with auth data
|
11
|
+
# - config: API config
|
12
|
+
#
|
13
|
+
def initialize(credential_handler, auth_handler, config)
|
14
|
+
@credential_handler = credential_handler
|
15
|
+
@auth_handler = auth_handler
|
16
|
+
@config = config
|
17
|
+
end
|
18
|
+
|
19
|
+
# Returns the headers set for the report request.
|
20
|
+
#
|
21
|
+
# Args:
|
22
|
+
# - url: URL for the report requests
|
23
|
+
# - cid: clientCustomerId to use
|
24
|
+
#
|
25
|
+
# Returns:
|
26
|
+
# - a Hash with HTTP headers.
|
27
|
+
#
|
28
|
+
def headers(url, cid)
|
29
|
+
override = (cid.nil?) ? nil : {:client_customer_id => cid}
|
30
|
+
credentials = @credential_handler.credentials(override)
|
31
|
+
headers = {
|
32
|
+
'Content-Type' => 'application/x-www-form-urlencoded',
|
33
|
+
'Authorization' =>
|
34
|
+
@auth_handler.auth_string(credentials, HTTPI::Request.new(url)),
|
35
|
+
'User-Agent' => @credential_handler.generate_user_agent(),
|
36
|
+
'clientCustomerId' => credentials[:client_customer_id].to_s,
|
37
|
+
'developerToken' => credentials[:developer_token]
|
38
|
+
}
|
39
|
+
money_in_micros = @config.read('library.return_money_in_micros')
|
40
|
+
unless money_in_micros.nil?
|
41
|
+
headers['returnMoneyInMicros'] = money_in_micros
|
42
|
+
end
|
43
|
+
return headers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,202 @@
|
|
1
|
+
# Contains utility methods specific to reporting.
|
2
|
+
|
3
|
+
require 'cgi'
|
4
|
+
require 'gyoku'
|
5
|
+
|
6
|
+
require 'bing_ads_api/errors'
|
7
|
+
require 'bing_ads_api/report_header_handler'
|
8
|
+
|
9
|
+
module BingAdsApi
|
10
|
+
class ReportUtils
|
11
|
+
# Default constructor.
|
12
|
+
#
|
13
|
+
# Args:
|
14
|
+
# - api: BingAdsApi object
|
15
|
+
# - version: API version to use
|
16
|
+
#
|
17
|
+
def initialize(api, version)
|
18
|
+
@api, @version = api, version
|
19
|
+
end
|
20
|
+
|
21
|
+
# Downloads and returns a report.
|
22
|
+
#
|
23
|
+
# Args:
|
24
|
+
# - report_definition: definition of the report in XML text or hash
|
25
|
+
# - cid: optional customer ID to run against
|
26
|
+
#
|
27
|
+
# Returns:
|
28
|
+
# - report body
|
29
|
+
#
|
30
|
+
# Raises:
|
31
|
+
# - BingAdsApi::Errors::InvalidReportDefinitionError if the report
|
32
|
+
# definition is invalid
|
33
|
+
# - BingAdsApi::Errors::ReportError if server-side error occurred
|
34
|
+
#
|
35
|
+
def download_report(report_definition, cid = nil)
|
36
|
+
return get_report_response(report_definition, cid).body
|
37
|
+
end
|
38
|
+
|
39
|
+
# Downloads a report and saves it to a file.
|
40
|
+
#
|
41
|
+
# Args:
|
42
|
+
# - report_definition: definition of the report in XML text or hash
|
43
|
+
# - path: path to save report to
|
44
|
+
# - cid: optional customer ID to run against
|
45
|
+
#
|
46
|
+
# Returns:
|
47
|
+
# - nil
|
48
|
+
#
|
49
|
+
# Raises:
|
50
|
+
# - BingAdsApi::Errors::InvalidReportDefinitionError if the report
|
51
|
+
# definition is invalid
|
52
|
+
# - BingAdsApi::Errors::ReportError if server-side error occurred
|
53
|
+
#
|
54
|
+
def download_report_as_file(report_definition, path, cid = nil)
|
55
|
+
report_body = download_report(report_definition, cid)
|
56
|
+
save_to_file(report_body, path)
|
57
|
+
return nil
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
# Minimal set of required fields for report definition.
|
63
|
+
REQUIRED_FIELDS = [:selector, :report_name, :report_type, :date_range_type]
|
64
|
+
|
65
|
+
# Definition fields have to be in particular order in the XML. Here is its
|
66
|
+
# specification.
|
67
|
+
REPORT_DEFINITION_ORDER = {
|
68
|
+
:root => [:selector, :report_name, :report_type, :date_range_type,
|
69
|
+
:download_format, :include_zero_impressions],
|
70
|
+
:selector => [:fields, :predicates, :date_range, :ordering, :paging],
|
71
|
+
:predicates => [:field, :operator, :values],
|
72
|
+
:ordering => [:field, :sort_order],
|
73
|
+
:paging => [:start_index, :number_results],
|
74
|
+
:date_range => [:min, :max]
|
75
|
+
}
|
76
|
+
|
77
|
+
# Send POST request for a report and returns Response object.
|
78
|
+
def get_report_response(report_definition, cid)
|
79
|
+
definition_text = get_report_definition_text(report_definition)
|
80
|
+
data = '__rdxml=%s' % CGI.escape(definition_text)
|
81
|
+
url = @api.api_config.adhoc_report_download_url(
|
82
|
+
@api.config.read('service.environment'), @version)
|
83
|
+
headers = get_report_request_headers(url, cid)
|
84
|
+
log_request(url, headers, definition_text)
|
85
|
+
response = AdsCommonForBingAds::Http.post_response(url, data, @api.config, headers)
|
86
|
+
check_for_errors(response)
|
87
|
+
return response
|
88
|
+
end
|
89
|
+
|
90
|
+
# Converts passed object to XML text. Currently support String (no changes)
|
91
|
+
# and Hash (renders XML).
|
92
|
+
def get_report_definition_text(report_definition)
|
93
|
+
return case report_definition
|
94
|
+
when String then report_definition
|
95
|
+
when Hash then report_definition_to_xml(report_definition)
|
96
|
+
else
|
97
|
+
raise BingAdsApi::Errors::InvalidReportDefinitionError,
|
98
|
+
'Unknown object for report definition: %s' %
|
99
|
+
report_definition.class
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# Prepares headers for report request.
|
104
|
+
def get_report_request_headers(url, cid)
|
105
|
+
@header_handler ||= BingAdsApi::ReportHeaderHandler.new(
|
106
|
+
@api.credential_handler, @api.get_auth_handler(), @api.config)
|
107
|
+
return @header_handler.headers(url, cid)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Saves raw data to a file.
|
111
|
+
def save_to_file(data, path)
|
112
|
+
open(path, 'wb') { |file| file.write(data) } if path
|
113
|
+
end
|
114
|
+
|
115
|
+
# Logs the request on debug level.
|
116
|
+
def log_request(url, headers, body)
|
117
|
+
logger = @api.logger
|
118
|
+
logger.debug("Report request to: '%s'" % url)
|
119
|
+
logger.debug('HTTP headers: [%s]' %
|
120
|
+
(headers.map { |k, v| [k, v].join(': ') }.join(', ')))
|
121
|
+
logger.debug(body)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Checks downloaded data for error signature. Raises ReportError if it
|
125
|
+
# detects an error.
|
126
|
+
def check_for_errors(response)
|
127
|
+
# Check for error in body.
|
128
|
+
report_body = response.body
|
129
|
+
if report_body and
|
130
|
+
((RUBY_VERSION < '1.9.1') or report_body.valid_encoding?)
|
131
|
+
error_message_regex = '^!!!(-?\d+)\|\|\|(-?\d+)\|\|\|(.*)\?\?\?'
|
132
|
+
data = report_body.slice(0, 1024)
|
133
|
+
matches = data.match(error_message_regex)
|
134
|
+
if matches
|
135
|
+
message = (matches[3].nil?) ? data : matches[3]
|
136
|
+
raise BingAdsApi::Errors::ReportError.new(response.code,
|
137
|
+
'Report download error occured: %s' % message)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
# Check for error code.
|
141
|
+
unless response.code == 200
|
142
|
+
raise BingAdsApi::Errors::ReportError.new(response.code,
|
143
|
+
'Report download error occured, http code: %d, body: %s' %
|
144
|
+
[response.code, response.body])
|
145
|
+
end
|
146
|
+
return nil
|
147
|
+
end
|
148
|
+
|
149
|
+
# Renders a report definition hash into XML text.
|
150
|
+
def report_definition_to_xml(report_definition)
|
151
|
+
check_report_definition_hash(report_definition)
|
152
|
+
add_report_definition_hash_order(report_definition)
|
153
|
+
return Gyoku.xml({:report_definition => report_definition})
|
154
|
+
end
|
155
|
+
|
156
|
+
# Checks if the report definition looks correct.
|
157
|
+
def check_report_definition_hash(report_definition)
|
158
|
+
# Minimal set of fields required.
|
159
|
+
REQUIRED_FIELDS.each do |field|
|
160
|
+
unless report_definition.include?(field)
|
161
|
+
raise BingAdsApi::Errors::InvalidReportDefinitionError,
|
162
|
+
"Required field '%s' is missing in the definition" % field
|
163
|
+
end
|
164
|
+
end
|
165
|
+
# Fields list is also required.
|
166
|
+
unless report_definition[:selector].include?(:fields)
|
167
|
+
raise BingAdsApi::Errors::InvalidReportDefinitionError,
|
168
|
+
'Fields list is required'
|
169
|
+
end
|
170
|
+
# 'Fields' must be an Array.
|
171
|
+
unless report_definition[:selector][:fields].kind_of?(Array)
|
172
|
+
raise BingAdsApi::Errors::InvalidReportDefinitionError,
|
173
|
+
'Fields list must be an array'
|
174
|
+
end
|
175
|
+
# We should request at least one field.
|
176
|
+
if report_definition[:selector][:fields].empty?
|
177
|
+
raise BingAdsApi::Errors::InvalidReportDefinitionError,
|
178
|
+
'At least one field needs to be requested'
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
# Adds fields order hint to generator based on specification.
|
183
|
+
def add_report_definition_hash_order(node, name = :root)
|
184
|
+
def_order = REPORT_DEFINITION_ORDER[name]
|
185
|
+
var_order = def_order.reject { |field| !node.include?(field) }
|
186
|
+
node.keys.each do |key|
|
187
|
+
if REPORT_DEFINITION_ORDER.include?(key)
|
188
|
+
case node[key]
|
189
|
+
when Hash
|
190
|
+
add_report_definition_hash_order(node[key], key)
|
191
|
+
when Array
|
192
|
+
node[key].each do |item|
|
193
|
+
add_report_definition_hash_order(item, key)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
node[:order!] = var_order
|
199
|
+
return nil
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# This is auto-generated code, changes will be overwritten.
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
+
#
|
8
|
+
# Code generated by AdsCommon library 0.7.3 on 2012-07-04 16:49:50.
|
9
|
+
|
10
|
+
require 'ads_common_for_bing_ads/savon_service'
|
11
|
+
require 'bing_ads_api/v8/ad_intelligence_service_registry'
|
12
|
+
|
13
|
+
module BingAdsApi; module V8; module AdIntelligenceService
|
14
|
+
class AdIntelligenceService < AdsCommonForBingAds::SavonService
|
15
|
+
def initialize(config, endpoint)
|
16
|
+
namespace = 'https://adcenter.microsoft.com/v8'
|
17
|
+
super(config, endpoint, namespace, :v8)
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_publisher_keyword_performance(*args, &block)
|
21
|
+
return execute_action('get_publisher_keyword_performance', args, &block)
|
22
|
+
end
|
23
|
+
|
24
|
+
def suggest_keywords_for_url(*args, &block)
|
25
|
+
return execute_action('suggest_keywords_for_url', args, &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_estimated_bid_by_keyword_ids(*args, &block)
|
29
|
+
return execute_action('get_estimated_bid_by_keyword_ids', args, &block)
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_estimated_position_by_keyword_ids(*args, &block)
|
33
|
+
return execute_action('get_estimated_position_by_keyword_ids', args, &block)
|
34
|
+
end
|
35
|
+
|
36
|
+
def get_estimated_bid_by_keywords(*args, &block)
|
37
|
+
return execute_action('get_estimated_bid_by_keywords', args, &block)
|
38
|
+
end
|
39
|
+
|
40
|
+
def get_estimated_position_by_keywords(*args, &block)
|
41
|
+
return execute_action('get_estimated_position_by_keywords', args, &block)
|
42
|
+
end
|
43
|
+
|
44
|
+
def get_historical_search_count(*args, &block)
|
45
|
+
return execute_action('get_historical_search_count', args, &block)
|
46
|
+
end
|
47
|
+
|
48
|
+
def get_historical_search_count_by_device(*args, &block)
|
49
|
+
return execute_action('get_historical_search_count_by_device', args, &block)
|
50
|
+
end
|
51
|
+
|
52
|
+
def get_historical_keyword_performance(*args, &block)
|
53
|
+
return execute_action('get_historical_keyword_performance', args, &block)
|
54
|
+
end
|
55
|
+
|
56
|
+
def get_historical_keyword_performance_by_device(*args, &block)
|
57
|
+
return execute_action('get_historical_keyword_performance_by_device', args, &block)
|
58
|
+
end
|
59
|
+
|
60
|
+
def suggest_keywords_from_existing_keywords(*args, &block)
|
61
|
+
return execute_action('suggest_keywords_from_existing_keywords', args, &block)
|
62
|
+
end
|
63
|
+
|
64
|
+
def get_keyword_locations(*args, &block)
|
65
|
+
return execute_action('get_keyword_locations', args, &block)
|
66
|
+
end
|
67
|
+
|
68
|
+
def get_keyword_categories(*args, &block)
|
69
|
+
return execute_action('get_keyword_categories', args, &block)
|
70
|
+
end
|
71
|
+
|
72
|
+
def get_keyword_demographics(*args, &block)
|
73
|
+
return execute_action('get_keyword_demographics', args, &block)
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
def get_service_registry()
|
79
|
+
return AdIntelligenceServiceRegistry
|
80
|
+
end
|
81
|
+
|
82
|
+
def get_module()
|
83
|
+
return BingAdsApi::V8::AdIntelligenceService
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end; end; end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# This is auto-generated code, changes will be overwritten.
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
+
#
|
8
|
+
# Code generated by AdsCommon library 0.7.3 on 2012-07-04 16:49:50.
|
9
|
+
|
10
|
+
require 'bing_ads_api/errors'
|
11
|
+
|
12
|
+
module BingAdsApi; module V8; module AdIntelligenceService
|
13
|
+
class AdIntelligenceServiceRegistry
|
14
|
+
ADINTELLIGENCESERVICE_METHODS = {:get_publisher_keyword_performance=>{:input=>{:name=>"get_publisher_keyword_performance_request", :fields=>[]}, :output=>{:name=>"get_publisher_keyword_performance_response", :fields=>[]}, :original_name=>"GetPublisherKeywordPerformance"}, :suggest_keywords_for_url=>{:input=>{:name=>"suggest_keywords_for_url_request", :fields=>[]}, :output=>{:name=>"suggest_keywords_for_url_response", :fields=>[]}, :original_name=>"SuggestKeywordsForUrl"}, :get_estimated_bid_by_keyword_ids=>{:input=>{:name=>"get_estimated_bid_by_keyword_ids_request", :fields=>[]}, :output=>{:name=>"get_estimated_bid_by_keyword_ids_response", :fields=>[]}, :original_name=>"GetEstimatedBidByKeywordIds"}, :get_estimated_position_by_keyword_ids=>{:input=>{:name=>"get_estimated_position_by_keyword_ids_request", :fields=>[]}, :output=>{:name=>"get_estimated_position_by_keyword_ids_response", :fields=>[]}, :original_name=>"GetEstimatedPositionByKeywordIds"}, :get_estimated_bid_by_keywords=>{:input=>{:name=>"get_estimated_bid_by_keywords_request", :fields=>[]}, :output=>{:name=>"get_estimated_bid_by_keywords_response", :fields=>[]}, :original_name=>"GetEstimatedBidByKeywords"}, :get_estimated_position_by_keywords=>{:input=>{:name=>"get_estimated_position_by_keywords_request", :fields=>[]}, :output=>{:name=>"get_estimated_position_by_keywords_response", :fields=>[]}, :original_name=>"GetEstimatedPositionByKeywords"}, :get_historical_search_count=>{:input=>{:name=>"get_historical_search_count_request", :fields=>[]}, :output=>{:name=>"get_historical_search_count_response", :fields=>[]}, :original_name=>"GetHistoricalSearchCount"}, :get_historical_search_count_by_device=>{:input=>{:name=>"get_historical_search_count_by_device_request", :fields=>[]}, :output=>{:name=>"get_historical_search_count_by_device_response", :fields=>[]}, :original_name=>"GetHistoricalSearchCountByDevice"}, :get_historical_keyword_performance=>{:input=>{:name=>"get_historical_keyword_performance_request", :fields=>[]}, :output=>{:name=>"get_historical_keyword_performance_response", :fields=>[]}, :original_name=>"GetHistoricalKeywordPerformance"}, :get_historical_keyword_performance_by_device=>{:input=>{:name=>"get_historical_keyword_performance_by_device_request", :fields=>[]}, :output=>{:name=>"get_historical_keyword_performance_by_device_response", :fields=>[]}, :original_name=>"GetHistoricalKeywordPerformanceByDevice"}, :suggest_keywords_from_existing_keywords=>{:input=>{:name=>"suggest_keywords_from_existing_keywords_request", :fields=>[]}, :output=>{:name=>"suggest_keywords_from_existing_keywords_response", :fields=>[]}, :original_name=>"SuggestKeywordsFromExistingKeywords"}, :get_keyword_locations=>{:input=>{:name=>"get_keyword_locations_request", :fields=>[]}, :output=>{:name=>"get_keyword_locations_response", :fields=>[]}, :original_name=>"GetKeywordLocations"}, :get_keyword_categories=>{:input=>{:name=>"get_keyword_categories_request", :fields=>[]}, :output=>{:name=>"get_keyword_categories_response", :fields=>[]}, :original_name=>"GetKeywordCategories"}, :get_keyword_demographics=>{:input=>{:name=>"get_keyword_demographics_request", :fields=>[]}, :output=>{:name=>"get_keyword_demographics_response", :fields=>[]}, :original_name=>"GetKeywordDemographics"}}
|
15
|
+
ADINTELLIGENCESERVICE_TYPES = {}
|
16
|
+
ADINTELLIGENCESERVICE_NAMESPACES = []
|
17
|
+
|
18
|
+
def self.get_method_signature(method_name)
|
19
|
+
return ADINTELLIGENCESERVICE_METHODS[method_name.to_sym]
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.get_type_signature(type_name)
|
23
|
+
return ADINTELLIGENCESERVICE_TYPES[type_name.to_sym]
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.get_namespace(index)
|
27
|
+
return ADINTELLIGENCESERVICE_NAMESPACES[index]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end; end; end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# This is auto-generated code, changes will be overwritten.
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
+
#
|
8
|
+
# Code generated by AdsCommon library 0.7.3 on 2012-07-04 16:49:52.
|
9
|
+
|
10
|
+
require 'ads_common_for_bing_ads/savon_service'
|
11
|
+
require 'bing_ads_api/v8/administration_service_registry'
|
12
|
+
|
13
|
+
module BingAdsApi; module V8; module AdministrationService
|
14
|
+
class AdministrationService < AdsCommonForBingAds::SavonService
|
15
|
+
def initialize(config, endpoint)
|
16
|
+
namespace = 'https://adcenter.microsoft.com/v8'
|
17
|
+
super(config, endpoint, namespace, :v8)
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_assigned_quota(*args, &block)
|
21
|
+
return execute_action('get_assigned_quota', args, &block)
|
22
|
+
end
|
23
|
+
|
24
|
+
def get_remaining_quota(*args, &block)
|
25
|
+
return execute_action('get_remaining_quota', args, &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def get_service_registry()
|
31
|
+
return AdministrationServiceRegistry
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_module()
|
35
|
+
return BingAdsApi::V8::AdministrationService
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end; end; end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# This is auto-generated code, changes will be overwritten.
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
+
#
|
8
|
+
# Code generated by AdsCommon library 0.7.3 on 2012-07-04 16:49:52.
|
9
|
+
|
10
|
+
require 'bing_ads_api/errors'
|
11
|
+
|
12
|
+
module BingAdsApi; module V8; module AdministrationService
|
13
|
+
class AdministrationServiceRegistry
|
14
|
+
ADMINISTRATIONSERVICE_METHODS = {:get_assigned_quota=>{:input=>{:name=>"get_assigned_quota_request", :fields=>[]}, :output=>{:name=>"get_assigned_quota_response", :fields=>[]}, :original_name=>"GetAssignedQuota"}, :get_remaining_quota=>{:input=>{:name=>"get_remaining_quota_request", :fields=>[]}, :output=>{:name=>"get_remaining_quota_response", :fields=>[]}, :original_name=>"GetRemainingQuota"}}
|
15
|
+
ADMINISTRATIONSERVICE_TYPES = {}
|
16
|
+
ADMINISTRATIONSERVICE_NAMESPACES = []
|
17
|
+
|
18
|
+
def self.get_method_signature(method_name)
|
19
|
+
return ADMINISTRATIONSERVICE_METHODS[method_name.to_sym]
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.get_type_signature(type_name)
|
23
|
+
return ADMINISTRATIONSERVICE_TYPES[type_name.to_sym]
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.get_namespace(index)
|
27
|
+
return ADMINISTRATIONSERVICE_NAMESPACES[index]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end; end; end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# This is auto-generated code, changes will be overwritten.
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
+
#
|
8
|
+
# Code generated by AdsCommon library 0.7.3 on 2012-07-04 16:49:53.
|
9
|
+
|
10
|
+
require 'ads_common_for_bing_ads/savon_service'
|
11
|
+
require 'bing_ads_api/v8/bulk_service_registry'
|
12
|
+
|
13
|
+
module BingAdsApi; module V8; module BulkService
|
14
|
+
class BulkService < AdsCommonForBingAds::SavonService
|
15
|
+
def initialize(config, endpoint)
|
16
|
+
namespace = 'https://adcenter.microsoft.com/v8'
|
17
|
+
super(config, endpoint, namespace, :v8)
|
18
|
+
end
|
19
|
+
|
20
|
+
def download_campaigns_by_account_ids(*args, &block)
|
21
|
+
return execute_action('download_campaigns_by_account_ids', args, &block)
|
22
|
+
end
|
23
|
+
|
24
|
+
def download_campaigns_by_campaign_ids(*args, &block)
|
25
|
+
return execute_action('download_campaigns_by_campaign_ids', args, &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_download_status(*args, &block)
|
29
|
+
return execute_action('get_download_status', args, &block)
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def get_service_registry()
|
35
|
+
return BulkServiceRegistry
|
36
|
+
end
|
37
|
+
|
38
|
+
def get_module()
|
39
|
+
return BingAdsApi::V8::BulkService
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end; end; end
|