adcenter_api 0.0.1

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.
Files changed (47) hide show
  1. data/README.md +57 -0
  2. data/lib/adcenter_api.rb +180 -0
  3. data/lib/adcenter_api/api_config.rb +163 -0
  4. data/lib/adcenter_api/client_login_header_handler.rb +70 -0
  5. data/lib/adcenter_api/credential_handler.rb +104 -0
  6. data/lib/adcenter_api/errors.rb +565 -0
  7. data/lib/adcenter_api/report_header_handler.rb +46 -0
  8. data/lib/adcenter_api/report_utils.rb +203 -0
  9. data/lib/adcenter_api/v7/administration_service.rb +38 -0
  10. data/lib/adcenter_api/v7/administration_service_registry.rb +30 -0
  11. data/lib/adcenter_api/v7/campaign_management_service.rb +398 -0
  12. data/lib/adcenter_api/v7/campaign_management_service_registry.rb +30 -0
  13. data/lib/adcenter_api/v7/customer_billing_service.rb +58 -0
  14. data/lib/adcenter_api/v7/customer_billing_service_registry.rb +30 -0
  15. data/lib/adcenter_api/v7/customer_management_service.rb +98 -0
  16. data/lib/adcenter_api/v7/customer_management_service_registry.rb +30 -0
  17. data/lib/adcenter_api/v7/notification_service.rb +38 -0
  18. data/lib/adcenter_api/v7/notification_service_registry.rb +30 -0
  19. data/lib/adcenter_api/v7/reporting_service.rb +38 -0
  20. data/lib/adcenter_api/v7/reporting_service_registry.rb +30 -0
  21. data/lib/adcenter_api/v8/ad_intelligence_service.rb +86 -0
  22. data/lib/adcenter_api/v8/ad_intelligence_service_registry.rb +30 -0
  23. data/lib/adcenter_api/v8/administration_service.rb +38 -0
  24. data/lib/adcenter_api/v8/administration_service_registry.rb +30 -0
  25. data/lib/adcenter_api/v8/bulk_service.rb +42 -0
  26. data/lib/adcenter_api/v8/bulk_service_registry.rb +30 -0
  27. data/lib/adcenter_api/v8/campaign_management_service.rb +390 -0
  28. data/lib/adcenter_api/v8/campaign_management_service_registry.rb +30 -0
  29. data/lib/adcenter_api/v8/customer_billing_service.rb +62 -0
  30. data/lib/adcenter_api/v8/customer_billing_service_registry.rb +30 -0
  31. data/lib/adcenter_api/v8/customer_management_service.rb +162 -0
  32. data/lib/adcenter_api/v8/customer_management_service_registry.rb +30 -0
  33. data/lib/adcenter_api/v8/notification_service.rb +38 -0
  34. data/lib/adcenter_api/v8/notification_service_registry.rb +30 -0
  35. data/lib/adcenter_api/v8/optimizer_service.rb +46 -0
  36. data/lib/adcenter_api/v8/optimizer_service_registry.rb +30 -0
  37. data/lib/adcenter_api/v8/reporting_service.rb +38 -0
  38. data/lib/adcenter_api/v8/reporting_service_registry.rb +30 -0
  39. data/lib/adcenter_api/version.rb +5 -0
  40. data/lib/ads_common/api_config_decorator.rb +43 -0
  41. data/lib/ads_common/auth/client_login_handler_decorator.rb +168 -0
  42. data/lib/ads_common/build/savon_registry_decorator.rb +16 -0
  43. data/lib/ads_common/parameters_validator_decorator.rb +37 -0
  44. data/lib/ads_common/savon_headers_base_header_handler_decorator.rb +23 -0
  45. data/lib/ads_common/savon_service_decorator.rb +109 -0
  46. data/rakefile.rb +54 -0
  47. metadata +157 -0
@@ -0,0 +1,46 @@
1
+ # Handles HTTP headers for AdHoc reporting requests.
2
+
3
+ module AdcenterApi
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_http_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,203 @@
1
+ # Contains utility methods specific to reporting.
2
+
3
+ require 'cgi'
4
+ require 'gyoku'
5
+
6
+ require 'ads_common/http'
7
+ require 'adcenter_api/errors'
8
+ require 'adcenter_api/report_header_handler'
9
+
10
+ module AdcenterApi
11
+ class ReportUtils
12
+ # Default constructor.
13
+ #
14
+ # Args:
15
+ # - api: AdcenterApi object
16
+ # - version: API version to use
17
+ #
18
+ def initialize(api, version)
19
+ @api, @version = api, version
20
+ end
21
+
22
+ # Downloads and returns a report.
23
+ #
24
+ # Args:
25
+ # - report_definition: definition of the report in XML text or hash
26
+ # - cid: optional customer ID to run against
27
+ #
28
+ # Returns:
29
+ # - report body
30
+ #
31
+ # Raises:
32
+ # - AdcenterApi::Errors::InvalidReportDefinitionError if the report
33
+ # definition is invalid
34
+ # - AdcenterApi::Errors::ReportError if server-side error occurred
35
+ #
36
+ def download_report(report_definition, cid = nil)
37
+ return get_report_response(report_definition, cid).body
38
+ end
39
+
40
+ # Downloads a report and saves it to a file.
41
+ #
42
+ # Args:
43
+ # - report_definition: definition of the report in XML text or hash
44
+ # - path: path to save report to
45
+ # - cid: optional customer ID to run against
46
+ #
47
+ # Returns:
48
+ # - nil
49
+ #
50
+ # Raises:
51
+ # - AdcenterApi::Errors::InvalidReportDefinitionError if the report
52
+ # definition is invalid
53
+ # - AdcenterApi::Errors::ReportError if server-side error occurred
54
+ #
55
+ def download_report_as_file(report_definition, path, cid = nil)
56
+ report_body = download_report(report_definition, cid)
57
+ save_to_file(report_body, path)
58
+ return nil
59
+ end
60
+
61
+ private
62
+
63
+ # Minimal set of required fields for report definition.
64
+ REQUIRED_FIELDS = [:selector, :report_name, :report_type, :date_range_type]
65
+
66
+ # Definition fields have to be in particular order in the XML. Here is its
67
+ # specification.
68
+ REPORT_DEFINITION_ORDER = {
69
+ :root => [:selector, :report_name, :report_type, :date_range_type,
70
+ :download_format, :include_zero_impressions],
71
+ :selector => [:fields, :predicates, :date_range, :ordering, :paging],
72
+ :predicates => [:field, :operator, :values],
73
+ :ordering => [:field, :sort_order],
74
+ :paging => [:start_index, :number_results],
75
+ :date_range => [:min, :max]
76
+ }
77
+
78
+ # Send POST request for a report and returns Response object.
79
+ def get_report_response(report_definition, cid)
80
+ definition_text = get_report_definition_text(report_definition)
81
+ data = '__rdxml=%s' % CGI.escape(definition_text)
82
+ url = @api.api_config.adhoc_report_download_url(
83
+ @api.config.read('service.environment'), @version)
84
+ headers = get_report_request_headers(url, cid)
85
+ log_request(url, headers, definition_text)
86
+ response = AdsCommon::Http.post_response(url, data, @api.config, headers)
87
+ check_for_errors(response)
88
+ return response
89
+ end
90
+
91
+ # Converts passed object to XML text. Currently support String (no changes)
92
+ # and Hash (renders XML).
93
+ def get_report_definition_text(report_definition)
94
+ return case report_definition
95
+ when String then report_definition
96
+ when Hash then report_definition_to_xml(report_definition)
97
+ else
98
+ raise AdcenterApi::Errors::InvalidReportDefinitionError,
99
+ 'Unknown object for report definition: %s' %
100
+ report_definition.class
101
+ end
102
+ end
103
+
104
+ # Prepares headers for report request.
105
+ def get_report_request_headers(url, cid)
106
+ @header_handler ||= AdcenterApi::ReportHeaderHandler.new(
107
+ @api.credential_handler, @api.get_auth_handler(), @api.config)
108
+ return @header_handler.headers(url, cid)
109
+ end
110
+
111
+ # Saves raw data to a file.
112
+ def save_to_file(data, path)
113
+ open(path, 'wb') { |file| file.write(data) } if path
114
+ end
115
+
116
+ # Logs the request on debug level.
117
+ def log_request(url, headers, body)
118
+ logger = @api.logger
119
+ logger.debug("Report request to: '%s'" % url)
120
+ logger.debug('HTTP headers: [%s]' %
121
+ (headers.map { |k, v| [k, v].join(': ') }.join(', ')))
122
+ logger.debug(body)
123
+ end
124
+
125
+ # Checks downloaded data for error signature. Raises ReportError if it
126
+ # detects an error.
127
+ def check_for_errors(response)
128
+ # Check for error in body.
129
+ report_body = response.body
130
+ if report_body and
131
+ ((RUBY_VERSION < '1.9.1') or report_body.valid_encoding?)
132
+ error_message_regex = '^!!!(-?\d+)\|\|\|(-?\d+)\|\|\|(.*)\?\?\?'
133
+ data = report_body.slice(0, 1024)
134
+ matches = data.match(error_message_regex)
135
+ if matches
136
+ message = (matches[3].nil?) ? data : matches[3]
137
+ raise AdcenterApi::Errors::ReportError.new(response.code,
138
+ 'Report download error occured: %s' % message)
139
+ end
140
+ end
141
+ # Check for error code.
142
+ unless response.code == 200
143
+ raise AdcenterApi::Errors::ReportError.new(response.code,
144
+ 'Report download error occured, http code: %d, body: %s' %
145
+ [response.code, response.body])
146
+ end
147
+ return nil
148
+ end
149
+
150
+ # Renders a report definition hash into XML text.
151
+ def report_definition_to_xml(report_definition)
152
+ check_report_definition_hash(report_definition)
153
+ add_report_definition_hash_order(report_definition)
154
+ return Gyoku.xml({:report_definition => report_definition})
155
+ end
156
+
157
+ # Checks if the report definition looks correct.
158
+ def check_report_definition_hash(report_definition)
159
+ # Minimal set of fields required.
160
+ REQUIRED_FIELDS.each do |field|
161
+ unless report_definition.include?(field)
162
+ raise AdcenterApi::Errors::InvalidReportDefinitionError,
163
+ "Required field '%s' is missing in the definition" % field
164
+ end
165
+ end
166
+ # Fields list is also required.
167
+ unless report_definition[:selector].include?(:fields)
168
+ raise AdcenterApi::Errors::InvalidReportDefinitionError,
169
+ 'Fields list is required'
170
+ end
171
+ # 'Fields' must be an Array.
172
+ unless report_definition[:selector][:fields].kind_of?(Array)
173
+ raise AdcenterApi::Errors::InvalidReportDefinitionError,
174
+ 'Fields list must be an array'
175
+ end
176
+ # We should request at least one field.
177
+ if report_definition[:selector][:fields].empty?
178
+ raise AdcenterApi::Errors::InvalidReportDefinitionError,
179
+ 'At least one field needs to be requested'
180
+ end
181
+ end
182
+
183
+ # Adds fields order hint to generator based on specification.
184
+ def add_report_definition_hash_order(node, name = :root)
185
+ def_order = REPORT_DEFINITION_ORDER[name]
186
+ var_order = def_order.reject { |field| !node.include?(field) }
187
+ node.keys.each do |key|
188
+ if REPORT_DEFINITION_ORDER.include?(key)
189
+ case node[key]
190
+ when Hash
191
+ add_report_definition_hash_order(node[key], key)
192
+ when Array
193
+ node[key].each do |item|
194
+ add_report_definition_hash_order(item, key)
195
+ end
196
+ end
197
+ end
198
+ end
199
+ node[:order!] = var_order
200
+ return nil
201
+ end
202
+ end
203
+ 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:14.
9
+
10
+ require 'ads_common/savon_service'
11
+ require 'adcenter_api/v7/administration_service_registry'
12
+
13
+ module AdcenterApi; module V7; module AdministrationService
14
+ class AdministrationService < AdsCommon::SavonService
15
+ def initialize(config, endpoint)
16
+ namespace = 'https://adcenter.microsoft.com/v7'
17
+ super(config, endpoint, namespace, :v7)
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 AdcenterApi::V7::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:14.
9
+
10
+ require 'adcenter_api/errors'
11
+
12
+ module AdcenterApi; module V7; 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,398 @@
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:16.
9
+
10
+ require 'ads_common/savon_service'
11
+ require 'adcenter_api/v7/campaign_management_service_registry'
12
+
13
+ module AdcenterApi; module V7; module CampaignManagementService
14
+ class CampaignManagementService < AdsCommon::SavonService
15
+ def initialize(config, endpoint)
16
+ namespace = 'https://adcenter.microsoft.com/v7'
17
+ super(config, endpoint, namespace, :v7)
18
+ end
19
+
20
+ def set_networks_to_ad_groups(*args, &block)
21
+ return execute_action('set_networks_to_ad_groups', args, &block)
22
+ end
23
+
24
+ def add_goals(*args, &block)
25
+ return execute_action('add_goals', args, &block)
26
+ end
27
+
28
+ def update_goals(*args, &block)
29
+ return execute_action('update_goals', args, &block)
30
+ end
31
+
32
+ def get_goals(*args, &block)
33
+ return execute_action('get_goals', args, &block)
34
+ end
35
+
36
+ def delete_goals(*args, &block)
37
+ return execute_action('delete_goals', args, &block)
38
+ end
39
+
40
+ def set_analytics_type(*args, &block)
41
+ return execute_action('set_analytics_type', args, &block)
42
+ end
43
+
44
+ def get_analytics_type(*args, &block)
45
+ return execute_action('get_analytics_type', args, &block)
46
+ end
47
+
48
+ def get_account_migration_statuses(*args, &block)
49
+ return execute_action('get_account_migration_statuses', args, &block)
50
+ end
51
+
52
+ def pause_ads(*args, &block)
53
+ return execute_action('pause_ads', args, &block)
54
+ end
55
+
56
+ def resume_ads(*args, &block)
57
+ return execute_action('resume_ads', args, &block)
58
+ end
59
+
60
+ def add_keywords(*args, &block)
61
+ return execute_action('add_keywords', args, &block)
62
+ end
63
+
64
+ def delete_keywords(*args, &block)
65
+ return execute_action('delete_keywords', args, &block)
66
+ end
67
+
68
+ def get_keywords_by_editorial_status(*args, &block)
69
+ return execute_action('get_keywords_by_editorial_status', args, &block)
70
+ end
71
+
72
+ def get_keywords_by_ids(*args, &block)
73
+ return execute_action('get_keywords_by_ids', args, &block)
74
+ end
75
+
76
+ def get_keywords_by_ad_group_id(*args, &block)
77
+ return execute_action('get_keywords_by_ad_group_id', args, &block)
78
+ end
79
+
80
+ def pause_keywords(*args, &block)
81
+ return execute_action('pause_keywords', args, &block)
82
+ end
83
+
84
+ def resume_keywords(*args, &block)
85
+ return execute_action('resume_keywords', args, &block)
86
+ end
87
+
88
+ def update_keywords(*args, &block)
89
+ return execute_action('update_keywords', args, &block)
90
+ end
91
+
92
+ def get_keyword_estimates_by_bids(*args, &block)
93
+ return execute_action('get_keyword_estimates_by_bids', args, &block)
94
+ end
95
+
96
+ def add_businesses(*args, &block)
97
+ return execute_action('add_businesses', args, &block)
98
+ end
99
+
100
+ def update_businesses(*args, &block)
101
+ return execute_action('update_businesses', args, &block)
102
+ end
103
+
104
+ def delete_businesses(*args, &block)
105
+ return execute_action('delete_businesses', args, &block)
106
+ end
107
+
108
+ def get_businesses_info(*args, &block)
109
+ return execute_action('get_businesses_info', args, &block)
110
+ end
111
+
112
+ def get_businesses_by_ids(*args, &block)
113
+ return execute_action('get_businesses_by_ids', args, &block)
114
+ end
115
+
116
+ def add_site_placements(*args, &block)
117
+ return execute_action('add_site_placements', args, &block)
118
+ end
119
+
120
+ def delete_site_placements(*args, &block)
121
+ return execute_action('delete_site_placements', args, &block)
122
+ end
123
+
124
+ def get_site_placements_by_ids(*args, &block)
125
+ return execute_action('get_site_placements_by_ids', args, &block)
126
+ end
127
+
128
+ def get_site_placements_by_ad_group_id(*args, &block)
129
+ return execute_action('get_site_placements_by_ad_group_id', args, &block)
130
+ end
131
+
132
+ def pause_site_placements(*args, &block)
133
+ return execute_action('pause_site_placements', args, &block)
134
+ end
135
+
136
+ def resume_site_placements(*args, &block)
137
+ return execute_action('resume_site_placements', args, &block)
138
+ end
139
+
140
+ def update_site_placements(*args, &block)
141
+ return execute_action('update_site_placements', args, &block)
142
+ end
143
+
144
+ def get_placement_details_for_urls(*args, &block)
145
+ return execute_action('get_placement_details_for_urls', args, &block)
146
+ end
147
+
148
+ def add_behavioral_bids(*args, &block)
149
+ return execute_action('add_behavioral_bids', args, &block)
150
+ end
151
+
152
+ def delete_behavioral_bids(*args, &block)
153
+ return execute_action('delete_behavioral_bids', args, &block)
154
+ end
155
+
156
+ def get_behavioral_bids_by_ids(*args, &block)
157
+ return execute_action('get_behavioral_bids_by_ids', args, &block)
158
+ end
159
+
160
+ def get_behavioral_bids_by_ad_group_id(*args, &block)
161
+ return execute_action('get_behavioral_bids_by_ad_group_id', args, &block)
162
+ end
163
+
164
+ def pause_behavioral_bids(*args, &block)
165
+ return execute_action('pause_behavioral_bids', args, &block)
166
+ end
167
+
168
+ def resume_behavioral_bids(*args, &block)
169
+ return execute_action('resume_behavioral_bids', args, &block)
170
+ end
171
+
172
+ def update_behavioral_bids(*args, &block)
173
+ return execute_action('update_behavioral_bids', args, &block)
174
+ end
175
+
176
+ def get_custom_segments(*args, &block)
177
+ return execute_action('get_custom_segments', args, &block)
178
+ end
179
+
180
+ def add_segments(*args, &block)
181
+ return execute_action('add_segments', args, &block)
182
+ end
183
+
184
+ def delete_segments(*args, &block)
185
+ return execute_action('delete_segments', args, &block)
186
+ end
187
+
188
+ def get_segments_by_ids(*args, &block)
189
+ return execute_action('get_segments_by_ids', args, &block)
190
+ end
191
+
192
+ def get_segments(*args, &block)
193
+ return execute_action('get_segments', args, &block)
194
+ end
195
+
196
+ def set_users_to_segments(*args, &block)
197
+ return execute_action('set_users_to_segments', args, &block)
198
+ end
199
+
200
+ def delete_users_from_segment(*args, &block)
201
+ return execute_action('delete_users_from_segment', args, &block)
202
+ end
203
+
204
+ def get_normalized_strings(*args, &block)
205
+ return execute_action('get_normalized_strings', args, &block)
206
+ end
207
+
208
+ def get_keyword_editorial_reasons_by_ids(*args, &block)
209
+ return execute_action('get_keyword_editorial_reasons_by_ids', args, &block)
210
+ end
211
+
212
+ def get_ad_editorial_reasons_by_ids(*args, &block)
213
+ return execute_action('get_ad_editorial_reasons_by_ids', args, &block)
214
+ end
215
+
216
+ def get_networks_by_ad_group_ids(*args, &block)
217
+ return execute_action('get_networks_by_ad_group_ids', args, &block)
218
+ end
219
+
220
+ def add_campaigns(*args, &block)
221
+ return execute_action('add_campaigns', args, &block)
222
+ end
223
+
224
+ def get_campaigns_by_account_id(*args, &block)
225
+ return execute_action('get_campaigns_by_account_id', args, &block)
226
+ end
227
+
228
+ def get_campaigns_by_ids(*args, &block)
229
+ return execute_action('get_campaigns_by_ids', args, &block)
230
+ end
231
+
232
+ def pause_campaigns(*args, &block)
233
+ return execute_action('pause_campaigns', args, &block)
234
+ end
235
+
236
+ def resume_campaigns(*args, &block)
237
+ return execute_action('resume_campaigns', args, &block)
238
+ end
239
+
240
+ def delete_campaigns(*args, &block)
241
+ return execute_action('delete_campaigns', args, &block)
242
+ end
243
+
244
+ def update_campaigns(*args, &block)
245
+ return execute_action('update_campaigns', args, &block)
246
+ end
247
+
248
+ def get_campaigns_info_by_account_id(*args, &block)
249
+ return execute_action('get_campaigns_info_by_account_id', args, &block)
250
+ end
251
+
252
+ def get_negative_keywords_by_campaign_ids(*args, &block)
253
+ return execute_action('get_negative_keywords_by_campaign_ids', args, &block)
254
+ end
255
+
256
+ def set_negative_keywords_to_campaigns(*args, &block)
257
+ return execute_action('set_negative_keywords_to_campaigns', args, &block)
258
+ end
259
+
260
+ def add_ad_groups(*args, &block)
261
+ return execute_action('add_ad_groups', args, &block)
262
+ end
263
+
264
+ def delete_ad_groups(*args, &block)
265
+ return execute_action('delete_ad_groups', args, &block)
266
+ end
267
+
268
+ def get_ad_groups_by_ids(*args, &block)
269
+ return execute_action('get_ad_groups_by_ids', args, &block)
270
+ end
271
+
272
+ def get_ad_groups_by_campaign_id(*args, &block)
273
+ return execute_action('get_ad_groups_by_campaign_id', args, &block)
274
+ end
275
+
276
+ def pause_ad_groups(*args, &block)
277
+ return execute_action('pause_ad_groups', args, &block)
278
+ end
279
+
280
+ def resume_ad_groups(*args, &block)
281
+ return execute_action('resume_ad_groups', args, &block)
282
+ end
283
+
284
+ def submit_ad_group_for_approval(*args, &block)
285
+ return execute_action('submit_ad_group_for_approval', args, &block)
286
+ end
287
+
288
+ def update_ad_groups(*args, &block)
289
+ return execute_action('update_ad_groups', args, &block)
290
+ end
291
+
292
+ def get_ad_groups_info_by_campaign_id(*args, &block)
293
+ return execute_action('get_ad_groups_info_by_campaign_id', args, &block)
294
+ end
295
+
296
+ def get_negative_keywords_by_ad_group_ids(*args, &block)
297
+ return execute_action('get_negative_keywords_by_ad_group_ids', args, &block)
298
+ end
299
+
300
+ def set_negative_keywords_to_ad_groups(*args, &block)
301
+ return execute_action('set_negative_keywords_to_ad_groups', args, &block)
302
+ end
303
+
304
+ def add_target(*args, &block)
305
+ return execute_action('add_target', args, &block)
306
+ end
307
+
308
+ def delete_target(*args, &block)
309
+ return execute_action('delete_target', args, &block)
310
+ end
311
+
312
+ def get_target_by_ad_group_id(*args, &block)
313
+ return execute_action('get_target_by_ad_group_id', args, &block)
314
+ end
315
+
316
+ def update_target(*args, &block)
317
+ return execute_action('update_target', args, &block)
318
+ end
319
+
320
+ def add_targets_to_library(*args, &block)
321
+ return execute_action('add_targets_to_library', args, &block)
322
+ end
323
+
324
+ def update_targets_in_library(*args, &block)
325
+ return execute_action('update_targets_in_library', args, &block)
326
+ end
327
+
328
+ def delete_targets_from_library(*args, &block)
329
+ return execute_action('delete_targets_from_library', args, &block)
330
+ end
331
+
332
+ def get_targets_info_from_library(*args, &block)
333
+ return execute_action('get_targets_info_from_library', args, &block)
334
+ end
335
+
336
+ def get_targets_by_ids(*args, &block)
337
+ return execute_action('get_targets_by_ids', args, &block)
338
+ end
339
+
340
+ def set_target_to_ad_group(*args, &block)
341
+ return execute_action('set_target_to_ad_group', args, &block)
342
+ end
343
+
344
+ def delete_target_from_ad_group(*args, &block)
345
+ return execute_action('delete_target_from_ad_group', args, &block)
346
+ end
347
+
348
+ def get_targets_by_ad_group_ids(*args, &block)
349
+ return execute_action('get_targets_by_ad_group_ids', args, &block)
350
+ end
351
+
352
+ def set_target_to_campaign(*args, &block)
353
+ return execute_action('set_target_to_campaign', args, &block)
354
+ end
355
+
356
+ def delete_target_from_campaign(*args, &block)
357
+ return execute_action('delete_target_from_campaign', args, &block)
358
+ end
359
+
360
+ def get_targets_by_campaign_ids(*args, &block)
361
+ return execute_action('get_targets_by_campaign_ids', args, &block)
362
+ end
363
+
364
+ def add_ads(*args, &block)
365
+ return execute_action('add_ads', args, &block)
366
+ end
367
+
368
+ def delete_ads(*args, &block)
369
+ return execute_action('delete_ads', args, &block)
370
+ end
371
+
372
+ def get_ads_by_editorial_status(*args, &block)
373
+ return execute_action('get_ads_by_editorial_status', args, &block)
374
+ end
375
+
376
+ def get_ads_by_ids(*args, &block)
377
+ return execute_action('get_ads_by_ids', args, &block)
378
+ end
379
+
380
+ def get_ads_by_ad_group_id(*args, &block)
381
+ return execute_action('get_ads_by_ad_group_id', args, &block)
382
+ end
383
+
384
+ def update_ads(*args, &block)
385
+ return execute_action('update_ads', args, &block)
386
+ end
387
+
388
+ private
389
+
390
+ def get_service_registry()
391
+ return CampaignManagementServiceRegistry
392
+ end
393
+
394
+ def get_module()
395
+ return AdcenterApi::V7::CampaignManagementService
396
+ end
397
+ end
398
+ end; end; end