google-adwords-api 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. data/ChangeLog +4 -0
  2. data/examples/v201109/misc/get_all_images_and_videos.rb +3 -4
  3. data/examples/v201109/misc/upload_image.rb +6 -7
  4. data/examples/v201109/optimization/get_keyword_ideas.rb +1 -2
  5. data/examples/v201109/optimization/get_placement_ideas.rb +1 -3
  6. data/examples/v201109_1/misc/get_all_images_and_videos.rb +3 -4
  7. data/examples/v201109_1/misc/upload_image.rb +6 -7
  8. data/examples/v201109_1/optimization/get_keyword_ideas.rb +1 -2
  9. data/examples/v201109_1/optimization/get_placement_ideas.rb +1 -3
  10. data/examples/v201206/misc/get_all_images_and_videos.rb +3 -4
  11. data/examples/v201206/misc/upload_image.rb +6 -7
  12. data/examples/v201206/optimization/get_keyword_ideas.rb +1 -2
  13. data/examples/v201206/optimization/get_placement_ideas.rb +1 -3
  14. data/examples/v201206/reporting/parallel_report_download.rb +12 -12
  15. data/lib/adwords_api.rb +9 -13
  16. data/lib/adwords_api/api_config.rb +2 -3
  17. data/lib/adwords_api/client_login_header_handler.rb +0 -47
  18. data/lib/adwords_api/credential_handler.rb +5 -17
  19. data/lib/adwords_api/errors.rb +7 -2
  20. data/lib/adwords_api/report_header_handler.rb +1 -1
  21. data/lib/adwords_api/utils.rb +0 -16
  22. data/lib/adwords_api/v201109/ad_extension_override_service.rb +1 -1
  23. data/lib/adwords_api/v201109/ad_extension_override_service_registry.rb +3 -3
  24. data/lib/adwords_api/v201109/ad_group_ad_service.rb +1 -1
  25. data/lib/adwords_api/v201109/ad_group_ad_service_registry.rb +3 -3
  26. data/lib/adwords_api/v201109/ad_group_criterion_service.rb +1 -1
  27. data/lib/adwords_api/v201109/ad_group_criterion_service_registry.rb +3 -3
  28. data/lib/adwords_api/v201109/ad_group_service.rb +1 -1
  29. data/lib/adwords_api/v201109/ad_group_service_registry.rb +3 -3
  30. data/lib/adwords_api/v201109/ad_param_service.rb +1 -1
  31. data/lib/adwords_api/v201109/ad_param_service_registry.rb +3 -3
  32. data/lib/adwords_api/v201109/alert_service.rb +1 -1
  33. data/lib/adwords_api/v201109/alert_service_registry.rb +3 -3
  34. data/lib/adwords_api/v201109/budget_order_service.rb +1 -1
  35. data/lib/adwords_api/v201109/budget_order_service_registry.rb +3 -3
  36. data/lib/adwords_api/v201109/bulk_mutate_job_service.rb +1 -1
  37. data/lib/adwords_api/v201109/bulk_mutate_job_service_registry.rb +3 -3
  38. data/lib/adwords_api/v201109/campaign_ad_extension_service.rb +1 -1
  39. data/lib/adwords_api/v201109/campaign_ad_extension_service_registry.rb +3 -3
  40. data/lib/adwords_api/v201109/campaign_criterion_service.rb +1 -1
  41. data/lib/adwords_api/v201109/campaign_criterion_service_registry.rb +3 -3
  42. data/lib/adwords_api/v201109/campaign_service.rb +1 -1
  43. data/lib/adwords_api/v201109/campaign_service_registry.rb +3 -3
  44. data/lib/adwords_api/v201109/campaign_target_service.rb +1 -1
  45. data/lib/adwords_api/v201109/campaign_target_service_registry.rb +3 -3
  46. data/lib/adwords_api/v201109/constant_data_service.rb +1 -1
  47. data/lib/adwords_api/v201109/constant_data_service_registry.rb +3 -3
  48. data/lib/adwords_api/v201109/conversion_tracker_service.rb +1 -1
  49. data/lib/adwords_api/v201109/conversion_tracker_service_registry.rb +3 -3
  50. data/lib/adwords_api/v201109/create_account_service.rb +1 -1
  51. data/lib/adwords_api/v201109/create_account_service_registry.rb +3 -3
  52. data/lib/adwords_api/v201109/customer_sync_service.rb +1 -1
  53. data/lib/adwords_api/v201109/customer_sync_service_registry.rb +3 -3
  54. data/lib/adwords_api/v201109/data_service.rb +1 -1
  55. data/lib/adwords_api/v201109/data_service_registry.rb +3 -3
  56. data/lib/adwords_api/v201109/experiment_service.rb +1 -1
  57. data/lib/adwords_api/v201109/experiment_service_registry.rb +3 -3
  58. data/lib/adwords_api/v201109/geo_location_service.rb +1 -1
  59. data/lib/adwords_api/v201109/geo_location_service_registry.rb +3 -3
  60. data/lib/adwords_api/v201109/info_service.rb +1 -1
  61. data/lib/adwords_api/v201109/info_service_registry.rb +3 -3
  62. data/lib/adwords_api/v201109/location_criterion_service.rb +1 -1
  63. data/lib/adwords_api/v201109/location_criterion_service_registry.rb +3 -3
  64. data/lib/adwords_api/v201109/media_service.rb +1 -1
  65. data/lib/adwords_api/v201109/media_service_registry.rb +3 -3
  66. data/lib/adwords_api/v201109/mutate_job_service.rb +1 -1
  67. data/lib/adwords_api/v201109/mutate_job_service_registry.rb +3 -3
  68. data/lib/adwords_api/v201109/report_definition_service.rb +1 -1
  69. data/lib/adwords_api/v201109/report_definition_service_registry.rb +3 -3
  70. data/lib/adwords_api/v201109/serviced_account_service.rb +1 -1
  71. data/lib/adwords_api/v201109/serviced_account_service_registry.rb +3 -3
  72. data/lib/adwords_api/v201109/targeting_idea_service.rb +1 -1
  73. data/lib/adwords_api/v201109/targeting_idea_service_registry.rb +3 -3
  74. data/lib/adwords_api/v201109/traffic_estimator_service.rb +1 -1
  75. data/lib/adwords_api/v201109/traffic_estimator_service_registry.rb +3 -3
  76. data/lib/adwords_api/v201109/user_list_service.rb +1 -1
  77. data/lib/adwords_api/v201109/user_list_service_registry.rb +3 -3
  78. data/lib/adwords_api/v201109_1/ad_extension_override_service.rb +1 -1
  79. data/lib/adwords_api/v201109_1/ad_extension_override_service_registry.rb +3 -3
  80. data/lib/adwords_api/v201109_1/ad_group_ad_service.rb +1 -1
  81. data/lib/adwords_api/v201109_1/ad_group_ad_service_registry.rb +3 -3
  82. data/lib/adwords_api/v201109_1/ad_group_criterion_service.rb +1 -1
  83. data/lib/adwords_api/v201109_1/ad_group_criterion_service_registry.rb +3 -3
  84. data/lib/adwords_api/v201109_1/ad_group_service.rb +1 -1
  85. data/lib/adwords_api/v201109_1/ad_group_service_registry.rb +3 -3
  86. data/lib/adwords_api/v201109_1/ad_param_service.rb +1 -1
  87. data/lib/adwords_api/v201109_1/ad_param_service_registry.rb +3 -3
  88. data/lib/adwords_api/v201109_1/alert_service.rb +1 -1
  89. data/lib/adwords_api/v201109_1/alert_service_registry.rb +3 -3
  90. data/lib/adwords_api/v201109_1/budget_order_service.rb +1 -1
  91. data/lib/adwords_api/v201109_1/budget_order_service_registry.rb +3 -3
  92. data/lib/adwords_api/v201109_1/bulk_mutate_job_service.rb +1 -1
  93. data/lib/adwords_api/v201109_1/bulk_mutate_job_service_registry.rb +3 -3
  94. data/lib/adwords_api/v201109_1/campaign_ad_extension_service.rb +1 -1
  95. data/lib/adwords_api/v201109_1/campaign_ad_extension_service_registry.rb +3 -3
  96. data/lib/adwords_api/v201109_1/campaign_criterion_service.rb +1 -1
  97. data/lib/adwords_api/v201109_1/campaign_criterion_service_registry.rb +3 -3
  98. data/lib/adwords_api/v201109_1/campaign_service.rb +1 -1
  99. data/lib/adwords_api/v201109_1/campaign_service_registry.rb +3 -3
  100. data/lib/adwords_api/v201109_1/campaign_target_service.rb +1 -1
  101. data/lib/adwords_api/v201109_1/campaign_target_service_registry.rb +3 -3
  102. data/lib/adwords_api/v201109_1/constant_data_service.rb +1 -1
  103. data/lib/adwords_api/v201109_1/constant_data_service_registry.rb +3 -3
  104. data/lib/adwords_api/v201109_1/conversion_tracker_service.rb +1 -1
  105. data/lib/adwords_api/v201109_1/conversion_tracker_service_registry.rb +3 -3
  106. data/lib/adwords_api/v201109_1/create_account_service.rb +1 -1
  107. data/lib/adwords_api/v201109_1/create_account_service_registry.rb +3 -3
  108. data/lib/adwords_api/v201109_1/customer_service.rb +1 -1
  109. data/lib/adwords_api/v201109_1/customer_service_registry.rb +3 -3
  110. data/lib/adwords_api/v201109_1/customer_sync_service.rb +1 -1
  111. data/lib/adwords_api/v201109_1/customer_sync_service_registry.rb +3 -3
  112. data/lib/adwords_api/v201109_1/data_service.rb +1 -1
  113. data/lib/adwords_api/v201109_1/data_service_registry.rb +3 -3
  114. data/lib/adwords_api/v201109_1/experiment_service.rb +1 -1
  115. data/lib/adwords_api/v201109_1/experiment_service_registry.rb +3 -3
  116. data/lib/adwords_api/v201109_1/geo_location_service.rb +1 -1
  117. data/lib/adwords_api/v201109_1/geo_location_service_registry.rb +3 -3
  118. data/lib/adwords_api/v201109_1/info_service.rb +1 -1
  119. data/lib/adwords_api/v201109_1/info_service_registry.rb +3 -3
  120. data/lib/adwords_api/v201109_1/location_criterion_service.rb +1 -1
  121. data/lib/adwords_api/v201109_1/location_criterion_service_registry.rb +3 -3
  122. data/lib/adwords_api/v201109_1/managed_customer_service.rb +1 -1
  123. data/lib/adwords_api/v201109_1/managed_customer_service_registry.rb +3 -3
  124. data/lib/adwords_api/v201109_1/media_service.rb +1 -1
  125. data/lib/adwords_api/v201109_1/media_service_registry.rb +3 -3
  126. data/lib/adwords_api/v201109_1/mutate_job_service.rb +1 -1
  127. data/lib/adwords_api/v201109_1/mutate_job_service_registry.rb +3 -3
  128. data/lib/adwords_api/v201109_1/report_definition_service.rb +1 -1
  129. data/lib/adwords_api/v201109_1/report_definition_service_registry.rb +3 -3
  130. data/lib/adwords_api/v201109_1/serviced_account_service.rb +1 -1
  131. data/lib/adwords_api/v201109_1/serviced_account_service_registry.rb +3 -3
  132. data/lib/adwords_api/v201109_1/targeting_idea_service.rb +1 -1
  133. data/lib/adwords_api/v201109_1/targeting_idea_service_registry.rb +3 -3
  134. data/lib/adwords_api/v201109_1/traffic_estimator_service.rb +1 -1
  135. data/lib/adwords_api/v201109_1/traffic_estimator_service_registry.rb +3 -3
  136. data/lib/adwords_api/v201109_1/user_list_service.rb +1 -1
  137. data/lib/adwords_api/v201109_1/user_list_service_registry.rb +3 -3
  138. data/lib/adwords_api/v201206/ad_extension_override_service.rb +1 -1
  139. data/lib/adwords_api/v201206/ad_extension_override_service_registry.rb +3 -3
  140. data/lib/adwords_api/v201206/ad_group_ad_service.rb +1 -1
  141. data/lib/adwords_api/v201206/ad_group_ad_service_registry.rb +3 -3
  142. data/lib/adwords_api/v201206/ad_group_criterion_service.rb +1 -1
  143. data/lib/adwords_api/v201206/ad_group_criterion_service_registry.rb +3 -3
  144. data/lib/adwords_api/v201206/ad_group_service.rb +1 -1
  145. data/lib/adwords_api/v201206/ad_group_service_registry.rb +3 -3
  146. data/lib/adwords_api/v201206/ad_param_service.rb +1 -1
  147. data/lib/adwords_api/v201206/ad_param_service_registry.rb +3 -3
  148. data/lib/adwords_api/v201206/alert_service.rb +1 -1
  149. data/lib/adwords_api/v201206/alert_service_registry.rb +3 -3
  150. data/lib/adwords_api/v201206/budget_order_service.rb +1 -1
  151. data/lib/adwords_api/v201206/budget_order_service_registry.rb +3 -3
  152. data/lib/adwords_api/v201206/bulk_mutate_job_service.rb +1 -1
  153. data/lib/adwords_api/v201206/bulk_mutate_job_service_registry.rb +3 -3
  154. data/lib/adwords_api/v201206/campaign_ad_extension_service.rb +1 -1
  155. data/lib/adwords_api/v201206/campaign_ad_extension_service_registry.rb +3 -3
  156. data/lib/adwords_api/v201206/campaign_criterion_service.rb +1 -1
  157. data/lib/adwords_api/v201206/campaign_criterion_service_registry.rb +3 -3
  158. data/lib/adwords_api/v201206/campaign_service.rb +1 -1
  159. data/lib/adwords_api/v201206/campaign_service_registry.rb +3 -3
  160. data/lib/adwords_api/v201206/constant_data_service.rb +1 -1
  161. data/lib/adwords_api/v201206/constant_data_service_registry.rb +3 -3
  162. data/lib/adwords_api/v201206/conversion_tracker_service.rb +1 -1
  163. data/lib/adwords_api/v201206/conversion_tracker_service_registry.rb +3 -3
  164. data/lib/adwords_api/v201206/customer_service.rb +1 -1
  165. data/lib/adwords_api/v201206/customer_service_registry.rb +3 -3
  166. data/lib/adwords_api/v201206/customer_sync_service.rb +1 -1
  167. data/lib/adwords_api/v201206/customer_sync_service_registry.rb +3 -3
  168. data/lib/adwords_api/v201206/data_service.rb +1 -1
  169. data/lib/adwords_api/v201206/data_service_registry.rb +3 -3
  170. data/lib/adwords_api/v201206/experiment_service.rb +1 -1
  171. data/lib/adwords_api/v201206/experiment_service_registry.rb +3 -3
  172. data/lib/adwords_api/v201206/geo_location_service.rb +1 -1
  173. data/lib/adwords_api/v201206/geo_location_service_registry.rb +3 -3
  174. data/lib/adwords_api/v201206/info_service.rb +1 -1
  175. data/lib/adwords_api/v201206/info_service_registry.rb +3 -3
  176. data/lib/adwords_api/v201206/location_criterion_service.rb +1 -1
  177. data/lib/adwords_api/v201206/location_criterion_service_registry.rb +3 -3
  178. data/lib/adwords_api/v201206/managed_customer_service.rb +1 -1
  179. data/lib/adwords_api/v201206/managed_customer_service_registry.rb +3 -3
  180. data/lib/adwords_api/v201206/media_service.rb +1 -1
  181. data/lib/adwords_api/v201206/media_service_registry.rb +3 -3
  182. data/lib/adwords_api/v201206/mutate_job_service.rb +1 -1
  183. data/lib/adwords_api/v201206/mutate_job_service_registry.rb +3 -3
  184. data/lib/adwords_api/v201206/report_definition_service.rb +1 -1
  185. data/lib/adwords_api/v201206/report_definition_service_registry.rb +3 -3
  186. data/lib/adwords_api/v201206/targeting_idea_service.rb +1 -1
  187. data/lib/adwords_api/v201206/targeting_idea_service_registry.rb +3 -3
  188. data/lib/adwords_api/v201206/traffic_estimator_service.rb +1 -1
  189. data/lib/adwords_api/v201206/traffic_estimator_service_registry.rb +3 -3
  190. data/lib/adwords_api/v201206/user_list_service.rb +1 -1
  191. data/lib/adwords_api/v201206/user_list_service_registry.rb +3 -3
  192. data/lib/adwords_api/version.rb +1 -1
  193. data/test/adwords_api/test_utils.rb +0 -13
  194. data/test/examples/v201109/test_reporting.rb +0 -5
  195. data/test/examples/v201109/utils.rb +1 -2
  196. data/test/examples/v201109_1/test_reporting.rb +0 -5
  197. data/test/examples/v201109_1/utils.rb +1 -2
  198. data/test/examples/v201206/test_reporting.rb +0 -5
  199. data/test/examples/v201206/utils.rb +1 -2
  200. metadata +4 -5
  201. data/examples/v201206/reporting/get_defined_reports.rb +0 -75
@@ -21,6 +21,6 @@
21
21
 
22
22
  module AdwordsApi
23
23
  module ApiConfig
24
- CLIENT_LIB_VERSION = '0.6.3'
24
+ CLIENT_LIB_VERSION = '0.7.0'
25
25
  end
26
26
  end
@@ -26,19 +26,6 @@ require 'adwords_api/utils'
26
26
 
27
27
  class TestUtils < Test::Unit::TestCase
28
28
 
29
- def test_map()
30
- param1 = [
31
- {:key => 'foo', :value => 'bar'},
32
- {:key => 'baz', :value => 'zar'},
33
- ]
34
- result1 = {'foo' => 'bar', 'baz' => 'zar'}
35
- assert_equal(result1, AdwordsApi::Utils::map(param1))
36
-
37
- param2 = []
38
- result2 = {}
39
- assert_equal(result2, AdwordsApi::Utils::map(param2))
40
- end
41
-
42
29
  def test_operation_index_for_error()
43
30
  error1 = {:field_path => 'operations[0].operand.adGroupId'}
44
31
  assert_equal(0, AdwordsApi::Utils::operation_index_for_error(error1))
@@ -25,7 +25,6 @@ require 'tempfile'
25
25
 
26
26
  require 'reporting/download_criteria_report'
27
27
  require 'reporting/get_campaign_stats'
28
- require 'reporting/get_defined_reports'
29
28
  require 'reporting/get_report_fields'
30
29
  require 'reporting/parallel_report_download'
31
30
 
@@ -56,10 +55,6 @@ class TestReportingV201109 < Test::Unit::TestCase
56
55
  get_campaign_stats()
57
56
  end
58
57
 
59
- def test_get_defined_reports
60
- get_defined_reports()
61
- end
62
-
63
58
  def test_get_report_fields
64
59
  report_type = 'ACCOUNT_PERFORMANCE_REPORT'
65
60
  get_report_fields(report_type)
@@ -74,8 +74,7 @@ class UtilsV201109
74
74
  :network_setting => {
75
75
  :target_google_search => true,
76
76
  :target_search_network => true,
77
- :target_content_network => false,
78
- :target_content_contextual => false
77
+ :target_content_network => true
79
78
  }
80
79
  }
81
80
  operation = {:operator => 'ADD', :operand => campaign}
@@ -25,7 +25,6 @@ require 'tempfile'
25
25
 
26
26
  require 'reporting/download_criteria_report'
27
27
  require 'reporting/get_campaign_stats'
28
- require 'reporting/get_defined_reports'
29
28
  require 'reporting/get_report_fields'
30
29
  require 'reporting/parallel_report_download'
31
30
 
@@ -56,10 +55,6 @@ class TestReportingV201109_1 < Test::Unit::TestCase
56
55
  get_campaign_stats()
57
56
  end
58
57
 
59
- def test_get_defined_reports
60
- get_defined_reports()
61
- end
62
-
63
58
  def test_get_report_fields
64
59
  report_type = 'ACCOUNT_PERFORMANCE_REPORT'
65
60
  get_report_fields(report_type)
@@ -74,8 +74,7 @@ class UtilsV201109_1
74
74
  :network_setting => {
75
75
  :target_google_search => true,
76
76
  :target_search_network => true,
77
- :target_content_network => false,
78
- :target_content_contextual => false
77
+ :target_content_network => true
79
78
  }
80
79
  }
81
80
  operation = {:operator => 'ADD', :operand => campaign}
@@ -26,7 +26,6 @@ require 'tempfile'
26
26
  require 'reporting/download_criteria_report'
27
27
  require 'reporting/download_criteria_report_with_awql'
28
28
  require 'reporting/get_campaign_stats'
29
- require 'reporting/get_defined_reports'
30
29
  require 'reporting/get_report_fields'
31
30
  require 'reporting/parallel_report_download'
32
31
 
@@ -67,10 +66,6 @@ class TestReportingV201206 < Test::Unit::TestCase
67
66
  get_campaign_stats()
68
67
  end
69
68
 
70
- def test_get_defined_reports()
71
- get_defined_reports()
72
- end
73
-
74
69
  def test_get_report_fields()
75
70
  report_type = 'ACCOUNT_PERFORMANCE_REPORT'
76
71
  get_report_fields(report_type)
@@ -74,8 +74,7 @@ class UtilsV201206
74
74
  :network_setting => {
75
75
  :target_google_search => true,
76
76
  :target_search_network => true,
77
- :target_content_network => false,
78
- :target_content_contextual => false
77
+ :target_content_network => true
79
78
  }
80
79
  }
81
80
  operation = {:operator => 'ADD', :operand => campaign}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-adwords-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-24 00:00:00.000000000 Z
12
+ date: 2012-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-ads-common
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.7.3
21
+ version: 0.8.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.7.3
29
+ version: 0.8.0
30
30
  description: google-adwords-api is a AdWords API client library for Ruby
31
31
  email:
32
32
  - api.dklimkin@gmail.com
@@ -362,7 +362,6 @@ files:
362
362
  - examples/v201109/remarketing/add_conversion_tracker.rb
363
363
  - examples/v201109/remarketing/add_audience.rb
364
364
  - examples/v201206/reporting/download_criteria_report.rb
365
- - examples/v201206/reporting/get_defined_reports.rb
366
365
  - examples/v201206/reporting/get_campaign_stats.rb
367
366
  - examples/v201206/reporting/parallel_report_download.rb
368
367
  - examples/v201206/reporting/get_report_fields.rb
@@ -1,75 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Encoding: utf-8
3
- #
4
- # Author:: api.sgomes@gmail.com (Sérgio Gomes)
5
- #
6
- # Copyright:: Copyright 2011, 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
- # This example gets all report definitions. Adding new definitions is
22
- # deprecated, please use AdHoc reporting.
23
- #
24
- # Tags: ReportDefinitionService.get
25
-
26
- require 'adwords_api'
27
-
28
- def get_defined_reports()
29
- # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
30
- # when called without parameters.
31
- adwords = AdwordsApi::Api.new
32
-
33
- # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
34
- # the configuration file or provide your own logger:
35
- # adwords.logger = Logger.new('adwords_xml.log')
36
-
37
- report_def_srv = adwords.service(:ReportDefinitionService, API_VERSION)
38
-
39
- # Get all the report definitions.
40
- selector = {}
41
- response = report_def_srv.get(selector)
42
- if response and response[:entries]
43
- entries = response[:entries]
44
- puts "#{entries.length} report definition(s) found."
45
- entries.each do |entry|
46
- puts " Report definition id is #{entry[:id]} and name is " +
47
- "\"#{entry[:report_name]}\"."
48
- end
49
- else
50
- puts 'No report definitions found.'
51
- end
52
- end
53
-
54
- if __FILE__ == $0
55
- API_VERSION = :v201206
56
-
57
- begin
58
- get_defined_reports()
59
-
60
- # HTTP errors.
61
- rescue AdsCommon::Errors::HttpError => e
62
- puts "HTTP Error: %s" % e
63
-
64
- # API errors.
65
- rescue AdwordsApi::Errors::ApiException => e
66
- puts "Message: %s" % e.message
67
- puts 'Errors:'
68
- e.errors.each_with_index do |error, index|
69
- puts "\tError [%d]:" % (index + 1)
70
- error.each do |field, value|
71
- puts "\t\t%s: %s" % [field, value]
72
- end
73
- end
74
- end
75
- end