google-adwords-api 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (247) hide show
  1. data/ChangeLog +3 -0
  2. data/README +4 -7
  3. data/examples/v201206/account_management/create_account.rb +84 -0
  4. data/examples/v201206/account_management/get_account_alerts.rb +111 -0
  5. data/examples/v201206/account_management/get_account_changes.rb +137 -0
  6. data/examples/v201206/account_management/get_account_hierarchy.rb +92 -0
  7. data/examples/v201206/account_management/get_client_customer_id.rb +85 -0
  8. data/examples/v201206/account_management/get_client_unit_usage.rb +87 -0
  9. data/examples/v201206/basic_operations/add_ad_groups.rb +136 -0
  10. data/examples/v201206/basic_operations/add_campaigns.rb +146 -0
  11. data/examples/v201206/basic_operations/add_keywords.rb +108 -0
  12. data/examples/v201206/basic_operations/add_text_ads.rb +105 -0
  13. data/examples/v201206/basic_operations/delete_ad.rb +85 -0
  14. data/examples/v201206/basic_operations/delete_ad_group.rb +102 -0
  15. data/examples/v201206/basic_operations/delete_campaign.rb +103 -0
  16. data/examples/v201206/basic_operations/delete_keyword.rb +90 -0
  17. data/examples/v201206/basic_operations/get_ad_groups.rb +98 -0
  18. data/examples/v201206/basic_operations/get_campaigns.rb +93 -0
  19. data/examples/v201206/basic_operations/get_campaigns_with_awql.rb +85 -0
  20. data/examples/v201206/basic_operations/get_keywords.rb +104 -0
  21. data/examples/v201206/basic_operations/get_text_ads.rb +106 -0
  22. data/examples/v201206/basic_operations/pause_ad.rb +84 -0
  23. data/examples/v201206/basic_operations/update_ad_group.rb +81 -0
  24. data/examples/v201206/basic_operations/update_campaign.rb +84 -0
  25. data/examples/v201206/basic_operations/update_keyword.rb +99 -0
  26. data/examples/v201206/campaign_management/add_experiment.rb +158 -0
  27. data/examples/v201206/campaign_management/add_keywords_in_bulk.rb +150 -0
  28. data/examples/v201206/campaign_management/add_location_extension.rb +117 -0
  29. data/examples/v201206/campaign_management/add_location_extension_override.rb +83 -0
  30. data/examples/v201206/campaign_management/get_all_disapproved_ads.rb +93 -0
  31. data/examples/v201206/campaign_management/get_all_disapproved_ads_with_awql.rb +84 -0
  32. data/examples/v201206/campaign_management/promote_experiment.rb +77 -0
  33. data/examples/v201206/campaign_management/set_ad_parameters.rb +114 -0
  34. data/examples/v201206/campaign_management/validate_text_ad.rb +106 -0
  35. data/examples/v201206/error_handling/handle_captcha_challenge.rb +93 -0
  36. data/examples/v201206/error_handling/handle_partial_failures.rb +126 -0
  37. data/examples/v201206/error_handling/handle_policy_violation_error.rb +137 -0
  38. data/examples/v201206/error_handling/handle_two_factor_authorization_error.rb +87 -0
  39. data/examples/v201206/misc/get_all_images_and_videos.rb +101 -0
  40. data/examples/v201206/misc/upload_image.rb +90 -0
  41. data/examples/v201206/misc/use_oauth.rb +100 -0
  42. data/examples/v201206/misc/use_oauth2.rb +97 -0
  43. data/examples/v201206/optimization/estimate_keyword_traffic.rb +129 -0
  44. data/examples/v201206/optimization/get_keyword_bid_simulations.rb +92 -0
  45. data/examples/v201206/optimization/get_keyword_ideas.rb +115 -0
  46. data/examples/v201206/optimization/get_placement_ideas.rb +106 -0
  47. data/examples/v201206/remarketing/add_audience.rb +115 -0
  48. data/examples/v201206/remarketing/add_conversion_tracker.rb +97 -0
  49. data/examples/v201206/reporting/download_criteria_report.rb +79 -0
  50. data/examples/v201206/reporting/download_criteria_report_with_awql.rb +78 -0
  51. data/examples/v201206/reporting/get_campaign_stats.rb +105 -0
  52. data/examples/v201206/reporting/get_defined_reports.rb +75 -0
  53. data/examples/v201206/reporting/get_report_fields.rb +71 -0
  54. data/examples/v201206/reporting/parallel_report_download.rb +159 -0
  55. data/examples/v201206/targeting/add_campaign_targeting_criteria.rb +118 -0
  56. data/examples/v201206/targeting/get_campaign_targeting_criteria.rb +102 -0
  57. data/examples/v201206/targeting/get_targetable_languages_and_carriers.rb +86 -0
  58. data/examples/v201206/targeting/lookup_location.rb +104 -0
  59. data/lib/adwords_api/api_config.rb +69 -5
  60. data/lib/adwords_api/report_utils.rb +50 -1
  61. data/lib/adwords_api/v201109/ad_extension_override_service.rb +1 -1
  62. data/lib/adwords_api/v201109/ad_extension_override_service_registry.rb +1 -1
  63. data/lib/adwords_api/v201109/ad_group_ad_service.rb +1 -1
  64. data/lib/adwords_api/v201109/ad_group_ad_service_registry.rb +1 -1
  65. data/lib/adwords_api/v201109/ad_group_criterion_service.rb +1 -1
  66. data/lib/adwords_api/v201109/ad_group_criterion_service_registry.rb +1 -1
  67. data/lib/adwords_api/v201109/ad_group_service.rb +1 -1
  68. data/lib/adwords_api/v201109/ad_group_service_registry.rb +1 -1
  69. data/lib/adwords_api/v201109/ad_param_service.rb +1 -1
  70. data/lib/adwords_api/v201109/ad_param_service_registry.rb +1 -1
  71. data/lib/adwords_api/v201109/alert_service.rb +1 -1
  72. data/lib/adwords_api/v201109/alert_service_registry.rb +1 -1
  73. data/lib/adwords_api/v201109/budget_order_service.rb +1 -1
  74. data/lib/adwords_api/v201109/budget_order_service_registry.rb +1 -1
  75. data/lib/adwords_api/v201109/bulk_mutate_job_service.rb +1 -1
  76. data/lib/adwords_api/v201109/bulk_mutate_job_service_registry.rb +1 -1
  77. data/lib/adwords_api/v201109/campaign_ad_extension_service.rb +1 -1
  78. data/lib/adwords_api/v201109/campaign_ad_extension_service_registry.rb +1 -1
  79. data/lib/adwords_api/v201109/campaign_criterion_service.rb +1 -1
  80. data/lib/adwords_api/v201109/campaign_criterion_service_registry.rb +1 -1
  81. data/lib/adwords_api/v201109/campaign_service.rb +1 -1
  82. data/lib/adwords_api/v201109/campaign_service_registry.rb +1 -1
  83. data/lib/adwords_api/v201109/campaign_target_service.rb +1 -1
  84. data/lib/adwords_api/v201109/campaign_target_service_registry.rb +1 -1
  85. data/lib/adwords_api/v201109/constant_data_service.rb +1 -1
  86. data/lib/adwords_api/v201109/constant_data_service_registry.rb +1 -1
  87. data/lib/adwords_api/v201109/conversion_tracker_service.rb +1 -1
  88. data/lib/adwords_api/v201109/conversion_tracker_service_registry.rb +1 -1
  89. data/lib/adwords_api/v201109/create_account_service.rb +1 -1
  90. data/lib/adwords_api/v201109/create_account_service_registry.rb +1 -1
  91. data/lib/adwords_api/v201109/customer_sync_service.rb +1 -1
  92. data/lib/adwords_api/v201109/customer_sync_service_registry.rb +1 -1
  93. data/lib/adwords_api/v201109/data_service.rb +1 -1
  94. data/lib/adwords_api/v201109/data_service_registry.rb +1 -1
  95. data/lib/adwords_api/v201109/experiment_service.rb +1 -1
  96. data/lib/adwords_api/v201109/experiment_service_registry.rb +1 -1
  97. data/lib/adwords_api/v201109/geo_location_service.rb +1 -1
  98. data/lib/adwords_api/v201109/geo_location_service_registry.rb +1 -1
  99. data/lib/adwords_api/v201109/info_service.rb +1 -1
  100. data/lib/adwords_api/v201109/info_service_registry.rb +1 -1
  101. data/lib/adwords_api/v201109/location_criterion_service.rb +1 -1
  102. data/lib/adwords_api/v201109/location_criterion_service_registry.rb +1 -1
  103. data/lib/adwords_api/v201109/media_service.rb +1 -1
  104. data/lib/adwords_api/v201109/media_service_registry.rb +1 -1
  105. data/lib/adwords_api/v201109/mutate_job_service.rb +1 -1
  106. data/lib/adwords_api/v201109/mutate_job_service_registry.rb +1 -1
  107. data/lib/adwords_api/v201109/report_definition_service.rb +1 -1
  108. data/lib/adwords_api/v201109/report_definition_service_registry.rb +1 -1
  109. data/lib/adwords_api/v201109/serviced_account_service.rb +1 -1
  110. data/lib/adwords_api/v201109/serviced_account_service_registry.rb +1 -1
  111. data/lib/adwords_api/v201109/targeting_idea_service.rb +1 -1
  112. data/lib/adwords_api/v201109/targeting_idea_service_registry.rb +2 -2
  113. data/lib/adwords_api/v201109/traffic_estimator_service.rb +1 -1
  114. data/lib/adwords_api/v201109/traffic_estimator_service_registry.rb +1 -1
  115. data/lib/adwords_api/v201109/user_list_service.rb +1 -1
  116. data/lib/adwords_api/v201109/user_list_service_registry.rb +1 -1
  117. data/lib/adwords_api/v201109_1/ad_extension_override_service.rb +1 -1
  118. data/lib/adwords_api/v201109_1/ad_extension_override_service_registry.rb +1 -1
  119. data/lib/adwords_api/v201109_1/ad_group_ad_service.rb +1 -1
  120. data/lib/adwords_api/v201109_1/ad_group_ad_service_registry.rb +1 -1
  121. data/lib/adwords_api/v201109_1/ad_group_criterion_service.rb +1 -1
  122. data/lib/adwords_api/v201109_1/ad_group_criterion_service_registry.rb +1 -1
  123. data/lib/adwords_api/v201109_1/ad_group_service.rb +1 -1
  124. data/lib/adwords_api/v201109_1/ad_group_service_registry.rb +1 -1
  125. data/lib/adwords_api/v201109_1/ad_param_service.rb +1 -1
  126. data/lib/adwords_api/v201109_1/ad_param_service_registry.rb +1 -1
  127. data/lib/adwords_api/v201109_1/alert_service.rb +1 -1
  128. data/lib/adwords_api/v201109_1/alert_service_registry.rb +1 -1
  129. data/lib/adwords_api/v201109_1/budget_order_service.rb +1 -1
  130. data/lib/adwords_api/v201109_1/budget_order_service_registry.rb +1 -1
  131. data/lib/adwords_api/v201109_1/bulk_mutate_job_service.rb +1 -1
  132. data/lib/adwords_api/v201109_1/bulk_mutate_job_service_registry.rb +1 -1
  133. data/lib/adwords_api/v201109_1/campaign_ad_extension_service.rb +1 -1
  134. data/lib/adwords_api/v201109_1/campaign_ad_extension_service_registry.rb +1 -1
  135. data/lib/adwords_api/v201109_1/campaign_criterion_service.rb +1 -1
  136. data/lib/adwords_api/v201109_1/campaign_criterion_service_registry.rb +1 -1
  137. data/lib/adwords_api/v201109_1/campaign_service.rb +1 -1
  138. data/lib/adwords_api/v201109_1/campaign_service_registry.rb +1 -1
  139. data/lib/adwords_api/v201109_1/campaign_target_service.rb +1 -1
  140. data/lib/adwords_api/v201109_1/campaign_target_service_registry.rb +1 -1
  141. data/lib/adwords_api/v201109_1/constant_data_service.rb +1 -1
  142. data/lib/adwords_api/v201109_1/constant_data_service_registry.rb +1 -1
  143. data/lib/adwords_api/v201109_1/conversion_tracker_service.rb +1 -1
  144. data/lib/adwords_api/v201109_1/conversion_tracker_service_registry.rb +1 -1
  145. data/lib/adwords_api/v201109_1/create_account_service.rb +1 -1
  146. data/lib/adwords_api/v201109_1/create_account_service_registry.rb +1 -1
  147. data/lib/adwords_api/v201109_1/customer_service.rb +34 -0
  148. data/lib/adwords_api/v201109_1/customer_service_registry.rb +46 -0
  149. data/lib/adwords_api/v201109_1/customer_sync_service.rb +1 -1
  150. data/lib/adwords_api/v201109_1/customer_sync_service_registry.rb +1 -1
  151. data/lib/adwords_api/v201109_1/data_service.rb +1 -1
  152. data/lib/adwords_api/v201109_1/data_service_registry.rb +1 -1
  153. data/lib/adwords_api/v201109_1/experiment_service.rb +1 -1
  154. data/lib/adwords_api/v201109_1/experiment_service_registry.rb +1 -1
  155. data/lib/adwords_api/v201109_1/geo_location_service.rb +1 -1
  156. data/lib/adwords_api/v201109_1/geo_location_service_registry.rb +1 -1
  157. data/lib/adwords_api/v201109_1/info_service.rb +1 -1
  158. data/lib/adwords_api/v201109_1/info_service_registry.rb +1 -1
  159. data/lib/adwords_api/v201109_1/location_criterion_service.rb +1 -1
  160. data/lib/adwords_api/v201109_1/location_criterion_service_registry.rb +1 -1
  161. data/lib/adwords_api/v201109_1/managed_customer_service.rb +38 -0
  162. data/lib/adwords_api/v201109_1/managed_customer_service_registry.rb +46 -0
  163. data/lib/adwords_api/v201109_1/media_service.rb +1 -1
  164. data/lib/adwords_api/v201109_1/media_service_registry.rb +1 -1
  165. data/lib/adwords_api/v201109_1/mutate_job_service.rb +1 -1
  166. data/lib/adwords_api/v201109_1/mutate_job_service_registry.rb +1 -1
  167. data/lib/adwords_api/v201109_1/report_definition_service.rb +1 -1
  168. data/lib/adwords_api/v201109_1/report_definition_service_registry.rb +1 -1
  169. data/lib/adwords_api/v201109_1/serviced_account_service.rb +1 -1
  170. data/lib/adwords_api/v201109_1/serviced_account_service_registry.rb +1 -1
  171. data/lib/adwords_api/v201109_1/targeting_idea_service.rb +1 -1
  172. data/lib/adwords_api/v201109_1/targeting_idea_service_registry.rb +2 -2
  173. data/lib/adwords_api/v201109_1/traffic_estimator_service.rb +1 -1
  174. data/lib/adwords_api/v201109_1/traffic_estimator_service_registry.rb +1 -1
  175. data/lib/adwords_api/v201109_1/user_list_service.rb +1 -1
  176. data/lib/adwords_api/v201109_1/user_list_service_registry.rb +1 -1
  177. data/lib/adwords_api/v201206/ad_extension_override_service.rb +38 -0
  178. data/lib/adwords_api/v201206/ad_extension_override_service_registry.rb +46 -0
  179. data/lib/adwords_api/v201206/ad_group_ad_service.rb +42 -0
  180. data/lib/adwords_api/v201206/ad_group_ad_service_registry.rb +46 -0
  181. data/lib/adwords_api/v201206/ad_group_criterion_service.rb +42 -0
  182. data/lib/adwords_api/v201206/ad_group_criterion_service_registry.rb +46 -0
  183. data/lib/adwords_api/v201206/ad_group_service.rb +42 -0
  184. data/lib/adwords_api/v201206/ad_group_service_registry.rb +46 -0
  185. data/lib/adwords_api/v201206/ad_param_service.rb +38 -0
  186. data/lib/adwords_api/v201206/ad_param_service_registry.rb +46 -0
  187. data/lib/adwords_api/v201206/alert_service.rb +34 -0
  188. data/lib/adwords_api/v201206/alert_service_registry.rb +46 -0
  189. data/lib/adwords_api/v201206/budget_order_service.rb +42 -0
  190. data/lib/adwords_api/v201206/budget_order_service_registry.rb +46 -0
  191. data/lib/adwords_api/v201206/bulk_mutate_job_service.rb +38 -0
  192. data/lib/adwords_api/v201206/bulk_mutate_job_service_registry.rb +46 -0
  193. data/lib/adwords_api/v201206/campaign_ad_extension_service.rb +38 -0
  194. data/lib/adwords_api/v201206/campaign_ad_extension_service_registry.rb +46 -0
  195. data/lib/adwords_api/v201206/campaign_criterion_service.rb +42 -0
  196. data/lib/adwords_api/v201206/campaign_criterion_service_registry.rb +46 -0
  197. data/lib/adwords_api/v201206/campaign_service.rb +42 -0
  198. data/lib/adwords_api/v201206/campaign_service_registry.rb +46 -0
  199. data/lib/adwords_api/v201206/constant_data_service.rb +62 -0
  200. data/lib/adwords_api/v201206/constant_data_service_registry.rb +46 -0
  201. data/lib/adwords_api/v201206/conversion_tracker_service.rb +38 -0
  202. data/lib/adwords_api/v201206/conversion_tracker_service_registry.rb +46 -0
  203. data/lib/adwords_api/v201206/customer_service.rb +34 -0
  204. data/lib/adwords_api/v201206/customer_service_registry.rb +46 -0
  205. data/lib/adwords_api/v201206/customer_sync_service.rb +34 -0
  206. data/lib/adwords_api/v201206/customer_sync_service_registry.rb +47 -0
  207. data/lib/adwords_api/v201206/data_service.rb +38 -0
  208. data/lib/adwords_api/v201206/data_service_registry.rb +46 -0
  209. data/lib/adwords_api/v201206/experiment_service.rb +38 -0
  210. data/lib/adwords_api/v201206/experiment_service_registry.rb +46 -0
  211. data/lib/adwords_api/v201206/geo_location_service.rb +34 -0
  212. data/lib/adwords_api/v201206/geo_location_service_registry.rb +46 -0
  213. data/lib/adwords_api/v201206/info_service.rb +34 -0
  214. data/lib/adwords_api/v201206/info_service_registry.rb +46 -0
  215. data/lib/adwords_api/v201206/location_criterion_service.rb +34 -0
  216. data/lib/adwords_api/v201206/location_criterion_service_registry.rb +46 -0
  217. data/lib/adwords_api/v201206/managed_customer_service.rb +38 -0
  218. data/lib/adwords_api/v201206/managed_customer_service_registry.rb +46 -0
  219. data/lib/adwords_api/v201206/media_service.rb +38 -0
  220. data/lib/adwords_api/v201206/media_service_registry.rb +46 -0
  221. data/lib/adwords_api/v201206/mutate_job_service.rb +42 -0
  222. data/lib/adwords_api/v201206/mutate_job_service_registry.rb +46 -0
  223. data/lib/adwords_api/v201206/report_definition_service.rb +34 -0
  224. data/lib/adwords_api/v201206/report_definition_service_registry.rb +46 -0
  225. data/lib/adwords_api/v201206/targeting_idea_service.rb +38 -0
  226. data/lib/adwords_api/v201206/targeting_idea_service_registry.rb +46 -0
  227. data/lib/adwords_api/v201206/traffic_estimator_service.rb +34 -0
  228. data/lib/adwords_api/v201206/traffic_estimator_service_registry.rb +46 -0
  229. data/lib/adwords_api/v201206/user_list_service.rb +38 -0
  230. data/lib/adwords_api/v201206/user_list_service_registry.rb +46 -0
  231. data/lib/adwords_api/version.rb +1 -1
  232. data/test/adwords_api/test_api_config.rb +10 -10
  233. data/test/adwords_api/test_report_utils.rb +1 -1
  234. data/test/bugs/test_issue_00000031.rb +14 -14
  235. data/test/bugs/test_issue_00000063.rb +6 -6
  236. data/test/examples/v201206/test_account_management.rb +60 -0
  237. data/test/examples/v201206/test_basic_operations.rb +177 -0
  238. data/test/examples/v201206/test_campaign_management.rb +124 -0
  239. data/test/examples/v201206/test_error_handling.rb +63 -0
  240. data/test/examples/v201206/test_misc.rb +45 -0
  241. data/test/examples/v201206/test_optimization.rb +63 -0
  242. data/test/examples/v201206/test_remarketing.rb +39 -0
  243. data/test/examples/v201206/test_reporting.rb +89 -0
  244. data/test/examples/v201206/test_targeting.rb +60 -0
  245. data/test/examples/v201206/utils.rb +239 -0
  246. data/test/suite_exampletests_v201206.rb +37 -0
  247. metadata +155 -50
@@ -21,6 +21,6 @@
21
21
 
22
22
  module AdwordsApi
23
23
  module ApiConfig
24
- CLIENT_LIB_VERSION = '0.6.2'
24
+ CLIENT_LIB_VERSION = '0.6.3'
25
25
  end
26
26
  end
@@ -32,35 +32,35 @@ class TestApiConfig < Test::Unit::TestCase
32
32
 
33
33
  # Tests correct require path.
34
34
  def test_do_require()
35
- name1 = @config.do_require(:v201109, :InfoService)
36
- assert_equal('adwords_api/v201109/info_service', name1)
35
+ name1 = @config.do_require(:v201206, :InfoService)
36
+ assert_equal('adwords_api/v201206/info_service', name1)
37
37
  end
38
38
 
39
39
  # Tests correct module name.
40
40
  def test_module_name()
41
- name1 = @config.module_name(:v201109, :InfoService)
42
- assert_equal('AdwordsApi::V201109::InfoService', name1)
41
+ name1 = @config.module_name(:v201206, :InfoService)
42
+ assert_equal('AdwordsApi::V201206::InfoService', name1)
43
43
  end
44
44
 
45
45
  # Tests correct interface name.
46
46
  def test_interface_name()
47
- name1 = @config.interface_name(:v201109, :InfoService)
48
- assert_equal('AdwordsApi::V201109::InfoService::InfoService', name1)
47
+ name1 = @config.interface_name(:v201206, :InfoService)
48
+ assert_equal('AdwordsApi::V201206::InfoService::InfoService', name1)
49
49
  end
50
50
 
51
51
  # Tests AdHoc report URL generator (prod).
52
52
  def test_adhoc_report_download_url_prod()
53
- url = AdwordsApi::ApiConfig.adhoc_report_download_url(:PRODUCTION, :v201109)
53
+ url = AdwordsApi::ApiConfig.adhoc_report_download_url(:PRODUCTION, :v201206)
54
54
  expected_url =
55
- 'https://adwords.google.com/api/adwords/reportdownload/v201109'
55
+ 'https://adwords.google.com/api/adwords/reportdownload/v201206'
56
56
  assert_equal(expected_url, url)
57
57
  end
58
58
 
59
59
  # Tests AdHoc report URL generator (sandbox).
60
60
  def test_adhoc_report_download_url_sandbox()
61
- url = AdwordsApi::ApiConfig.adhoc_report_download_url(:SANDBOX, :v201109)
61
+ url = AdwordsApi::ApiConfig.adhoc_report_download_url(:SANDBOX, :v201206)
62
62
  expected_url =
63
- 'https://adwords-sandbox.google.com/api/adwords/reportdownload/v201109'
63
+ 'https://adwords-sandbox.google.com/api/adwords/reportdownload/v201206'
64
64
  assert_equal(expected_url, url)
65
65
  end
66
66
  end
@@ -24,7 +24,7 @@ require 'test/unit'
24
24
 
25
25
  require 'adwords_api'
26
26
 
27
- API_VERSION = :v201109
27
+ API_VERSION = :v201206
28
28
 
29
29
  # Overriding default access levels to public for tests.
30
30
  module AdwordsApi
@@ -25,12 +25,12 @@ require 'test/unit'
25
25
 
26
26
  require 'ads_common/parameters_validator'
27
27
  require 'adwords_api'
28
- require 'adwords_api/v201109/targeting_idea_service_registry'
28
+ require 'adwords_api/v201206/targeting_idea_service_registry'
29
29
 
30
30
  class TestIssue31 < Test::Unit::TestCase
31
31
  def setup()
32
32
  @registry =
33
- AdwordsApi::V201109::TargetingIdeaService::TargetingIdeaServiceRegistry
33
+ AdwordsApi::V201206::TargetingIdeaService::TargetingIdeaServiceRegistry
34
34
  end
35
35
 
36
36
  def run_test(selector)
@@ -42,34 +42,34 @@ class TestIssue31 < Test::Unit::TestCase
42
42
  def test_issue_31_single_xsi_type()
43
43
  selector = {
44
44
  :search_parameters => [
45
- {:xsi_type => 'KeywordMatchTypeSearchParameter',
46
- :keyword_match_types => ['BROAD']}
45
+ {:xsi_type => 'RelatedToQuerySearchParameter',
46
+ :queries => ['test']}
47
47
  ]
48
48
  }
49
49
  result_xml = run_test(selector)
50
- r = /searchParameters xsi:type="KeywordMatchTypeSearchParameter"/ =~
50
+ r = /searchParameters xsi:type="RelatedToQuerySearchParameter"/ =~
51
51
  result_xml
52
52
  assert_not_nil(r, 'Unable to find item with xsi_type ' +
53
- 'KeywordMatchTypeSearchParameter')
53
+ 'RelatedToQuerySearchParameter')
54
54
  end
55
55
 
56
56
  def test_issue_31_multiple_xsi_types()
57
57
  selector = {
58
58
  :search_parameters => [
59
- {:xsi_type => 'AverageTargetedMonthlySearchesSearchParameter',
60
- :operation => { :minimum => 10000, :maximum => 100000000}},
61
- {:xsi_type => 'KeywordMatchTypeSearchParameter',
62
- :keyword_match_types => ['BROAD']}
59
+ {:xsi_type => 'CategoryProductsAndServicesSearchParameter',
60
+ :category_id => 42},
61
+ {:xsi_type => 'RelatedToQuerySearchParameter',
62
+ :queries => ['test']}
63
63
  ]
64
64
  }
65
65
  result_xml = run_test(selector)
66
- r1 = /searchParameters xsi:type="KeywordMatchTypeSearchParameter"/ =~
66
+ r1 = /searchParameters xsi:type="CategoryProductsAndServicesSearchParameter"/ =~
67
67
  result_xml
68
- r2 = /searchParameters xsi:type="AverageTargetedMonthlySearchesSearchParameter"/ =~
68
+ r2 = /searchParameters xsi:type="RelatedToQuerySearchParameter"/ =~
69
69
  result_xml
70
70
  assert_not_nil(r1, 'Unable to find item with xsi_type ' +
71
- 'KeywordMatchTypeSearchParameter')
71
+ 'CategoryProductsAndServicesSearchParameter')
72
72
  assert_not_nil(r2, 'Unable to find item with xsi_type ' +
73
- 'AverageTargetedMonthlySearchesSearchParameter')
73
+ 'RelatedToQuerySearchParameter')
74
74
  end
75
75
  end
@@ -26,12 +26,12 @@ require 'test/unit'
26
26
 
27
27
  require 'ads_common/results_extractor'
28
28
  require 'adwords_api'
29
- require 'adwords_api/v201109_1/mutate_job_service_registry'
29
+ require 'adwords_api/v201206/mutate_job_service_registry'
30
30
 
31
31
  class TestIssue63 < Test::Unit::TestCase
32
32
  def setup()
33
33
  @registry =
34
- AdwordsApi::V201109_1::MutateJobService::MutateJobServiceRegistry
34
+ AdwordsApi::V201206::MutateJobService::MutateJobServiceRegistry
35
35
  end
36
36
 
37
37
  def run_test(xml_text)
@@ -59,7 +59,7 @@ class TestIssue63 < Test::Unit::TestCase
59
59
  <?xml version="1.0"?>
60
60
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
61
61
  <soap:Header>
62
- <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109_1">
62
+ <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201206">
63
63
  <requestId>123</requestId>
64
64
  <serviceName>MutateJobService</serviceName>
65
65
  <methodName>getResult</methodName>
@@ -69,7 +69,7 @@ class TestIssue63 < Test::Unit::TestCase
69
69
  </ResponseHeader>
70
70
  </soap:Header>
71
71
  <soap:Body>
72
- <getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/v201109_1">
72
+ <getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/v201206">
73
73
  <rval>
74
74
  <SimpleMutateResult>
75
75
  <results>
@@ -98,7 +98,7 @@ EOT
98
98
  <?xml version="1.0"?>
99
99
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
100
100
  <soap:Header>
101
- <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201109_1">
101
+ <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201206">
102
102
  <requestId>123</requestId>
103
103
  <serviceName>MutateJobService</serviceName>
104
104
  <methodName>getResult</methodName>
@@ -108,7 +108,7 @@ EOT
108
108
  </ResponseHeader>
109
109
  </soap:Header>
110
110
  <soap:Body>
111
- <getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/v201109_1">
111
+ <getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/v201206">
112
112
  <rval>
113
113
  <SimpleMutateResult>
114
114
  <results>
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.dklimkin@gmail.com (Danial Klimkin)
5
+ #
6
+ # Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # Tests the account managements examples.
22
+
23
+ require 'test/unit'
24
+
25
+ require 'account_management/create_account'
26
+ require 'account_management/get_account_alerts'
27
+ require 'account_management/get_account_changes'
28
+ require 'account_management/get_account_hierarchy'
29
+ require 'account_management/get_client_customer_id'
30
+ require 'account_management/get_client_unit_usage'
31
+
32
+ class TestAccountManagementV201206 < Test::Unit::TestCase
33
+ def setup
34
+ end
35
+
36
+ # This test is disabled to avoid creating too many accounts.
37
+ def disabled_test_create_account
38
+ create_account()
39
+ end
40
+
41
+ def test_get_account_alerts
42
+ get_account_alerts()
43
+ end
44
+
45
+ def test_get_account_changes
46
+ get_account_changes()
47
+ end
48
+
49
+ def test_get_account_hierarchy
50
+ get_account_hierarchy()
51
+ end
52
+
53
+ def test_get_client_customer_id
54
+ get_client_customer_id('user@example.com')
55
+ end
56
+
57
+ def test_get_client_unit_usage
58
+ get_client_unit_usage(1234567890)
59
+ end
60
+ end
@@ -0,0 +1,177 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.dklimkin@gmail.com (Danial Klimkin)
5
+ #
6
+ # Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # Tests the basic operations examples.
22
+
23
+ require 'test/unit'
24
+
25
+ require 'basic_operations/add_ad_groups'
26
+ require 'basic_operations/add_campaigns'
27
+ require 'basic_operations/add_keywords'
28
+ require 'basic_operations/add_text_ads'
29
+ require 'basic_operations/delete_ad_group'
30
+ require 'basic_operations/delete_ad'
31
+ require 'basic_operations/delete_campaign'
32
+ require 'basic_operations/delete_keyword'
33
+ require 'basic_operations/get_ad_groups'
34
+ require 'basic_operations/get_campaigns'
35
+ require 'basic_operations/get_campaigns_with_awql'
36
+ require 'basic_operations/get_keywords'
37
+ require 'basic_operations/get_text_ads'
38
+ require 'basic_operations/pause_ad'
39
+ require 'basic_operations/update_ad_group'
40
+ require 'basic_operations/update_campaign'
41
+ require 'basic_operations/update_keyword'
42
+
43
+ class TestBasicOperationsV201206 < Test::Unit::TestCase
44
+ def setup
45
+ @logger = Logger.new(STDOUT)
46
+ @logger.level = Logger::ERROR
47
+ @adwords = AdwordsApi::Api.new
48
+ @adwords.logger = @logger
49
+ @utils = UtilsV201206.new(@adwords)
50
+ end
51
+
52
+ def test_add_campaigns
53
+ add_campaigns()
54
+ end
55
+
56
+ def test_get_campaigns
57
+ get_campaigns()
58
+ end
59
+
60
+ def test_get_campaigns_with_awql
61
+ get_campaigns_with_awql()
62
+ end
63
+
64
+ def test_add_ad_groups
65
+ campaign = @utils.get_campaign()
66
+ assert_not_nil(campaign)
67
+ assert_not_nil(campaign[:id])
68
+ add_ad_groups(campaign[:id])
69
+ end
70
+
71
+ def test_add_keywords
72
+ ad_group = @utils.get_ad_group()
73
+ assert_not_nil(ad_group)
74
+ assert_not_nil(ad_group[:id])
75
+ add_keywords(ad_group[:id])
76
+ end
77
+
78
+ def test_get_keywords
79
+ ad_group = @utils.get_ad_group()
80
+ assert_not_nil(ad_group)
81
+ assert_not_nil(ad_group[:id])
82
+ get_keywords(ad_group[:id])
83
+ end
84
+
85
+ def test_add_text_ads
86
+ ad_group = @utils.get_ad_group()
87
+ assert_not_nil(ad_group)
88
+ assert_not_nil(ad_group[:id])
89
+ add_text_ads(ad_group[:id])
90
+ end
91
+
92
+ def test_get_text_ads
93
+ ad_group = @utils.get_ad_group()
94
+ assert_not_nil(ad_group)
95
+ assert_not_nil(ad_group[:id])
96
+ get_text_ads(ad_group[:id])
97
+ end
98
+
99
+ def test_pause_ad
100
+ ad_group = @utils.get_ad_group()
101
+ assert_not_nil(ad_group)
102
+ assert_not_nil(ad_group[:id])
103
+ ad = @utils.get_ad()
104
+ assert_not_nil(ad)
105
+ assert_not_nil(ad[:ad])
106
+ assert_not_nil(ad[:ad][:id])
107
+ pause_ad(ad_group[:id], ad[:ad][:id])
108
+ end
109
+
110
+ def test_update_ad_group
111
+ ad_group = @utils.get_ad_group()
112
+ assert_not_nil(ad_group)
113
+ assert_not_nil(ad_group[:id])
114
+ update_ad_group(ad_group[:id])
115
+ end
116
+
117
+ def test_update_campaign
118
+ campaign = @utils.get_campaign()
119
+ assert_not_nil(campaign)
120
+ assert_not_nil(campaign[:id])
121
+ update_campaign(campaign[:id])
122
+ end
123
+
124
+ def test_update_keyword
125
+ ad_group = @utils.get_ad_group()
126
+ assert_not_nil(ad_group)
127
+ assert_not_nil(ad_group[:id])
128
+ keyword = @utils.get_keyword()
129
+ assert_not_nil(keyword)
130
+ assert_not_nil(keyword[:criterion])
131
+ assert_not_nil(keyword[:criterion][:id])
132
+ update_keyword(ad_group[:id], keyword[:criterion][:id])
133
+ end
134
+
135
+ def test_delete_keyword
136
+ ad_group = @utils.get_ad_group()
137
+ assert_not_nil(ad_group)
138
+ assert_not_nil(ad_group[:id])
139
+ keyword = @utils.get_keyword()
140
+ assert_not_nil(keyword)
141
+ assert_not_nil(keyword[:criterion])
142
+ assert_not_nil(keyword[:criterion][:id])
143
+ delete_keyword(ad_group[:id], keyword[:criterion][:id])
144
+ end
145
+
146
+ def test_delete_ad
147
+ ad_group = @utils.get_ad_group()
148
+ assert_not_nil(ad_group)
149
+ assert_not_nil(ad_group[:id])
150
+ ad = @utils.get_ad()
151
+ assert_not_nil(ad)
152
+ assert_not_nil(ad[:ad])
153
+ assert_not_nil(ad[:ad][:id])
154
+ delete_ad(ad_group[:id], ad[:ad][:id])
155
+ end
156
+
157
+ def test_delete_ad_group
158
+ ad_group = @utils.get_ad_group()
159
+ assert_not_nil(ad_group)
160
+ assert_not_nil(ad_group[:id])
161
+ delete_ad_group(ad_group[:id])
162
+ end
163
+
164
+ def test_delete_campaign
165
+ campaign = @utils.get_campaign()
166
+ assert_not_nil(campaign)
167
+ assert_not_nil(campaign[:id])
168
+ delete_campaign(campaign[:id])
169
+ end
170
+
171
+ def test_get_ad_groups
172
+ campaign = @utils.get_campaign()
173
+ assert_not_nil(campaign)
174
+ assert_not_nil(campaign[:id])
175
+ get_ad_groups(campaign[:id])
176
+ end
177
+ end
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.dklimkin@gmail.com (Danial Klimkin)
5
+ #
6
+ # Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # Tests the campaign management examples.
22
+
23
+ require 'test/unit'
24
+
25
+ require 'campaign_management/add_experiment'
26
+ require 'campaign_management/add_keywords_in_bulk'
27
+ require 'campaign_management/add_location_extension'
28
+ require 'campaign_management/add_location_extension_override'
29
+ require 'campaign_management/get_all_disapproved_ads'
30
+ require 'campaign_management/get_all_disapproved_ads_with_awql'
31
+ require 'campaign_management/promote_experiment'
32
+ require 'campaign_management/set_ad_parameters'
33
+ require 'campaign_management/validate_text_ad'
34
+
35
+ RETRY_INTERVAL = 5
36
+ RETRIES_COUNT = 3
37
+ KEYWORD_NUMBER = 3
38
+
39
+ class TestCampaignManagementV201206 < Test::Unit::TestCase
40
+ def setup
41
+ @logger = Logger.new(STDOUT)
42
+ @logger.level = Logger::ERROR
43
+ @adwords = AdwordsApi::Api.new
44
+ @adwords.logger = @logger
45
+ @utils = UtilsV201206.new(@adwords)
46
+ end
47
+
48
+ def test_add_experiment
49
+ campaign = @utils.get_campaign()
50
+ ad_group = @utils.get_ad_group()
51
+ criterion = @utils.get_keyword()
52
+ assert_not_nil(campaign)
53
+ assert_not_nil(campaign[:id])
54
+ assert_not_nil(ad_group)
55
+ assert_not_nil(ad_group[:id])
56
+ assert_not_nil(criterion)
57
+ assert_not_nil(criterion[:criterion])
58
+ assert_not_nil(criterion[:criterion][:id])
59
+ add_experiment(campaign[:id], ad_group[:id], criterion[:criterion][:id])
60
+ end
61
+
62
+ def test_add_keywords_in_bulk
63
+ add_keywords_in_bulk()
64
+ end
65
+
66
+ def test_add_location_extension
67
+ campaign = @utils.get_campaign()
68
+ assert_not_nil(campaign)
69
+ assert_not_nil(campaign[:id])
70
+ add_location_extension(campaign[:id])
71
+ end
72
+
73
+ def test_add_location_extension_override
74
+ ad = @utils.get_ad()
75
+ location_extension = @utils.get_location_extension()
76
+ assert_not_nil(ad)
77
+ assert_not_nil(ad[:ad])
78
+ assert_not_nil(ad[:ad][:id])
79
+ assert_not_nil(location_extension)
80
+ assert_not_nil(location_extension[:ad_extension])
81
+ assert_not_nil(location_extension[:ad_extension][:id])
82
+ add_location_extension_override(
83
+ ad[:ad][:id], location_extension[:ad_extension][:id])
84
+ end
85
+
86
+ def test_get_all_disapproved_ads
87
+ ad_group = @utils.get_ad_group()
88
+ assert_not_nil(ad_group)
89
+ assert_not_nil(ad_group[:id])
90
+ get_all_disapproved_ads(ad_group[:id])
91
+ end
92
+
93
+ def test_get_all_disapproved_ads_with_awql
94
+ ad_group = @utils.get_ad_group()
95
+ assert_not_nil(ad_group)
96
+ assert_not_nil(ad_group[:id])
97
+ get_all_disapproved_ads_with_awql(ad_group[:id])
98
+ end
99
+
100
+ def test_promote_experiment
101
+ experiment = @utils.get_experiment()
102
+ assert_not_nil(experiment)
103
+ assert_not_nil(experiment[:id])
104
+ promote_experiment(experiment[:id])
105
+ end
106
+
107
+ def test_set_ad_parameters
108
+ ad_group = @utils.get_ad_group()
109
+ assert_not_nil(ad_group)
110
+ assert_not_nil(ad_group[:id])
111
+ criterion = @utils.get_keyword()
112
+ assert_not_nil(criterion)
113
+ assert_not_nil(criterion[:criterion])
114
+ assert_not_nil(criterion[:criterion][:id])
115
+ set_ad_parameters(ad_group[:id], criterion[:criterion][:id])
116
+ end
117
+
118
+ def test_validate_text_ad
119
+ ad_group = @utils.get_ad_group()
120
+ assert_not_nil(ad_group)
121
+ assert_not_nil(ad_group[:id])
122
+ validate_text_ad(ad_group[:id])
123
+ end
124
+ end