google-adwords-api 0.4.5 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (519) hide show
  1. data/ChangeLog +4 -0
  2. data/README +3 -3
  3. data/Rakefile +3 -3
  4. data/examples/v201109/{create_account.rb → account_management/create_account.rb} +2 -1
  5. data/examples/v201109/{get_campaign_alerts.rb → account_management/get_account_alerts.rb} +38 -21
  6. data/examples/v201109/{get_all_account_changes.rb → account_management/get_account_changes.rb} +40 -39
  7. data/examples/v201109/{get_account_hierarchy.rb → account_management/get_account_hierarchy.rb} +2 -1
  8. data/examples/v201109/{get_client_customer_id.rb → account_management/get_client_customer_id.rb} +2 -1
  9. data/examples/v201109/{get_unit_count.rb → account_management/get_client_unit_usage.rb} +15 -7
  10. data/examples/v201109/{add_ad_group.rb → basic_operations/add_ad_group.rb} +2 -1
  11. data/examples/v201109/{add_campaign.rb → basic_operations/add_campaign.rb} +2 -1
  12. data/examples/v201109/{add_ad_group_criteria.rb → basic_operations/add_keywords.rb} +32 -37
  13. data/examples/{v200909/update_ad.rb → v201109/basic_operations/add_text_ads.rb} +41 -25
  14. data/examples/v201109/{delete_ad.rb → basic_operations/delete_ad.rb} +5 -4
  15. data/examples/v201109/{delete_ad_group.rb → basic_operations/delete_ad_group.rb} +34 -8
  16. data/examples/v201109/{delete_campaign.rb → basic_operations/delete_campaign.rb} +32 -6
  17. data/examples/v201109/{delete_ad_group_criterion.rb → basic_operations/delete_keyword.rb} +15 -10
  18. data/examples/v201109/{get_all_ad_groups.rb → basic_operations/get_ad_groups.rb} +32 -18
  19. data/examples/v201109/{get_all_campaigns.rb → basic_operations/get_campaigns.rb} +31 -14
  20. data/examples/v201109/{get_all_active_ad_group_criteria.rb → basic_operations/get_keywords.rb} +41 -34
  21. data/examples/v201109/{get_all_ads.rb → basic_operations/get_text_ads.rb} +39 -22
  22. data/examples/v201109/{update_ad.rb → basic_operations/pause_ad.rb} +9 -10
  23. data/examples/v201109/{update_ad_group.rb → basic_operations/update_ad_group.rb} +2 -1
  24. data/examples/v201109/{update_campaign.rb → basic_operations/update_campaign.rb} +2 -1
  25. data/examples/v201109/{update_ad_group_criterion.rb → basic_operations/update_keyword.rb} +10 -9
  26. data/examples/v201109/{add_experiment.rb → campaign_management/add_experiment.rb} +4 -3
  27. data/examples/v201109/{perform_mutate_job.rb → campaign_management/add_keywords_in_bulk.rb} +17 -43
  28. data/examples/v201109/{add_campaign_ad_extension.rb → campaign_management/add_location_extension.rb} +28 -37
  29. data/examples/v201109/{add_ad_extension_override.rb → campaign_management/add_location_extension_override.rb} +12 -10
  30. data/examples/v201109/{get_all_disapproved_ads.rb → campaign_management/get_all_disapproved_ads.rb} +3 -2
  31. data/examples/v201109/{promote_experiment.rb → campaign_management/promote_experiment.rb} +4 -4
  32. data/examples/v201109/{set_ad_params.rb → campaign_management/set_ad_parameters.rb} +7 -7
  33. data/examples/{v201003/delete_ad.rb → v201109/campaign_management/validate_text_ad.rb} +40 -16
  34. data/examples/v201109/{handle_partial_failures.rb → error_handling/handle_partial_failures.rb} +2 -1
  35. data/examples/v201109/{handle_policy_violation_error.rb → error_handling/handle_policy_violation_error.rb} +2 -1
  36. data/examples/v201109/{handle_second_factor.rb → error_handling/handle_two_factor_authorization_error.rb} +5 -4
  37. data/examples/v201109/{get_all_images.rb → misc/get_all_images_and_videos.rb} +40 -20
  38. data/examples/v201109/{upload_image.rb → misc/upload_image.rb} +2 -1
  39. data/examples/v201109/{oauth_handling.rb → misc/use_oauth.rb} +10 -7
  40. data/examples/v201109/{get_traffic_estimates.rb → optimization/estimate_keyword_traffic.rb} +4 -3
  41. data/examples/v201109/{get_criterion_bid_landscape.rb → optimization/get_keyword_bid_simulations.rb} +21 -20
  42. data/examples/v201109/{get_related_keywords.rb → optimization/get_keyword_ideas.rb} +6 -5
  43. data/examples/v201109/{get_keyword_opportunities.rb → optimization/get_keyword_opportunities.rb} +2 -1
  44. data/examples/v201109/{get_related_placements.rb → optimization/get_placement_ideas.rb} +5 -4
  45. data/examples/v201109/{add_user_list.rb → remarketing/add_audience.rb} +6 -5
  46. data/examples/v201109/{add_conversion.rb → remarketing/add_conversion_tracker.rb} +8 -7
  47. data/examples/v201109/{download_adhoc_report.rb → reporting/download_criteria_report.rb} +19 -17
  48. data/examples/v201109/{download_report.rb → reporting/download_defined_report.rb} +7 -5
  49. data/examples/v201109/{get_all_report_definitions.rb → reporting/get_defined_reports.rb} +7 -6
  50. data/examples/v201109/{get_report_fields.rb → reporting/get_report_fields.rb} +2 -1
  51. data/examples/v201109/{parallel_report_download.rb → reporting/parallel_report_download.rb} +2 -1
  52. data/examples/v201109/{add_campaign_targeting_criteria.rb → targeting/add_campaign_targeting_criteria.rb} +22 -4
  53. data/examples/v201109/{add_negative_campaign_criterion.rb → targeting/get_campaign_targeting_criteria.rb} +43 -26
  54. data/examples/v201109/{get_all_carriers.rb → targeting/get_targetable_languages_and_carriers.rb} +19 -4
  55. data/examples/v201109/{get_location_criteria.rb → targeting/lookup_location.rb} +4 -3
  56. data/lib/adwords_api.rb +2 -2
  57. data/lib/adwords_api/api_config.rb +3 -130
  58. data/lib/adwords_api/client_login_header_handler.rb +1 -1
  59. data/lib/adwords_api/credential_handler.rb +2 -2
  60. data/lib/adwords_api/errors.rb +2 -2
  61. data/lib/adwords_api/extensions.rb +3 -2
  62. data/lib/adwords_api/report_utils.rb +1 -1
  63. data/lib/adwords_api/utils.rb +2 -2
  64. data/lib/adwords_api/v13_login_handler.rb +1 -1
  65. data/lib/adwords_api/v201109/ad_extension_override_service.rb +10 -8
  66. data/lib/adwords_api/v201109/ad_extension_override_service_registry.rb +8 -6
  67. data/lib/adwords_api/v201109/ad_group_ad_service.rb +10 -8
  68. data/lib/adwords_api/v201109/ad_group_ad_service_registry.rb +8 -6
  69. data/lib/adwords_api/v201109/ad_group_criterion_service.rb +10 -8
  70. data/lib/adwords_api/v201109/ad_group_criterion_service_registry.rb +8 -6
  71. data/lib/adwords_api/v201109/ad_group_service.rb +10 -8
  72. data/lib/adwords_api/v201109/ad_group_service_registry.rb +8 -6
  73. data/lib/adwords_api/v201109/ad_param_service.rb +10 -8
  74. data/lib/adwords_api/v201109/ad_param_service_registry.rb +8 -6
  75. data/lib/adwords_api/v201109/alert_service.rb +6 -4
  76. data/lib/adwords_api/v201109/alert_service_registry.rb +8 -6
  77. data/lib/adwords_api/v201109/bulk_mutate_job_service.rb +10 -8
  78. data/lib/adwords_api/v201109/bulk_mutate_job_service_registry.rb +8 -6
  79. data/lib/adwords_api/v201109/bulk_opportunity_service.rb +6 -4
  80. data/lib/adwords_api/v201109/bulk_opportunity_service_registry.rb +8 -6
  81. data/lib/adwords_api/v201109/campaign_ad_extension_service.rb +10 -8
  82. data/lib/adwords_api/v201109/campaign_ad_extension_service_registry.rb +8 -6
  83. data/lib/adwords_api/v201109/campaign_criterion_service.rb +10 -8
  84. data/lib/adwords_api/v201109/campaign_criterion_service_registry.rb +8 -6
  85. data/lib/adwords_api/v201109/campaign_service.rb +10 -8
  86. data/lib/adwords_api/v201109/campaign_service_registry.rb +8 -6
  87. data/lib/adwords_api/v201109/campaign_target_service.rb +10 -8
  88. data/lib/adwords_api/v201109/campaign_target_service_registry.rb +8 -6
  89. data/lib/adwords_api/v201109/constant_data_service.rb +6 -4
  90. data/lib/adwords_api/v201109/constant_data_service_registry.rb +8 -6
  91. data/lib/adwords_api/v201109/conversion_tracker_service.rb +10 -8
  92. data/lib/adwords_api/v201109/conversion_tracker_service_registry.rb +8 -6
  93. data/lib/adwords_api/v201109/create_account_service.rb +6 -4
  94. data/lib/adwords_api/v201109/create_account_service_registry.rb +8 -6
  95. data/lib/adwords_api/v201109/customer_sync_service.rb +6 -4
  96. data/lib/adwords_api/v201109/customer_sync_service_registry.rb +8 -6
  97. data/lib/adwords_api/v201109/data_service.rb +10 -8
  98. data/lib/adwords_api/v201109/data_service_registry.rb +8 -6
  99. data/lib/adwords_api/v201109/experiment_service.rb +10 -8
  100. data/lib/adwords_api/v201109/experiment_service_registry.rb +8 -6
  101. data/lib/adwords_api/v201109/geo_location_service.rb +6 -4
  102. data/lib/adwords_api/v201109/geo_location_service_registry.rb +8 -6
  103. data/lib/adwords_api/v201109/info_service.rb +6 -4
  104. data/lib/adwords_api/v201109/info_service_registry.rb +8 -6
  105. data/lib/adwords_api/v201109/location_criterion_service.rb +6 -4
  106. data/lib/adwords_api/v201109/location_criterion_service_registry.rb +8 -6
  107. data/lib/adwords_api/v201109/media_service.rb +10 -8
  108. data/lib/adwords_api/v201109/media_service_registry.rb +8 -6
  109. data/lib/adwords_api/v201109/mutate_job_service.rb +10 -8
  110. data/lib/adwords_api/v201109/mutate_job_service_registry.rb +8 -6
  111. data/lib/adwords_api/v201109/report_definition_service.rb +10 -8
  112. data/lib/adwords_api/v201109/report_definition_service_registry.rb +8 -6
  113. data/lib/adwords_api/v201109/serviced_account_service.rb +6 -4
  114. data/lib/adwords_api/v201109/serviced_account_service_registry.rb +8 -6
  115. data/lib/adwords_api/v201109/targeting_idea_service.rb +10 -8
  116. data/lib/adwords_api/v201109/targeting_idea_service_registry.rb +8 -6
  117. data/lib/adwords_api/v201109/traffic_estimator_service.rb +6 -4
  118. data/lib/adwords_api/v201109/traffic_estimator_service_registry.rb +8 -6
  119. data/lib/adwords_api/v201109/user_list_service.rb +10 -8
  120. data/lib/adwords_api/v201109/user_list_service_registry.rb +8 -6
  121. data/test/adwords_api/test_api_config.rb +2 -7
  122. data/test/adwords_api/test_report_utils.rb +2 -1
  123. data/test/adwords_api/test_utils.rb +1 -0
  124. data/test/bugs/test_issue_00000031.rb +2 -1
  125. metadata +116 -481
  126. data/examples/v200909/add_ad_extension_override.rb +0 -82
  127. data/examples/v200909/add_ad_group.rb +0 -89
  128. data/examples/v200909/add_ad_group_criteria.rb +0 -108
  129. data/examples/v200909/add_ads.rb +0 -121
  130. data/examples/v200909/add_campaign.rb +0 -92
  131. data/examples/v200909/add_campaign_ad_extension.rb +0 -121
  132. data/examples/v200909/add_negative_campaign_criterion.rb +0 -87
  133. data/examples/v200909/check_campaigns.rb +0 -123
  134. data/examples/v200909/delete_ad.rb +0 -85
  135. data/examples/v200909/delete_ad_group.rb +0 -77
  136. data/examples/v200909/delete_ad_group_criterion.rb +0 -86
  137. data/examples/v200909/delete_campaign.rb +0 -78
  138. data/examples/v200909/get_all_active_ad_group_criteria.rb +0 -84
  139. data/examples/v200909/get_all_ad_extension_overrides.rb +0 -82
  140. data/examples/v200909/get_all_ad_group_criteria.rb +0 -82
  141. data/examples/v200909/get_all_ad_groups.rb +0 -79
  142. data/examples/v200909/get_all_ad_params.rb +0 -80
  143. data/examples/v200909/get_all_ads.rb +0 -79
  144. data/examples/v200909/get_all_campaign_ad_extensions.rb +0 -81
  145. data/examples/v200909/get_all_campaign_targets.rb +0 -74
  146. data/examples/v200909/get_all_campaigns.rb +0 -74
  147. data/examples/v200909/get_all_disapproved_ads.rb +0 -85
  148. data/examples/v200909/get_all_paused_campaigns.rb +0 -77
  149. data/examples/v200909/get_conversion_optimizer_eligibility.rb +0 -103
  150. data/examples/v200909/get_geo_location_info.rb +0 -99
  151. data/examples/v200909/get_method_cost.rb +0 -87
  152. data/examples/v200909/get_operation_count.rb +0 -79
  153. data/examples/v200909/get_related_keywords.rb +0 -108
  154. data/examples/v200909/get_related_placements.rb +0 -107
  155. data/examples/v200909/get_total_usage_units_per_month.rb +0 -74
  156. data/examples/v200909/get_unit_count.rb +0 -79
  157. data/examples/v200909/perform_bulk_mutate_job.rb +0 -212
  158. data/examples/v200909/set_ad_params.rb +0 -115
  159. data/examples/v200909/set_campaign_targets.rb +0 -116
  160. data/examples/v200909/update_ad_group.rb +0 -81
  161. data/examples/v200909/update_ad_group_criterion.rb +0 -99
  162. data/examples/v200909/update_campaign.rb +0 -84
  163. data/examples/v201003/add_ad_extension_override.rb +0 -82
  164. data/examples/v201003/add_ad_group.rb +0 -89
  165. data/examples/v201003/add_ad_group_criteria.rb +0 -108
  166. data/examples/v201003/add_ads.rb +0 -174
  167. data/examples/v201003/add_campaign.rb +0 -92
  168. data/examples/v201003/add_campaign_ad_extension.rb +0 -121
  169. data/examples/v201003/add_keywords_performance_report_definition.rb +0 -99
  170. data/examples/v201003/add_negative_campaign_criterion.rb +0 -87
  171. data/examples/v201003/check_campaigns.rb +0 -123
  172. data/examples/v201003/delete_ad_group.rb +0 -77
  173. data/examples/v201003/delete_ad_group_criterion.rb +0 -86
  174. data/examples/v201003/delete_campaign.rb +0 -78
  175. data/examples/v201003/download_report.rb +0 -67
  176. data/examples/v201003/get_all_active_ad_group_criteria.rb +0 -84
  177. data/examples/v201003/get_all_ad_extension_overrides.rb +0 -82
  178. data/examples/v201003/get_all_ad_group_criteria.rb +0 -82
  179. data/examples/v201003/get_all_ad_groups.rb +0 -79
  180. data/examples/v201003/get_all_ad_params.rb +0 -80
  181. data/examples/v201003/get_all_ads.rb +0 -82
  182. data/examples/v201003/get_all_campaign_ad_extensions.rb +0 -81
  183. data/examples/v201003/get_all_campaign_targets.rb +0 -74
  184. data/examples/v201003/get_all_campaigns.rb +0 -74
  185. data/examples/v201003/get_all_disapproved_ads.rb +0 -85
  186. data/examples/v201003/get_all_images.rb +0 -80
  187. data/examples/v201003/get_all_paused_campaigns.rb +0 -77
  188. data/examples/v201003/get_all_report_definitions.rb +0 -75
  189. data/examples/v201003/get_all_videos.rb +0 -76
  190. data/examples/v201003/get_conversion_optimizer_eligibility.rb +0 -103
  191. data/examples/v201003/get_criterion_bid_landscape.rb +0 -96
  192. data/examples/v201003/get_geo_location_info.rb +0 -99
  193. data/examples/v201003/get_method_cost.rb +0 -87
  194. data/examples/v201003/get_operation_count.rb +0 -79
  195. data/examples/v201003/get_related_keywords.rb +0 -108
  196. data/examples/v201003/get_related_placements.rb +0 -107
  197. data/examples/v201003/get_report_fields.rb +0 -72
  198. data/examples/v201003/get_total_usage_units_per_month.rb +0 -74
  199. data/examples/v201003/get_unit_count.rb +0 -79
  200. data/examples/v201003/perform_bulk_mutate_job.rb +0 -212
  201. data/examples/v201003/set_ad_params.rb +0 -115
  202. data/examples/v201003/set_campaign_targets.rb +0 -116
  203. data/examples/v201003/update_ad.rb +0 -86
  204. data/examples/v201003/update_ad_group.rb +0 -81
  205. data/examples/v201003/update_ad_group_criterion.rb +0 -99
  206. data/examples/v201003/update_campaign.rb +0 -83
  207. data/examples/v201003/upload_image.rb +0 -90
  208. data/examples/v201008/add_ad_extension_override.rb +0 -82
  209. data/examples/v201008/add_ad_group.rb +0 -89
  210. data/examples/v201008/add_ad_group_criteria.rb +0 -108
  211. data/examples/v201008/add_ads.rb +0 -174
  212. data/examples/v201008/add_campaign.rb +0 -92
  213. data/examples/v201008/add_campaign_ad_extension.rb +0 -121
  214. data/examples/v201008/add_experiment.rb +0 -153
  215. data/examples/v201008/add_keywords_performance_report_definition.rb +0 -99
  216. data/examples/v201008/add_negative_campaign_criterion.rb +0 -87
  217. data/examples/v201008/add_user_list.rb +0 -87
  218. data/examples/v201008/check_campaigns.rb +0 -123
  219. data/examples/v201008/delete_ad.rb +0 -85
  220. data/examples/v201008/delete_ad_group.rb +0 -77
  221. data/examples/v201008/delete_ad_group_criterion.rb +0 -86
  222. data/examples/v201008/delete_bulk_mutate_job.rb +0 -87
  223. data/examples/v201008/delete_campaign.rb +0 -78
  224. data/examples/v201008/delete_experiment.rb +0 -78
  225. data/examples/v201008/delete_user_list.rb +0 -78
  226. data/examples/v201008/download_report.rb +0 -67
  227. data/examples/v201008/get_account_hierarchy.rb +0 -101
  228. data/examples/v201008/get_all_account_changes.rb +0 -135
  229. data/examples/v201008/get_all_active_ad_group_criteria.rb +0 -84
  230. data/examples/v201008/get_all_ad_extension_overrides.rb +0 -82
  231. data/examples/v201008/get_all_ad_group_criteria.rb +0 -82
  232. data/examples/v201008/get_all_ad_groups.rb +0 -79
  233. data/examples/v201008/get_all_ad_params.rb +0 -80
  234. data/examples/v201008/get_all_ads.rb +0 -82
  235. data/examples/v201008/get_all_campaign_ad_extensions.rb +0 -81
  236. data/examples/v201008/get_all_campaign_targets.rb +0 -74
  237. data/examples/v201008/get_all_campaigns.rb +0 -74
  238. data/examples/v201008/get_all_disapproved_ads.rb +0 -85
  239. data/examples/v201008/get_all_experiments.rb +0 -84
  240. data/examples/v201008/get_all_images.rb +0 -80
  241. data/examples/v201008/get_all_paused_campaigns.rb +0 -77
  242. data/examples/v201008/get_all_report_definitions.rb +0 -75
  243. data/examples/v201008/get_all_user_lists.rb +0 -75
  244. data/examples/v201008/get_all_videos.rb +0 -76
  245. data/examples/v201008/get_bulk_mutate_job.rb +0 -97
  246. data/examples/v201008/get_campaign_alerts.rb +0 -95
  247. data/examples/v201008/get_conversion_optimizer_eligibility.rb +0 -88
  248. data/examples/v201008/get_criterion_bid_landscape.rb +0 -96
  249. data/examples/v201008/get_geo_location_info.rb +0 -99
  250. data/examples/v201008/get_method_cost.rb +0 -87
  251. data/examples/v201008/get_operation_count.rb +0 -79
  252. data/examples/v201008/get_related_keywords.rb +0 -108
  253. data/examples/v201008/get_related_placements.rb +0 -107
  254. data/examples/v201008/get_report_fields.rb +0 -72
  255. data/examples/v201008/get_total_usage_units_per_month.rb +0 -74
  256. data/examples/v201008/get_traffic_estimates.rb +0 -147
  257. data/examples/v201008/get_unit_count.rb +0 -79
  258. data/examples/v201008/handle_partial_failures.rb +0 -127
  259. data/examples/v201008/handle_policy_violation_error.rb +0 -138
  260. data/examples/v201008/perform_bulk_mutate_job.rb +0 -212
  261. data/examples/v201008/promote_experiment.rb +0 -79
  262. data/examples/v201008/set_ad_params.rb +0 -115
  263. data/examples/v201008/set_campaign_targets.rb +0 -116
  264. data/examples/v201008/update_ad.rb +0 -86
  265. data/examples/v201008/update_ad_group.rb +0 -81
  266. data/examples/v201008/update_ad_group_criterion.rb +0 -99
  267. data/examples/v201008/update_campaign.rb +0 -84
  268. data/examples/v201008/update_user_list.rb +0 -82
  269. data/examples/v201008/upload_image.rb +0 -90
  270. data/examples/v201101/add_ad_extension_override.rb +0 -82
  271. data/examples/v201101/add_ad_group.rb +0 -89
  272. data/examples/v201101/add_ad_group_criteria.rb +0 -108
  273. data/examples/v201101/add_ads.rb +0 -174
  274. data/examples/v201101/add_campaign.rb +0 -99
  275. data/examples/v201101/add_campaign_ad_extension.rb +0 -121
  276. data/examples/v201101/add_conversion.rb +0 -88
  277. data/examples/v201101/add_experiment.rb +0 -153
  278. data/examples/v201101/add_keywords_performance_report_definition.rb +0 -99
  279. data/examples/v201101/add_negative_campaign_criterion.rb +0 -87
  280. data/examples/v201101/add_user_list.rb +0 -113
  281. data/examples/v201101/check_campaigns.rb +0 -123
  282. data/examples/v201101/delete_ad.rb +0 -85
  283. data/examples/v201101/delete_ad_group.rb +0 -77
  284. data/examples/v201101/delete_ad_group_criterion.rb +0 -86
  285. data/examples/v201101/delete_bulk_mutate_job.rb +0 -87
  286. data/examples/v201101/delete_campaign.rb +0 -78
  287. data/examples/v201101/delete_experiment.rb +0 -78
  288. data/examples/v201101/delete_user_list.rb +0 -78
  289. data/examples/v201101/download_report.rb +0 -67
  290. data/examples/v201101/get_account_hierarchy.rb +0 -102
  291. data/examples/v201101/get_ad_group_bid_landscape.rb +0 -94
  292. data/examples/v201101/get_all_account_changes.rb +0 -137
  293. data/examples/v201101/get_all_active_ad_group_criteria.rb +0 -97
  294. data/examples/v201101/get_all_ad_extension_overrides.rb +0 -82
  295. data/examples/v201101/get_all_ad_group_criteria.rb +0 -88
  296. data/examples/v201101/get_all_ad_groups.rb +0 -85
  297. data/examples/v201101/get_all_ad_params.rb +0 -80
  298. data/examples/v201101/get_all_ads.rb +0 -90
  299. data/examples/v201101/get_all_campaign_ad_extensions.rb +0 -87
  300. data/examples/v201101/get_all_campaign_targets.rb +0 -74
  301. data/examples/v201101/get_all_campaigns.rb +0 -77
  302. data/examples/v201101/get_all_conversions.rb +0 -79
  303. data/examples/v201101/get_all_disapproved_ads.rb +0 -93
  304. data/examples/v201101/get_all_experiments.rb +0 -89
  305. data/examples/v201101/get_all_images.rb +0 -82
  306. data/examples/v201101/get_all_paused_campaigns.rb +0 -83
  307. data/examples/v201101/get_all_report_definitions.rb +0 -75
  308. data/examples/v201101/get_all_user_lists.rb +0 -78
  309. data/examples/v201101/get_all_videos.rb +0 -78
  310. data/examples/v201101/get_bulk_mutate_job.rb +0 -97
  311. data/examples/v201101/get_campaign_alerts.rb +0 -95
  312. data/examples/v201101/get_conversion_optimizer_eligibility.rb +0 -93
  313. data/examples/v201101/get_criterion_bid_landscape.rb +0 -93
  314. data/examples/v201101/get_geo_location_info.rb +0 -99
  315. data/examples/v201101/get_keyword_opportunities.rb +0 -95
  316. data/examples/v201101/get_method_cost.rb +0 -87
  317. data/examples/v201101/get_operation_count.rb +0 -79
  318. data/examples/v201101/get_related_keywords.rb +0 -108
  319. data/examples/v201101/get_related_placements.rb +0 -107
  320. data/examples/v201101/get_report_fields.rb +0 -72
  321. data/examples/v201101/get_total_usage_units_per_month.rb +0 -74
  322. data/examples/v201101/get_traffic_estimates.rb +0 -148
  323. data/examples/v201101/get_unit_count.rb +0 -79
  324. data/examples/v201101/handle_partial_failures.rb +0 -127
  325. data/examples/v201101/handle_policy_violation_error.rb +0 -138
  326. data/examples/v201101/handle_second_factor.rb +0 -87
  327. data/examples/v201101/oauth_handling.rb +0 -95
  328. data/examples/v201101/perform_bulk_mutate_job.rb +0 -212
  329. data/examples/v201101/promote_experiment.rb +0 -79
  330. data/examples/v201101/set_ad_params.rb +0 -115
  331. data/examples/v201101/set_campaign_targets.rb +0 -102
  332. data/examples/v201101/update_ad.rb +0 -86
  333. data/examples/v201101/update_ad_group.rb +0 -81
  334. data/examples/v201101/update_ad_group_criterion.rb +0 -99
  335. data/examples/v201101/update_campaign.rb +0 -84
  336. data/examples/v201101/update_conversion.rb +0 -87
  337. data/examples/v201101/update_user_list.rb +0 -82
  338. data/examples/v201101/upload_image.rb +0 -90
  339. data/examples/v201109/add_ads.rb +0 -174
  340. data/examples/v201109/check_campaigns.rb +0 -123
  341. data/examples/v201109/delete_bulk_mutate_job.rb +0 -87
  342. data/examples/v201109/delete_experiment.rb +0 -78
  343. data/examples/v201109/delete_user_list.rb +0 -78
  344. data/examples/v201109/get_ad_group_bid_landscape.rb +0 -94
  345. data/examples/v201109/get_all_ad_extension_overrides.rb +0 -82
  346. data/examples/v201109/get_all_ad_group_criteria.rb +0 -90
  347. data/examples/v201109/get_all_ad_params.rb +0 -86
  348. data/examples/v201109/get_all_campaign_ad_extensions.rb +0 -87
  349. data/examples/v201109/get_all_campaign_targets.rb +0 -74
  350. data/examples/v201109/get_all_conversions.rb +0 -79
  351. data/examples/v201109/get_all_experiments.rb +0 -89
  352. data/examples/v201109/get_all_languages.rb +0 -73
  353. data/examples/v201109/get_all_paused_campaigns.rb +0 -83
  354. data/examples/v201109/get_all_user_lists.rb +0 -78
  355. data/examples/v201109/get_all_videos.rb +0 -78
  356. data/examples/v201109/get_bulk_mutate_job.rb +0 -97
  357. data/examples/v201109/get_conversion_optimizer_eligibility.rb +0 -93
  358. data/examples/v201109/get_geo_location_info.rb +0 -99
  359. data/examples/v201109/get_method_cost.rb +0 -87
  360. data/examples/v201109/get_operation_count.rb +0 -79
  361. data/examples/v201109/get_total_usage_units_per_month.rb +0 -74
  362. data/examples/v201109/oauth_report_download.rb +0 -97
  363. data/examples/v201109/perform_bulk_mutate_job.rb +0 -212
  364. data/examples/v201109/update_conversion.rb +0 -87
  365. data/examples/v201109/update_user_list.rb +0 -82
  366. data/lib/adwords_api/v13/account_service.rb +0 -48
  367. data/lib/adwords_api/v13/account_service_registry.rb +0 -41
  368. data/lib/adwords_api/v13/report_service.rb +0 -65
  369. data/lib/adwords_api/v13/report_service_registry.rb +0 -41
  370. data/lib/adwords_api/v200909/ad_extension_override_service.rb +0 -36
  371. data/lib/adwords_api/v200909/ad_extension_override_service_registry.rb +0 -44
  372. data/lib/adwords_api/v200909/ad_group_ad_service.rb +0 -36
  373. data/lib/adwords_api/v200909/ad_group_ad_service_registry.rb +0 -44
  374. data/lib/adwords_api/v200909/ad_group_criterion_service.rb +0 -36
  375. data/lib/adwords_api/v200909/ad_group_criterion_service_registry.rb +0 -44
  376. data/lib/adwords_api/v200909/ad_group_service.rb +0 -36
  377. data/lib/adwords_api/v200909/ad_group_service_registry.rb +0 -44
  378. data/lib/adwords_api/v200909/ad_param_service.rb +0 -36
  379. data/lib/adwords_api/v200909/ad_param_service_registry.rb +0 -44
  380. data/lib/adwords_api/v200909/bulk_mutate_job_service.rb +0 -36
  381. data/lib/adwords_api/v200909/bulk_mutate_job_service_registry.rb +0 -44
  382. data/lib/adwords_api/v200909/campaign_ad_extension_service.rb +0 -36
  383. data/lib/adwords_api/v200909/campaign_ad_extension_service_registry.rb +0 -44
  384. data/lib/adwords_api/v200909/campaign_criterion_service.rb +0 -36
  385. data/lib/adwords_api/v200909/campaign_criterion_service_registry.rb +0 -44
  386. data/lib/adwords_api/v200909/campaign_service.rb +0 -36
  387. data/lib/adwords_api/v200909/campaign_service_registry.rb +0 -44
  388. data/lib/adwords_api/v200909/campaign_target_service.rb +0 -36
  389. data/lib/adwords_api/v200909/campaign_target_service_registry.rb +0 -44
  390. data/lib/adwords_api/v200909/geo_location_service.rb +0 -32
  391. data/lib/adwords_api/v200909/geo_location_service_registry.rb +0 -44
  392. data/lib/adwords_api/v200909/info_service.rb +0 -32
  393. data/lib/adwords_api/v200909/info_service_registry.rb +0 -44
  394. data/lib/adwords_api/v200909/targeting_idea_service.rb +0 -36
  395. data/lib/adwords_api/v200909/targeting_idea_service_registry.rb +0 -44
  396. data/lib/adwords_api/v201003/ad_extension_override_service.rb +0 -36
  397. data/lib/adwords_api/v201003/ad_extension_override_service_registry.rb +0 -44
  398. data/lib/adwords_api/v201003/ad_group_ad_service.rb +0 -36
  399. data/lib/adwords_api/v201003/ad_group_ad_service_registry.rb +0 -44
  400. data/lib/adwords_api/v201003/ad_group_criterion_service.rb +0 -36
  401. data/lib/adwords_api/v201003/ad_group_criterion_service_registry.rb +0 -44
  402. data/lib/adwords_api/v201003/ad_group_service.rb +0 -36
  403. data/lib/adwords_api/v201003/ad_group_service_registry.rb +0 -44
  404. data/lib/adwords_api/v201003/ad_param_service.rb +0 -36
  405. data/lib/adwords_api/v201003/ad_param_service_registry.rb +0 -44
  406. data/lib/adwords_api/v201003/bid_landscape_service.rb +0 -32
  407. data/lib/adwords_api/v201003/bid_landscape_service_registry.rb +0 -44
  408. data/lib/adwords_api/v201003/bulk_mutate_job_service.rb +0 -36
  409. data/lib/adwords_api/v201003/bulk_mutate_job_service_registry.rb +0 -44
  410. data/lib/adwords_api/v201003/campaign_ad_extension_service.rb +0 -36
  411. data/lib/adwords_api/v201003/campaign_ad_extension_service_registry.rb +0 -44
  412. data/lib/adwords_api/v201003/campaign_criterion_service.rb +0 -36
  413. data/lib/adwords_api/v201003/campaign_criterion_service_registry.rb +0 -44
  414. data/lib/adwords_api/v201003/campaign_service.rb +0 -36
  415. data/lib/adwords_api/v201003/campaign_service_registry.rb +0 -44
  416. data/lib/adwords_api/v201003/campaign_target_service.rb +0 -36
  417. data/lib/adwords_api/v201003/campaign_target_service_registry.rb +0 -44
  418. data/lib/adwords_api/v201003/geo_location_service.rb +0 -32
  419. data/lib/adwords_api/v201003/geo_location_service_registry.rb +0 -44
  420. data/lib/adwords_api/v201003/info_service.rb +0 -32
  421. data/lib/adwords_api/v201003/info_service_registry.rb +0 -44
  422. data/lib/adwords_api/v201003/media_service.rb +0 -36
  423. data/lib/adwords_api/v201003/media_service_registry.rb +0 -44
  424. data/lib/adwords_api/v201003/report_definition_service.rb +0 -49
  425. data/lib/adwords_api/v201003/report_definition_service_registry.rb +0 -44
  426. data/lib/adwords_api/v201003/targeting_idea_service.rb +0 -36
  427. data/lib/adwords_api/v201003/targeting_idea_service_registry.rb +0 -44
  428. data/lib/adwords_api/v201008/ad_extension_override_service.rb +0 -36
  429. data/lib/adwords_api/v201008/ad_extension_override_service_registry.rb +0 -44
  430. data/lib/adwords_api/v201008/ad_group_ad_service.rb +0 -36
  431. data/lib/adwords_api/v201008/ad_group_ad_service_registry.rb +0 -44
  432. data/lib/adwords_api/v201008/ad_group_criterion_service.rb +0 -36
  433. data/lib/adwords_api/v201008/ad_group_criterion_service_registry.rb +0 -44
  434. data/lib/adwords_api/v201008/ad_group_service.rb +0 -36
  435. data/lib/adwords_api/v201008/ad_group_service_registry.rb +0 -44
  436. data/lib/adwords_api/v201008/ad_param_service.rb +0 -36
  437. data/lib/adwords_api/v201008/ad_param_service_registry.rb +0 -44
  438. data/lib/adwords_api/v201008/alert_service.rb +0 -32
  439. data/lib/adwords_api/v201008/alert_service_registry.rb +0 -44
  440. data/lib/adwords_api/v201008/bid_landscape_service.rb +0 -32
  441. data/lib/adwords_api/v201008/bid_landscape_service_registry.rb +0 -44
  442. data/lib/adwords_api/v201008/bulk_mutate_job_service.rb +0 -36
  443. data/lib/adwords_api/v201008/bulk_mutate_job_service_registry.rb +0 -44
  444. data/lib/adwords_api/v201008/campaign_ad_extension_service.rb +0 -36
  445. data/lib/adwords_api/v201008/campaign_ad_extension_service_registry.rb +0 -44
  446. data/lib/adwords_api/v201008/campaign_criterion_service.rb +0 -36
  447. data/lib/adwords_api/v201008/campaign_criterion_service_registry.rb +0 -44
  448. data/lib/adwords_api/v201008/campaign_service.rb +0 -36
  449. data/lib/adwords_api/v201008/campaign_service_registry.rb +0 -44
  450. data/lib/adwords_api/v201008/campaign_target_service.rb +0 -36
  451. data/lib/adwords_api/v201008/campaign_target_service_registry.rb +0 -44
  452. data/lib/adwords_api/v201008/customer_sync_service.rb +0 -32
  453. data/lib/adwords_api/v201008/customer_sync_service_registry.rb +0 -45
  454. data/lib/adwords_api/v201008/experiment_service.rb +0 -36
  455. data/lib/adwords_api/v201008/experiment_service_registry.rb +0 -44
  456. data/lib/adwords_api/v201008/geo_location_service.rb +0 -32
  457. data/lib/adwords_api/v201008/geo_location_service_registry.rb +0 -44
  458. data/lib/adwords_api/v201008/info_service.rb +0 -32
  459. data/lib/adwords_api/v201008/info_service_registry.rb +0 -44
  460. data/lib/adwords_api/v201008/media_service.rb +0 -36
  461. data/lib/adwords_api/v201008/media_service_registry.rb +0 -44
  462. data/lib/adwords_api/v201008/report_definition_service.rb +0 -49
  463. data/lib/adwords_api/v201008/report_definition_service_registry.rb +0 -44
  464. data/lib/adwords_api/v201008/serviced_account_service.rb +0 -32
  465. data/lib/adwords_api/v201008/serviced_account_service_registry.rb +0 -44
  466. data/lib/adwords_api/v201008/targeting_idea_service.rb +0 -36
  467. data/lib/adwords_api/v201008/targeting_idea_service_registry.rb +0 -44
  468. data/lib/adwords_api/v201008/traffic_estimator_service.rb +0 -32
  469. data/lib/adwords_api/v201008/traffic_estimator_service_registry.rb +0 -44
  470. data/lib/adwords_api/v201008/user_list_service.rb +0 -36
  471. data/lib/adwords_api/v201008/user_list_service_registry.rb +0 -44
  472. data/lib/adwords_api/v201101/ad_extension_override_service.rb +0 -36
  473. data/lib/adwords_api/v201101/ad_extension_override_service_registry.rb +0 -44
  474. data/lib/adwords_api/v201101/ad_group_ad_service.rb +0 -36
  475. data/lib/adwords_api/v201101/ad_group_ad_service_registry.rb +0 -44
  476. data/lib/adwords_api/v201101/ad_group_criterion_service.rb +0 -36
  477. data/lib/adwords_api/v201101/ad_group_criterion_service_registry.rb +0 -44
  478. data/lib/adwords_api/v201101/ad_group_service.rb +0 -36
  479. data/lib/adwords_api/v201101/ad_group_service_registry.rb +0 -44
  480. data/lib/adwords_api/v201101/ad_param_service.rb +0 -36
  481. data/lib/adwords_api/v201101/ad_param_service_registry.rb +0 -44
  482. data/lib/adwords_api/v201101/alert_service.rb +0 -32
  483. data/lib/adwords_api/v201101/alert_service_registry.rb +0 -44
  484. data/lib/adwords_api/v201101/bulk_mutate_job_service.rb +0 -36
  485. data/lib/adwords_api/v201101/bulk_mutate_job_service_registry.rb +0 -44
  486. data/lib/adwords_api/v201101/bulk_opportunity_service.rb +0 -32
  487. data/lib/adwords_api/v201101/bulk_opportunity_service_registry.rb +0 -44
  488. data/lib/adwords_api/v201101/campaign_ad_extension_service.rb +0 -36
  489. data/lib/adwords_api/v201101/campaign_ad_extension_service_registry.rb +0 -44
  490. data/lib/adwords_api/v201101/campaign_criterion_service.rb +0 -36
  491. data/lib/adwords_api/v201101/campaign_criterion_service_registry.rb +0 -44
  492. data/lib/adwords_api/v201101/campaign_service.rb +0 -36
  493. data/lib/adwords_api/v201101/campaign_service_registry.rb +0 -44
  494. data/lib/adwords_api/v201101/campaign_target_service.rb +0 -36
  495. data/lib/adwords_api/v201101/campaign_target_service_registry.rb +0 -44
  496. data/lib/adwords_api/v201101/conversion_tracker_service.rb +0 -36
  497. data/lib/adwords_api/v201101/conversion_tracker_service_registry.rb +0 -44
  498. data/lib/adwords_api/v201101/customer_sync_service.rb +0 -32
  499. data/lib/adwords_api/v201101/customer_sync_service_registry.rb +0 -45
  500. data/lib/adwords_api/v201101/data_service.rb +0 -36
  501. data/lib/adwords_api/v201101/data_service_registry.rb +0 -44
  502. data/lib/adwords_api/v201101/experiment_service.rb +0 -36
  503. data/lib/adwords_api/v201101/experiment_service_registry.rb +0 -44
  504. data/lib/adwords_api/v201101/geo_location_service.rb +0 -32
  505. data/lib/adwords_api/v201101/geo_location_service_registry.rb +0 -44
  506. data/lib/adwords_api/v201101/info_service.rb +0 -32
  507. data/lib/adwords_api/v201101/info_service_registry.rb +0 -44
  508. data/lib/adwords_api/v201101/media_service.rb +0 -36
  509. data/lib/adwords_api/v201101/media_service_registry.rb +0 -44
  510. data/lib/adwords_api/v201101/report_definition_service.rb +0 -49
  511. data/lib/adwords_api/v201101/report_definition_service_registry.rb +0 -44
  512. data/lib/adwords_api/v201101/serviced_account_service.rb +0 -32
  513. data/lib/adwords_api/v201101/serviced_account_service_registry.rb +0 -44
  514. data/lib/adwords_api/v201101/targeting_idea_service.rb +0 -36
  515. data/lib/adwords_api/v201101/targeting_idea_service_registry.rb +0 -44
  516. data/lib/adwords_api/v201101/traffic_estimator_service.rb +0 -32
  517. data/lib/adwords_api/v201101/traffic_estimator_service_registry.rb +0 -44
  518. data/lib/adwords_api/v201101/user_list_service.rb +0 -36
  519. data/lib/adwords_api/v201101/user_list_service_registry.rb +0 -44
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
4
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
4
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
@@ -18,7 +19,7 @@
18
19
  # limitations under the License.
19
20
  #
20
21
  # This example adds various types of targeting criteria to a campaign. To get
21
- # campaigns list, run get_all_campaigns.rb.
22
+ # campaigns list, run get_campaigns.rb.
22
23
  #
23
24
  # Tags: CampaignCriterionService.mutate
24
25
 
@@ -27,7 +28,7 @@ require 'adwords_api'
27
28
 
28
29
  API_VERSION = :v201109
29
30
 
30
- def get_location_criteria()
31
+ def add_campaign_targeting_criteria()
31
32
  # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
32
33
  # when called without parameters.
33
34
  adwords = AdwordsApi::Api.new
@@ -65,6 +66,23 @@ def get_location_criteria()
65
66
  }
66
67
  end
67
68
 
69
+ # Add negative campaign criterion.
70
+ operations << {
71
+ :operator => 'ADD',
72
+ :operand => {
73
+ # The 'xsi_type' field allows you to specify the xsi:type of the object
74
+ # being created. It's only necessary when you must provide an explicit
75
+ # type that the client library can't infer.
76
+ :xsi_type => 'NegativeCampaignCriterion',
77
+ :campaign_id => campaign_id,
78
+ :criterion => {
79
+ :xsi_type => 'Keyword',
80
+ :text => 'jupiter cruise',
81
+ :match_type => 'BROAD'
82
+ }
83
+ }
84
+ }
85
+
68
86
  response = campaign_criterion_srv.mutate(operations)
69
87
 
70
88
  if response and response[:value]
@@ -82,7 +100,7 @@ end
82
100
 
83
101
  if __FILE__ == $0
84
102
  begin
85
- get_location_criteria()
103
+ add_campaign_targeting_criteria()
86
104
 
87
105
  # HTTP errors.
88
106
  rescue AdsCommon::Errors::HttpError => e
@@ -1,6 +1,7 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
- # Author:: api.sgomes@gmail.com (Sérgio Gomes)
4
+ # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
5
6
  # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
6
7
  #
@@ -17,17 +18,18 @@
17
18
  # See the License for the specific language governing permissions and
18
19
  # limitations under the License.
19
20
  #
20
- # This example illustrates how to create a negative campaign criterion for a
21
- # given campaign. To create a campaign, run add_campaign.rb.
21
+ # This example illustrates how to retrieve all the campaign targets. To set
22
+ # campaign targets, run add_campaign_targeting_criteria.rb.
22
23
  #
23
- # Tags: CampaignCriterionService.mutate
24
+ # Tags: CampaignCriterionService.get
24
25
 
25
26
  require 'rubygems'
26
27
  require 'adwords_api'
27
28
 
28
29
  API_VERSION = :v201109
30
+ PAGE_SIZE = 500
29
31
 
30
- def add_negative_campaign_criterion()
32
+ def get_campaign_targeting_criteria()
31
33
  # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
32
34
  # when called without parameters.
33
35
  adwords = AdwordsApi::Api.new
@@ -39,35 +41,50 @@ def add_negative_campaign_criterion()
39
41
  campaign_criterion_srv =
40
42
  adwords.service(:CampaignCriterionService, API_VERSION)
41
43
 
44
+ # Specify campaign ID to get targeting for.
42
45
  campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i
43
46
 
44
- # Prepare for adding criterion.
45
- operation = {
46
- :operator => 'ADD',
47
- :operand => {
48
- # The 'xsi_type' field allows you to specify the xsi:type of the object
49
- # being created. It's only necessary when you must provide an explicit
50
- # type that the client library can't infer.
51
- :xsi_type => 'NegativeCampaignCriterion',
52
- :campaign_id => campaign_id,
53
- :criterion => {
54
- :xsi_type => 'Keyword',
55
- :text => 'jupiter cruise',
56
- :match_type => 'BROAD'
57
- }
47
+ # Selector to get all the targeting for this campaign.
48
+ selector = {
49
+ :fields => ['Id', 'CriteriaType', 'KeywordText'],
50
+ :predicates => [
51
+ {:field => 'CampaignId', :operator => 'EQUALS', :values => [campaign_id]}
52
+ ],
53
+ :paging => {
54
+ :start_index => 0,
55
+ :number_results => PAGE_SIZE
58
56
  }
59
57
  }
60
58
 
61
- # Add criterion.
62
- response = campaign_criterion_srv.mutate([operation])
63
- campaign_criterion = response[:value].first
64
- puts 'Campaign criterion id %d was successfully added.' %
65
- campaign_criterion[:criterion][:id]
59
+ # Set initial values.
60
+ offset, page = 0, {}
61
+
62
+ begin
63
+ page = campaign_criterion_srv.get(selector)
64
+ if page[:entries]
65
+ page[:entries].each do |typed_criterion|
66
+ negative = typed_criterion[:xsi_type] == 'NegativeCampaignCriterion' ?
67
+ ' (negative)' : ''
68
+ criterion = typed_criterion[:criterion]
69
+ puts ("Campaign criterion%s with ID %d, type '%s' and text '%s'" +
70
+ " was found.") %
71
+ [negative, criterion[:id], criterion[:type], criterion[:text]]
72
+ end
73
+ # Increment values to request the next page.
74
+ offset += PAGE_SIZE
75
+ selector[:paging][:start_index] = offset
76
+ end
77
+ end while page[:total_num_entries] > offset
78
+
79
+ if page.include?(:total_num_entries)
80
+ puts "\tCampaign ID %d has %d criteria." %
81
+ [campaign_id, page[:total_num_entries]]
82
+ end
66
83
  end
67
84
 
68
85
  if __FILE__ == $0
69
86
  begin
70
- add_negative_campaign_criterion()
87
+ get_campaign_targeting_criteria()
71
88
 
72
89
  # HTTP errors.
73
90
  rescue AdsCommon::Errors::HttpError => e
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
4
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
@@ -17,8 +18,10 @@
17
18
  # See the License for the specific language governing permissions and
18
19
  # limitations under the License.
19
20
  #
20
- # This example illustrates how to retrieve all carriers available for targeting.
21
+ # This example illustrates how to retrieve all languages and carriers available
22
+ # for targeting.
21
23
  #
24
+ # Tags: ConstantDataService.getLanguageCriterion
22
25
  # Tags: ConstantDataService.getCarrierCriterion
23
26
 
24
27
  require 'rubygems'
@@ -26,7 +29,7 @@ require 'adwords_api'
26
29
 
27
30
  API_VERSION = :v201109
28
31
 
29
- def get_all_carriers()
32
+ def get_targetable_languages_and_carriers()
30
33
  # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
31
34
  # when called without parameters.
32
35
  adwords = AdwordsApi::Api.new
@@ -37,6 +40,18 @@ def get_all_carriers()
37
40
 
38
41
  constant_data_srv = adwords.service(:ConstantDataService, API_VERSION)
39
42
 
43
+ # Get all languages from ConstantDataService.
44
+ languages = constant_data_srv.get_language_criterion()
45
+
46
+ if languages
47
+ languages.each do |language|
48
+ puts "Language name is '%s', ID is %d and code is '%s'." %
49
+ [language[:name], language[:id], language[:code]]
50
+ end
51
+ else
52
+ puts 'No languages were found.'
53
+ end
54
+
40
55
  # Get all carriers from ConstantDataService.
41
56
  carriers = constant_data_srv.get_carrier_criterion()
42
57
 
@@ -52,7 +67,7 @@ end
52
67
 
53
68
  if __FILE__ == $0
54
69
  begin
55
- get_all_carriers()
70
+ get_targetable_languages_and_carriers()
56
71
 
57
72
  # HTTP errors.
58
73
  rescue AdsCommon::Errors::HttpError => e
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
4
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
@@ -26,7 +27,7 @@ require 'adwords_api'
26
27
 
27
28
  API_VERSION = :v201109
28
29
 
29
- def get_location_criteria()
30
+ def lookup_location()
30
31
  # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
31
32
  # when called without parameters.
32
33
  adwords = AdwordsApi::Api.new
@@ -83,7 +84,7 @@ end
83
84
 
84
85
  if __FILE__ == $0
85
86
  begin
86
- get_location_criteria()
87
+ lookup_location()
87
88
 
88
89
  # HTTP errors.
89
90
  rescue AdsCommon::Errors::HttpError => e
@@ -1,9 +1,9 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.sgomes@gmail.com (Sérgio Gomes)
4
4
  # api.dklimkin@gmail.com (Danial Klimkin)
5
5
  #
6
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
6
+ # Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
7
7
  #
8
8
  # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
9
  # you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.sgomes@gmail.com (Sérgio Gomes)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
5
+ # Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
6
6
  #
7
7
  # License:: Licensed under the Apache License, Version 2.0 (the "License");
8
8
  # you may not use this file except in compliance with the License.
@@ -41,46 +41,11 @@ module AdwordsApi
41
41
 
42
42
  # Set other constants
43
43
  API_NAME = 'AdwordsApi'
44
- CLIENT_LIB_VERSION = '0.4.5'
44
+ CLIENT_LIB_VERSION = '0.5.0'
45
45
  DEFAULT_CONFIG_FILENAME = 'adwords_api.yml'
46
46
 
47
47
  # Configure the services available to each version
48
48
  @@service_config = {
49
- :v13 => [:AccountService, :ReportService],
50
- :v200909 => [:AdExtensionOverrideService, :AdGroupAdService,
51
- :AdGroupCriterionService, :AdGroupService, :AdParamService,
52
- :BulkMutateJobService, :CampaignAdExtensionService,
53
- :CampaignCriterionService, :CampaignService,
54
- :CampaignTargetService, :GeoLocationService, :InfoService,
55
- :TargetingIdeaService],
56
- :v201003 => [:AdExtensionOverrideService, :AdGroupAdService,
57
- :AdGroupCriterionService, :AdGroupService, :AdParamService,
58
- :BidLandscapeService, :BulkMutateJobService,
59
- :CampaignAdExtensionService, :CampaignCriterionService,
60
- :CampaignService, :CampaignTargetService,
61
- :GeoLocationService, :InfoService, :MediaService,
62
- :ReportDefinitionService, :TargetingIdeaService],
63
- :v201008 => [:AdExtensionOverrideService, :AdGroupAdService,
64
- :AdGroupCriterionService, :AdGroupService, :AdParamService,
65
- :AlertService, :BidLandscapeService, :BulkMutateJobService,
66
- :CampaignAdExtensionService, :CampaignCriterionService,
67
- :CampaignService, :CampaignTargetService,
68
- :CustomerSyncService, :ExperimentService,
69
- :GeoLocationService, :InfoService, :MediaService,
70
- :ReportDefinitionService, :ServicedAccountService,
71
- :TargetingIdeaService, :TrafficEstimatorService,
72
- :UserListService],
73
- :v201101 => [:AdExtensionOverrideService, :AdGroupAdService,
74
- :AdGroupCriterionService, :AdGroupService, :AdParamService,
75
- :AlertService, :BulkMutateJobService,
76
- :BulkOpportunityService, :CampaignAdExtensionService,
77
- :CampaignCriterionService, :CampaignService,
78
- :CampaignTargetService, :ConversionTrackerService,
79
- :CustomerSyncService, :DataService, :ExperimentService,
80
- :GeoLocationService, :InfoService, :MediaService,
81
- :ReportDefinitionService, :ServicedAccountService,
82
- :TargetingIdeaService, :TrafficEstimatorService,
83
- :UserListService],
84
49
  :v201109 => [:AdExtensionOverrideService, :AdGroupAdService,
85
50
  :AdGroupCriterionService, :AdGroupService, :AdParamService,
86
51
  :AlertService, :BulkMutateJobService,
@@ -100,20 +65,10 @@ module AdwordsApi
100
65
  @@environment_config = {
101
66
  :PRODUCTION => {
102
67
  :oauth_scope => 'https://adwords.google.com/api/adwords/',
103
- :v13 => 'https://adwords.google.com/api/adwords/',
104
- :v200909 => 'https://adwords.google.com/api/adwords/',
105
- :v201003 => 'https://adwords.google.com/api/adwords/',
106
- :v201008 => 'https://adwords.google.com/api/adwords/',
107
- :v201101 => 'https://adwords.google.com/api/adwords/',
108
68
  :v201109 => 'https://adwords.google.com/api/adwords/'
109
69
  },
110
70
  :SANDBOX => {
111
71
  :oauth_scope => 'https://adwords-sandbox.google.com/api/adwords/',
112
- :v13 => 'https://sandbox.google.com/api/adwords/',
113
- :v200909 => 'https://adwords-sandbox.google.com/api/adwords/',
114
- :v201003 => 'https://adwords-sandbox.google.com/api/adwords/',
115
- :v201008 => 'https://adwords-sandbox.google.com/api/adwords/',
116
- :v201101 => 'https://adwords-sandbox.google.com/api/adwords/',
117
72
  :v201109 => 'https://adwords-sandbox.google.com/api/adwords/'
118
73
  }
119
74
  }
@@ -121,88 +76,6 @@ module AdwordsApi
121
76
  # Configure the subdirectories for each version / service pair.
122
77
  # A missing pair means that only the base URL is used.
123
78
  @@subdir_config = {
124
- # v13
125
- [:v13, :AccountService] => '',
126
- [:v13, :ReportService] => '',
127
- # v200909
128
- [:v200909, :AdExtensionOverrideService] => 'cm/',
129
- [:v200909, :AdGroupAdService] => 'cm/',
130
- [:v200909, :AdGroupCriterionService] => 'cm/',
131
- [:v200909, :AdGroupService] => 'cm/',
132
- [:v200909, :AdParamService] => 'cm/',
133
- [:v200909, :BulkMutateJobService] => 'job/',
134
- [:v200909, :CampaignAdExtensionService] => 'cm/',
135
- [:v200909, :CampaignCriterionService] => 'cm/',
136
- [:v200909, :CampaignService] => 'cm/',
137
- [:v200909, :CampaignTargetService] => 'cm/',
138
- [:v200909, :GeoLocationService] => 'cm/',
139
- [:v200909, :InfoService] => 'info/',
140
- [:v200909, :TargetingIdeaService] => 'o/',
141
- # v201003
142
- [:v201003, :AdExtensionOverrideService] => 'cm/',
143
- [:v201003, :AdGroupAdService] => 'cm/',
144
- [:v201003, :AdGroupCriterionService] => 'cm/',
145
- [:v201003, :AdGroupService] => 'cm/',
146
- [:v201003, :AdParamService] => 'cm/',
147
- [:v201003, :BidLandscapeService] => 'cm/',
148
- [:v201003, :BulkMutateJobService] => 'job/',
149
- [:v201003, :CampaignAdExtensionService] => 'cm/',
150
- [:v201003, :CampaignCriterionService] => 'cm/',
151
- [:v201003, :CampaignService] => 'cm/',
152
- [:v201003, :CampaignTargetService] => 'cm/',
153
- [:v201003, :GeoLocationService] => 'cm/',
154
- [:v201003, :InfoService] => 'info/',
155
- [:v201003, :MediaService] => 'cm/',
156
- [:v201003, :ReportDefinitionService] => 'cm/',
157
- [:v201003, :TargetingIdeaService] => 'o/',
158
- # v201008
159
- [:v201008, :AdExtensionOverrideService] => 'cm/',
160
- [:v201008, :AdGroupAdService] => 'cm/',
161
- [:v201008, :AdGroupCriterionService] => 'cm/',
162
- [:v201008, :AdGroupService] => 'cm/',
163
- [:v201008, :AdParamService] => 'cm/',
164
- [:v201008, :AlertService] => 'mcm/',
165
- [:v201008, :BidLandscapeService] => 'cm/',
166
- [:v201008, :BulkMutateJobService] => 'job/',
167
- [:v201008, :CampaignAdExtensionService] => 'cm/',
168
- [:v201008, :CampaignCriterionService] => 'cm/',
169
- [:v201008, :CampaignService] => 'cm/',
170
- [:v201008, :CampaignTargetService] => 'cm/',
171
- [:v201008, :CustomerSyncService] => 'ch/',
172
- [:v201008, :ExperimentService] => 'cm/',
173
- [:v201008, :GeoLocationService] => 'cm/',
174
- [:v201008, :InfoService] => 'info/',
175
- [:v201008, :MediaService] => 'cm/',
176
- [:v201008, :ReportDefinitionService] => 'cm/',
177
- [:v201008, :ServicedAccountService] => 'mcm/',
178
- [:v201008, :TargetingIdeaService] => 'o/',
179
- [:v201008, :TrafficEstimatorService] => 'o/',
180
- [:v201008, :UserListService] => 'cm/',
181
- # v201101
182
- [:v201101, :AdExtensionOverrideService] => 'cm/',
183
- [:v201101, :AdGroupAdService] => 'cm/',
184
- [:v201101, :AdGroupCriterionService] => 'cm/',
185
- [:v201101, :AdGroupService] => 'cm/',
186
- [:v201101, :AdParamService] => 'cm/',
187
- [:v201101, :AlertService] => 'mcm/',
188
- [:v201101, :BulkMutateJobService] => 'job/',
189
- [:v201101, :BulkOpportunityService] => 'o/',
190
- [:v201101, :CampaignAdExtensionService] => 'cm/',
191
- [:v201101, :CampaignCriterionService] => 'cm/',
192
- [:v201101, :CampaignService] => 'cm/',
193
- [:v201101, :CampaignTargetService] => 'cm/',
194
- [:v201101, :ConversionTrackerService] => 'cm/',
195
- [:v201101, :CustomerSyncService] => 'ch/',
196
- [:v201101, :DataService] => 'cm/',
197
- [:v201101, :ExperimentService] => 'cm/',
198
- [:v201101, :GeoLocationService] => 'cm/',
199
- [:v201101, :InfoService] => 'info/',
200
- [:v201101, :MediaService] => 'cm/',
201
- [:v201101, :ReportDefinitionService] => 'cm/',
202
- [:v201101, :ServicedAccountService] => 'mcm/',
203
- [:v201101, :TargetingIdeaService] => 'o/',
204
- [:v201101, :TrafficEstimatorService] => 'o/',
205
- [:v201101, :UserListService] => 'cm/',
206
79
  # v201109
207
80
  [:v201109, :AdExtensionOverrideService] => 'cm/',
208
81
  [:v201109, :AdGroupAdService] => 'cm/',
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
@@ -1,9 +1,9 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.sgomes@gmail.com (Sérgio Gomes)
4
4
  # api.dklimkin@gmail.com (Danial Klimkin)
5
5
  #
6
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
6
+ # Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
7
7
  #
8
8
  # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
9
  # you may not use this file except in compliance with the License.
@@ -1,8 +1,8 @@
1
- #!/usr/bin/ruby
1
+ # Encoding: utf-8
2
2
  #
3
3
  # Authors:: api.dklimkin@gmail.com (Danial Klimkin)
4
4
  #
5
- # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
5
+ # Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
6
6
  #
7
7
  # License:: Licensed under the Apache License, Version 2.0 (the "License");
8
8
  # you may not use this file except in compliance with the License.