google-adwords-api 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. data/ChangeLog +3 -0
  2. data/examples/v201306/misc/setup_oauth2.rb +4 -4
  3. data/examples/v201306/optimization/get_keyword_ideas.rb +1 -1
  4. data/examples/v201309/advanced_operations/add_site_links.rb +71 -9
  5. data/examples/v201309/advanced_operations/update_site_links.rb +194 -0
  6. data/examples/v201309/misc/setup_oauth2.rb +4 -4
  7. data/examples/v201309/optimization/get_keyword_ideas.rb +1 -1
  8. data/lib/adwords_api/api_config.rb +0 -88
  9. data/lib/adwords_api/version.rb +1 -1
  10. data/test/templates/v201306/basic_operations_get_campaigns.def +1 -1
  11. data/test/templates/v201306/misc_use_oauth2_jwt.def +1 -1
  12. data/test/templates/v201309/basic_operations_get_campaigns.def +1 -1
  13. data/test/templates/v201309/misc_use_oauth2_jwt.def +1 -1
  14. metadata +266 -429
  15. data/examples/v201302/account_management/create_account.rb +0 -95
  16. data/examples/v201302/account_management/get_account_alerts.rb +0 -122
  17. data/examples/v201302/account_management/get_account_changes.rb +0 -145
  18. data/examples/v201302/account_management/get_account_hierarchy.rb +0 -103
  19. data/examples/v201302/advanced_operations/add_ad_group_bid_modifier.rb +0 -105
  20. data/examples/v201302/advanced_operations/add_click_to_download_ad.rb +0 -137
  21. data/examples/v201302/advanced_operations/add_site_links.rb +0 -221
  22. data/examples/v201302/advanced_operations/create_and_attach_shared_keyword_set.rb +0 -147
  23. data/examples/v201302/advanced_operations/find_and_remove_criteria_from_shared_set.rb +0 -181
  24. data/examples/v201302/advanced_operations/get_ad_group_bid_modifiers.rb +0 -106
  25. data/examples/v201302/adwords_for_video/add_video_call_to_action.rb +0 -94
  26. data/examples/v201302/adwords_for_video/add_video_campaign.rb +0 -103
  27. data/examples/v201302/adwords_for_video/find_videos.rb +0 -92
  28. data/examples/v201302/adwords_for_video/get_keyword_criteria.rb +0 -101
  29. data/examples/v201302/adwords_for_video/get_targeting_groups.rb +0 -93
  30. data/examples/v201302/adwords_for_video/get_video_campaign_criteria.rb +0 -99
  31. data/examples/v201302/adwords_for_video/get_video_campaign_stats.rb +0 -126
  32. data/examples/v201302/adwords_for_video/get_video_campaigns.rb +0 -94
  33. data/examples/v201302/basic_operations/add_ad_groups.rb +0 -143
  34. data/examples/v201302/basic_operations/add_campaigns.rb +0 -162
  35. data/examples/v201302/basic_operations/add_keywords.rb +0 -116
  36. data/examples/v201302/basic_operations/add_text_ads.rb +0 -113
  37. data/examples/v201302/basic_operations/delete_ad.rb +0 -93
  38. data/examples/v201302/basic_operations/delete_ad_group.rb +0 -110
  39. data/examples/v201302/basic_operations/delete_campaign.rb +0 -111
  40. data/examples/v201302/basic_operations/delete_keyword.rb +0 -98
  41. data/examples/v201302/basic_operations/get_ad_groups.rb +0 -106
  42. data/examples/v201302/basic_operations/get_campaigns.rb +0 -101
  43. data/examples/v201302/basic_operations/get_campaigns_with_awql.rb +0 -93
  44. data/examples/v201302/basic_operations/get_keywords.rb +0 -112
  45. data/examples/v201302/basic_operations/get_text_ads.rb +0 -114
  46. data/examples/v201302/basic_operations/pause_ad.rb +0 -92
  47. data/examples/v201302/basic_operations/update_ad_group.rb +0 -89
  48. data/examples/v201302/basic_operations/update_campaign.rb +0 -90
  49. data/examples/v201302/basic_operations/update_keyword.rb +0 -110
  50. data/examples/v201302/campaign_management/add_experiment.rb +0 -166
  51. data/examples/v201302/campaign_management/add_keywords_in_bulk.rb +0 -158
  52. data/examples/v201302/campaign_management/add_location_extension.rb +0 -125
  53. data/examples/v201302/campaign_management/add_location_extension_override.rb +0 -91
  54. data/examples/v201302/campaign_management/get_all_disapproved_ads.rb +0 -101
  55. data/examples/v201302/campaign_management/get_all_disapproved_ads_with_awql.rb +0 -92
  56. data/examples/v201302/campaign_management/promote_experiment.rb +0 -85
  57. data/examples/v201302/campaign_management/set_ad_parameters.rb +0 -122
  58. data/examples/v201302/campaign_management/set_criterion_bid_modifier.rb +0 -110
  59. data/examples/v201302/campaign_management/validate_text_ad.rb +0 -114
  60. data/examples/v201302/error_handling/handle_captcha_challenge.rb +0 -93
  61. data/examples/v201302/error_handling/handle_partial_failures.rb +0 -134
  62. data/examples/v201302/error_handling/handle_policy_violation_error.rb +0 -145
  63. data/examples/v201302/error_handling/handle_two_factor_authorization_error.rb +0 -88
  64. data/examples/v201302/migration/set_campaign_enhanced.rb +0 -91
  65. data/examples/v201302/migration/upgrade_legacy_sitelinks.rb +0 -313
  66. data/examples/v201302/misc/get_all_images_and_videos.rb +0 -108
  67. data/examples/v201302/misc/setup_oauth2.rb +0 -88
  68. data/examples/v201302/misc/upload_image.rb +0 -97
  69. data/examples/v201302/misc/use_oauth2_jwt.rb +0 -93
  70. data/examples/v201302/optimization/estimate_keyword_traffic.rb +0 -137
  71. data/examples/v201302/optimization/get_keyword_bid_simulations.rb +0 -100
  72. data/examples/v201302/optimization/get_keyword_ideas.rb +0 -130
  73. data/examples/v201302/optimization/get_placement_ideas.rb +0 -112
  74. data/examples/v201302/remarketing/add_audience.rb +0 -123
  75. data/examples/v201302/remarketing/add_conversion_tracker.rb +0 -104
  76. data/examples/v201302/reporting/download_criteria_report.rb +0 -87
  77. data/examples/v201302/reporting/download_criteria_report_with_awql.rb +0 -86
  78. data/examples/v201302/reporting/get_campaign_stats.rb +0 -113
  79. data/examples/v201302/reporting/get_report_fields.rb +0 -79
  80. data/examples/v201302/reporting/parallel_report_download.rb +0 -171
  81. data/examples/v201302/targeting/add_campaign_targeting_criteria.rb +0 -123
  82. data/examples/v201302/targeting/add_demographic_targeting_criteria.rb +0 -116
  83. data/examples/v201302/targeting/get_campaign_targeting_criteria.rb +0 -110
  84. data/examples/v201302/targeting/get_targetable_languages_and_carriers.rb +0 -94
  85. data/examples/v201302/targeting/lookup_location.rb +0 -112
  86. data/examples/v201309/campaign_management/add_location_extension_override.rb +0 -91
  87. data/examples/v201309/reporting/get_campaign_stats.rb +0 -113
  88. data/lib/adwords_api/v201302/ad_extension_override_service.rb +0 -38
  89. data/lib/adwords_api/v201302/ad_extension_override_service_registry.rb +0 -46
  90. data/lib/adwords_api/v201302/ad_group_ad_service.rb +0 -42
  91. data/lib/adwords_api/v201302/ad_group_ad_service_registry.rb +0 -46
  92. data/lib/adwords_api/v201302/ad_group_bid_modifier_service.rb +0 -38
  93. data/lib/adwords_api/v201302/ad_group_bid_modifier_service_registry.rb +0 -46
  94. data/lib/adwords_api/v201302/ad_group_criterion_service.rb +0 -42
  95. data/lib/adwords_api/v201302/ad_group_criterion_service_registry.rb +0 -46
  96. data/lib/adwords_api/v201302/ad_group_feed_service.rb +0 -38
  97. data/lib/adwords_api/v201302/ad_group_feed_service_registry.rb +0 -47
  98. data/lib/adwords_api/v201302/ad_group_service.rb +0 -42
  99. data/lib/adwords_api/v201302/ad_group_service_registry.rb +0 -46
  100. data/lib/adwords_api/v201302/ad_param_service.rb +0 -38
  101. data/lib/adwords_api/v201302/ad_param_service_registry.rb +0 -46
  102. data/lib/adwords_api/v201302/alert_service.rb +0 -34
  103. data/lib/adwords_api/v201302/alert_service_registry.rb +0 -46
  104. data/lib/adwords_api/v201302/budget_order_service.rb +0 -42
  105. data/lib/adwords_api/v201302/budget_order_service_registry.rb +0 -46
  106. data/lib/adwords_api/v201302/budget_service.rb +0 -38
  107. data/lib/adwords_api/v201302/budget_service_registry.rb +0 -46
  108. data/lib/adwords_api/v201302/campaign_ad_extension_service.rb +0 -38
  109. data/lib/adwords_api/v201302/campaign_ad_extension_service_registry.rb +0 -46
  110. data/lib/adwords_api/v201302/campaign_criterion_service.rb +0 -42
  111. data/lib/adwords_api/v201302/campaign_criterion_service_registry.rb +0 -46
  112. data/lib/adwords_api/v201302/campaign_feed_service.rb +0 -38
  113. data/lib/adwords_api/v201302/campaign_feed_service_registry.rb +0 -46
  114. data/lib/adwords_api/v201302/campaign_service.rb +0 -42
  115. data/lib/adwords_api/v201302/campaign_service_registry.rb +0 -46
  116. data/lib/adwords_api/v201302/campaign_shared_set_service.rb +0 -38
  117. data/lib/adwords_api/v201302/campaign_shared_set_service_registry.rb +0 -47
  118. data/lib/adwords_api/v201302/constant_data_service.rb +0 -62
  119. data/lib/adwords_api/v201302/constant_data_service_registry.rb +0 -46
  120. data/lib/adwords_api/v201302/conversion_tracker_service.rb +0 -38
  121. data/lib/adwords_api/v201302/conversion_tracker_service_registry.rb +0 -46
  122. data/lib/adwords_api/v201302/customer_service.rb +0 -34
  123. data/lib/adwords_api/v201302/customer_service_registry.rb +0 -46
  124. data/lib/adwords_api/v201302/customer_sync_service.rb +0 -34
  125. data/lib/adwords_api/v201302/customer_sync_service_registry.rb +0 -47
  126. data/lib/adwords_api/v201302/data_service.rb +0 -38
  127. data/lib/adwords_api/v201302/data_service_registry.rb +0 -46
  128. data/lib/adwords_api/v201302/experiment_service.rb +0 -38
  129. data/lib/adwords_api/v201302/experiment_service_registry.rb +0 -46
  130. data/lib/adwords_api/v201302/feed_item_service.rb +0 -38
  131. data/lib/adwords_api/v201302/feed_item_service_registry.rb +0 -46
  132. data/lib/adwords_api/v201302/feed_mapping_service.rb +0 -38
  133. data/lib/adwords_api/v201302/feed_mapping_service_registry.rb +0 -46
  134. data/lib/adwords_api/v201302/feed_service.rb +0 -38
  135. data/lib/adwords_api/v201302/feed_service_registry.rb +0 -46
  136. data/lib/adwords_api/v201302/geo_location_service.rb +0 -34
  137. data/lib/adwords_api/v201302/geo_location_service_registry.rb +0 -46
  138. data/lib/adwords_api/v201302/location_criterion_service.rb +0 -34
  139. data/lib/adwords_api/v201302/location_criterion_service_registry.rb +0 -46
  140. data/lib/adwords_api/v201302/managed_customer_service.rb +0 -50
  141. data/lib/adwords_api/v201302/managed_customer_service_registry.rb +0 -46
  142. data/lib/adwords_api/v201302/media_service.rb +0 -38
  143. data/lib/adwords_api/v201302/media_service_registry.rb +0 -46
  144. data/lib/adwords_api/v201302/mutate_job_service.rb +0 -42
  145. data/lib/adwords_api/v201302/mutate_job_service_registry.rb +0 -46
  146. data/lib/adwords_api/v201302/report_definition_service.rb +0 -34
  147. data/lib/adwords_api/v201302/report_definition_service_registry.rb +0 -46
  148. data/lib/adwords_api/v201302/shared_criterion_service.rb +0 -38
  149. data/lib/adwords_api/v201302/shared_criterion_service_registry.rb +0 -47
  150. data/lib/adwords_api/v201302/shared_set_service.rb +0 -38
  151. data/lib/adwords_api/v201302/shared_set_service_registry.rb +0 -47
  152. data/lib/adwords_api/v201302/targeting_idea_service.rb +0 -38
  153. data/lib/adwords_api/v201302/targeting_idea_service_registry.rb +0 -46
  154. data/lib/adwords_api/v201302/traffic_estimator_service.rb +0 -34
  155. data/lib/adwords_api/v201302/traffic_estimator_service_registry.rb +0 -46
  156. data/lib/adwords_api/v201302/user_list_service.rb +0 -38
  157. data/lib/adwords_api/v201302/user_list_service_registry.rb +0 -46
  158. data/lib/adwords_api/v201302/video_ad_service.rb +0 -38
  159. data/lib/adwords_api/v201302/video_ad_service_registry.rb +0 -46
  160. data/lib/adwords_api/v201302/video_campaign_criterion_service.rb +0 -38
  161. data/lib/adwords_api/v201302/video_campaign_criterion_service_registry.rb +0 -47
  162. data/lib/adwords_api/v201302/video_campaign_service.rb +0 -38
  163. data/lib/adwords_api/v201302/video_campaign_service_registry.rb +0 -46
  164. data/lib/adwords_api/v201302/video_service.rb +0 -42
  165. data/lib/adwords_api/v201302/video_service_registry.rb +0 -46
  166. data/lib/adwords_api/v201302/video_targeting_group_criterion_service.rb +0 -38
  167. data/lib/adwords_api/v201302/video_targeting_group_criterion_service_registry.rb +0 -46
  168. data/lib/adwords_api/v201302/video_targeting_group_service.rb +0 -38
  169. data/lib/adwords_api/v201302/video_targeting_group_service_registry.rb +0 -46
  170. data/test/examples/v201302/test_account_management.rb +0 -50
  171. data/test/examples/v201302/test_advanced_operations.rb +0 -81
  172. data/test/examples/v201302/test_basic_operations.rb +0 -177
  173. data/test/examples/v201302/test_campaign_management.rb +0 -132
  174. data/test/examples/v201302/test_error_handling.rb +0 -63
  175. data/test/examples/v201302/test_migration.rb +0 -49
  176. data/test/examples/v201302/test_misc.rb +0 -39
  177. data/test/examples/v201302/test_optimization.rb +0 -63
  178. data/test/examples/v201302/test_remarketing.rb +0 -39
  179. data/test/examples/v201302/test_reporting.rb +0 -84
  180. data/test/examples/v201302/test_targeting.rb +0 -68
  181. data/test/examples/v201302/utils.rb +0 -267
  182. data/test/suite_exampletests_v201302.rb +0 -37
  183. data/test/templates/v201302/basic_operations_get_campaigns.def +0 -114
  184. data/test/templates/v201302/misc_use_oauth2_jwt.def +0 -131
@@ -1,132 +0,0 @@
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/set_criterion_bid_modifier'
34
- require 'campaign_management/validate_text_ad'
35
-
36
- RETRY_INTERVAL = 5
37
- RETRIES_COUNT = 3
38
- KEYWORD_NUMBER = 3
39
-
40
- class TestCampaignManagementV201302 < Test::Unit::TestCase
41
- def setup
42
- @logger = Logger.new(STDOUT)
43
- @logger.level = Logger::ERROR
44
- @adwords = AdwordsApi::Api.new
45
- @adwords.logger = @logger
46
- @utils = UtilsV201302.new(@adwords)
47
- end
48
-
49
- def test_add_experiment
50
- campaign = @utils.get_campaign()
51
- ad_group = @utils.get_ad_group()
52
- criterion = @utils.get_keyword()
53
- assert_not_nil(campaign)
54
- assert_not_nil(campaign[:id])
55
- assert_not_nil(ad_group)
56
- assert_not_nil(ad_group[:id])
57
- assert_not_nil(criterion)
58
- assert_not_nil(criterion[:criterion])
59
- assert_not_nil(criterion[:criterion][:id])
60
- add_experiment(campaign[:id], ad_group[:id], criterion[:criterion][:id])
61
- end
62
-
63
- def test_add_keywords_in_bulk
64
- add_keywords_in_bulk()
65
- end
66
-
67
- def test_add_location_extension
68
- campaign = @utils.get_campaign()
69
- assert_not_nil(campaign)
70
- assert_not_nil(campaign[:id])
71
- add_location_extension(campaign[:id])
72
- end
73
-
74
- def test_add_location_extension_override
75
- ad = @utils.get_ad()
76
- location_extension = @utils.get_location_extension()
77
- assert_not_nil(ad)
78
- assert_not_nil(ad[:ad])
79
- assert_not_nil(ad[:ad][:id])
80
- assert_not_nil(location_extension)
81
- assert_not_nil(location_extension[:ad_extension])
82
- assert_not_nil(location_extension[:ad_extension][:id])
83
- add_location_extension_override(
84
- ad[:ad][:id], location_extension[:ad_extension][:id])
85
- end
86
-
87
- def test_get_all_disapproved_ads
88
- ad_group = @utils.get_ad_group()
89
- assert_not_nil(ad_group)
90
- assert_not_nil(ad_group[:id])
91
- get_all_disapproved_ads(ad_group[:id])
92
- end
93
-
94
- def test_get_all_disapproved_ads_with_awql
95
- ad_group = @utils.get_ad_group()
96
- assert_not_nil(ad_group)
97
- assert_not_nil(ad_group[:id])
98
- get_all_disapproved_ads_with_awql(ad_group[:id])
99
- end
100
-
101
- def test_promote_experiment
102
- experiment = @utils.get_experiment()
103
- assert_not_nil(experiment)
104
- assert_not_nil(experiment[:id])
105
- promote_experiment(experiment[:id])
106
- end
107
-
108
- def test_set_ad_parameters
109
- ad_group = @utils.get_ad_group()
110
- assert_not_nil(ad_group)
111
- assert_not_nil(ad_group[:id])
112
- criterion = @utils.get_keyword()
113
- assert_not_nil(criterion)
114
- assert_not_nil(criterion[:criterion])
115
- assert_not_nil(criterion[:criterion][:id])
116
- set_ad_parameters(ad_group[:id], criterion[:criterion][:id])
117
- end
118
-
119
- def test_set_criterion_bid_modifier()
120
- campaign = @utils.get_campaign()
121
- assert_not_nil(campaign)
122
- assert_not_nil(campaign[:id])
123
- set_criterion_bid_modifier(campaign[:id], 1.5)
124
- end
125
-
126
- def test_validate_text_ad
127
- ad_group = @utils.get_ad_group()
128
- assert_not_nil(ad_group)
129
- assert_not_nil(ad_group[:id])
130
- validate_text_ad(ad_group[:id])
131
- end
132
- end
@@ -1,63 +0,0 @@
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 error handling examples.
22
-
23
- require 'test/unit'
24
-
25
- require 'error_handling/handle_captcha_challenge'
26
- require 'error_handling/handle_partial_failures'
27
- require 'error_handling/handle_policy_violation_error'
28
- require 'error_handling/handle_two_factor_authorization_error'
29
-
30
- MAX_RETRIES = 50
31
-
32
- class TestErrorHandlingV201302 < Test::Unit::TestCase
33
- def setup
34
- @logger = Logger.new(STDOUT)
35
- @logger.level = Logger::ERROR
36
- @adwords = AdwordsApi::Api.new
37
- @adwords.logger = @logger
38
- @utils = UtilsV201302.new(@adwords)
39
- end
40
-
41
- # This test is disabled as it requires user input.
42
- def disabled_test_handle_captcha_challenge
43
- handle_captcha_challenge()
44
- end
45
-
46
- def test_handle_partial_failures
47
- ad_group = @utils.get_ad_group()
48
- assert_not_nil(ad_group)
49
- assert_not_nil(ad_group[:id])
50
- handle_partial_failures(ad_group[:id])
51
- end
52
-
53
- def test_handle_policy_violation_error
54
- ad_group = @utils.get_ad_group()
55
- assert_not_nil(ad_group)
56
- assert_not_nil(ad_group[:id])
57
- handle_policy_violation_error(ad_group[:id])
58
- end
59
-
60
- def test_handle_two_factor_authorization_error
61
- handle_two_factor_authorization_error()
62
- end
63
- end
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Encoding: utf-8
3
- #
4
- # Author:: api.dklimkin@gmail.com (Danial Klimkin)
5
- #
6
- # Copyright:: Copyright 2013, 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 migration examples.
22
-
23
- require 'test/unit'
24
-
25
- require 'migration/set_campaign_enhanced'
26
-
27
- class TestMigrationV201302 < Test::Unit::TestCase
28
- def setup
29
- @logger = Logger.new(STDOUT)
30
- @logger.level = Logger::ERROR
31
- @adwords = AdwordsApi::Api.new
32
- @adwords.logger = @logger
33
- @utils = UtilsV201302.new(@adwords)
34
- end
35
-
36
- def test_set_campaign_enhanced()
37
- campaign = @utils.get_campaign()
38
- assert_not_nil(campaign)
39
- assert_not_nil(campaign[:id])
40
- set_campaign_enhanced(campaign[:id])
41
- end
42
-
43
- def test_upgrade_legacy_sitelinks()
44
- campaign = @utils.get_campaign()
45
- assert_not_nil(campaign)
46
- assert_not_nil(campaign[:id])
47
- upgrade_legacy_sitelinks([campaign[:id]])
48
- end
49
- end
@@ -1,39 +0,0 @@
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 misc examples.
22
-
23
- require 'test/unit'
24
-
25
- require 'misc/get_all_images_and_videos'
26
- require 'misc/upload_image'
27
-
28
- class TestMiscV201302 < Test::Unit::TestCase
29
- def setup
30
- end
31
-
32
- def test_get_all_images_and_videos
33
- get_all_images_and_videos()
34
- end
35
-
36
- def test_upload_image
37
- upload_image()
38
- end
39
- end
@@ -1,63 +0,0 @@
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 optimization examples.
22
-
23
- require 'test/unit'
24
-
25
- require 'optimization/estimate_keyword_traffic'
26
- require 'optimization/get_keyword_bid_simulations'
27
- require 'optimization/get_keyword_ideas'
28
- require 'optimization/get_placement_ideas'
29
-
30
- class TestOptimizationV201302 < Test::Unit::TestCase
31
- def setup
32
- @logger = Logger.new(STDOUT)
33
- @logger.level = Logger::ERROR
34
- @adwords = AdwordsApi::Api.new
35
- @adwords.logger = @logger
36
- @utils = UtilsV201302.new(@adwords)
37
- end
38
-
39
- def test_estimate_keyword_traffic
40
- estimate_keyword_traffic()
41
- end
42
-
43
- def test_get_keyword_bid_simulations
44
- ad_group = @utils.get_ad_group()
45
- assert_not_nil(ad_group)
46
- assert_not_nil(ad_group[:id])
47
- keyword = @utils.get_keyword()
48
- assert_not_nil(keyword)
49
- assert_not_nil(keyword[:criterion])
50
- assert_not_nil(keyword[:criterion][:id])
51
- get_criterion_bid_landscapes(ad_group[:id], keyword[:criterion][:id])
52
- end
53
-
54
- def test_get_keyword_ideas
55
- keyword_text = 'orion tours'
56
- get_keyword_ideas(keyword_text)
57
- end
58
-
59
- def test_get_placement_ideas
60
- url = 'http://example.google.com'
61
- get_placement_ideas(url)
62
- end
63
- end
@@ -1,39 +0,0 @@
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 remarketing examples.
22
-
23
- require 'test/unit'
24
-
25
- require 'remarketing/add_audience'
26
- require 'remarketing/add_conversion_tracker'
27
-
28
- class TestRemarketingV201302 < Test::Unit::TestCase
29
- def setup
30
- end
31
-
32
- def test_add_audience
33
- add_audience()
34
- end
35
-
36
- def test_add_conversion_tracker
37
- add_conversion_tracker()
38
- end
39
- end
@@ -1,84 +0,0 @@
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 reporting examples.
22
-
23
- require 'test/unit'
24
- require 'tempfile'
25
-
26
- require 'reporting/download_criteria_report'
27
- require 'reporting/download_criteria_report_with_awql'
28
- require 'reporting/get_campaign_stats'
29
- require 'reporting/get_report_fields'
30
- require 'reporting/parallel_report_download'
31
-
32
- THREADS = 3
33
- MAX_RETRIES = 3
34
- BACKOFF_FACTOR = 3
35
-
36
- class TestReportingV201302 < Test::Unit::TestCase
37
- def setup()
38
- @logger = Logger.new(STDOUT)
39
- @logger.level = Logger::ERROR
40
- @adwords = AdwordsApi::Api.new()
41
- @adwords.logger = @logger
42
- @utils = UtilsV201302.new(@adwords)
43
- end
44
-
45
- def test_download_criteria_report()
46
- file = Tempfile.new('ruby-examples')
47
- begin
48
- file.close()
49
- download_criteria_report(file.path)
50
- ensure
51
- file.unlink()
52
- end
53
- end
54
-
55
- def test_download_criteria_report_with_awql()
56
- file = Tempfile.new('ruby-examples')
57
- begin
58
- file.close()
59
- download_criteria_report_with_awql(file.path, 'CSV')
60
- ensure
61
- file.unlink()
62
- end
63
- end
64
-
65
- def test_get_campaign_stats()
66
- get_campaign_stats()
67
- end
68
-
69
- def test_get_report_fields()
70
- report_type = 'ACCOUNT_PERFORMANCE_REPORT'
71
- get_report_fields(report_type)
72
- end
73
-
74
- def test_parallel_report_download()
75
- old_dir = Dir.pwd
76
- Dir.chdir('/tmp')
77
- begin
78
- parallel_report_download()
79
- ensure
80
- Dir.chdir(old_dir)
81
- end
82
- end
83
- end
84
-