google-adwords-api 0.16.0 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/COPYING +1 -1
- data/ChangeLog +4 -0
- data/README.md +6 -7
- data/adwords_api.yml +1 -1
- data/examples/v201502/account_management/create_account.rb +0 -4
- data/examples/v201502/account_management/get_account_changes.rb +0 -4
- data/examples/v201502/account_management/get_account_hierarchy.rb +0 -4
- data/examples/v201502/advanced_operations/add_ad_customizers.rb +0 -5
- data/examples/v201502/advanced_operations/add_ad_group_bid_modifier.rb +0 -4
- data/examples/v201502/advanced_operations/add_click_to_download_ad.rb +0 -4
- data/examples/v201502/advanced_operations/add_text_ad_with_upgraded_urls.rb +0 -4
- data/examples/v201502/advanced_operations/create_and_attach_shared_keyword_set.rb +0 -4
- data/examples/v201502/advanced_operations/find_and_remove_criteria_from_shared_set.rb +0 -5
- data/examples/v201502/advanced_operations/get_ad_group_bid_modifiers.rb +0 -4
- data/examples/v201502/advanced_operations/upload_offline_conversions.rb +0 -4
- data/examples/v201502/advanced_operations/use_shared_bidding_strategy.rb +0 -5
- data/examples/v201502/basic_operations/add_ad_groups.rb +0 -4
- data/examples/v201502/basic_operations/add_campaigns.rb +0 -4
- data/examples/v201502/basic_operations/add_keywords.rb +0 -4
- data/examples/v201502/basic_operations/add_text_ads.rb +0 -4
- data/examples/v201502/basic_operations/get_ad_groups.rb +0 -4
- data/examples/v201502/basic_operations/get_campaigns.rb +0 -4
- data/examples/v201502/basic_operations/get_campaigns_with_awql.rb +0 -4
- data/examples/v201502/basic_operations/get_keywords.rb +0 -4
- data/examples/v201502/basic_operations/get_text_ads.rb +0 -4
- data/examples/v201502/basic_operations/pause_ad.rb +0 -4
- data/examples/v201502/basic_operations/remove_ad.rb +0 -4
- data/examples/v201502/basic_operations/remove_ad_group.rb +0 -4
- data/examples/v201502/basic_operations/remove_campaign.rb +0 -4
- data/examples/v201502/basic_operations/remove_keyword.rb +0 -4
- data/examples/v201502/basic_operations/update_ad_group.rb +0 -4
- data/examples/v201502/basic_operations/update_campaign.rb +0 -4
- data/examples/v201502/basic_operations/update_keyword.rb +0 -4
- data/examples/v201502/campaign_management/add_campaign_labels.rb +0 -4
- data/examples/v201502/campaign_management/add_experiment.rb +0 -4
- data/examples/v201502/campaign_management/add_keywords_in_bulk.rb +0 -5
- data/examples/v201502/campaign_management/get_all_disapproved_ads.rb +0 -4
- data/examples/v201502/campaign_management/get_all_disapproved_ads_with_awql.rb +0 -4
- data/examples/v201502/campaign_management/get_campaigns_by_label.rb +0 -4
- data/examples/v201502/campaign_management/promote_experiment.rb +0 -4
- data/examples/v201502/campaign_management/set_ad_parameters.rb +0 -4
- data/examples/v201502/campaign_management/set_criterion_bid_modifier.rb +0 -4
- data/examples/v201502/campaign_management/validate_text_ad.rb +0 -4
- data/examples/v201502/error_handling/handle_partial_failures.rb +0 -4
- data/examples/v201502/error_handling/handle_policy_violation_error.rb +0 -4
- data/examples/v201502/extensions/add_google_my_business_location_extensions.rb +0 -4
- data/examples/v201502/extensions/add_site_links.rb +0 -4
- data/examples/v201502/extensions/add_site_links_using_feeds.rb +0 -5
- data/examples/v201502/migration/migrate_to_extension_settings.rb +0 -6
- data/examples/v201502/migration/upgrade_ad_url.rb +0 -4
- data/examples/v201502/misc/create_ad_words_session_without_properties_file.rb +0 -2
- data/examples/v201502/misc/get_all_images_and_videos.rb +0 -4
- data/examples/v201502/misc/setup_oauth2.rb +0 -4
- data/examples/v201502/misc/upload_image.rb +0 -4
- data/examples/v201502/misc/use_oauth2_jwt.rb +0 -4
- data/examples/v201502/optimization/estimate_keyword_traffic.rb +0 -4
- data/examples/v201502/optimization/get_keyword_bid_simulations.rb +0 -4
- data/examples/v201502/optimization/get_keyword_ideas.rb +0 -4
- data/examples/v201502/remarketing/add_audience.rb +0 -4
- data/examples/v201502/remarketing/add_conversion_tracker.rb +0 -4
- data/examples/v201502/remarketing/add_rule_based_user_lists.rb +0 -4
- data/examples/v201502/reporting/download_criteria_report.rb +0 -2
- data/examples/v201502/reporting/download_criteria_report_with_awql.rb +0 -2
- data/examples/v201502/reporting/get_report_fields.rb +0 -4
- data/examples/v201502/reporting/parallel_report_download.rb +0 -2
- data/examples/v201502/shopping_campaigns/add_product_partition_tree.rb +0 -2
- data/examples/v201502/shopping_campaigns/add_product_scope.rb +0 -4
- data/examples/v201502/shopping_campaigns/add_shopping_campaign.rb +0 -4
- data/examples/v201502/shopping_campaigns/get_product_category_taxonomy.rb +6 -8
- data/examples/v201502/targeting/add_campaign_targeting_criteria.rb +0 -4
- data/examples/v201502/targeting/add_demographic_targeting_criteria.rb +0 -4
- data/examples/v201502/targeting/get_campaign_targeting_criteria.rb +0 -4
- data/examples/v201502/targeting/get_targetable_languages_and_carriers.rb +0 -5
- data/examples/v201502/targeting/lookup_location.rb +0 -4
- data/examples/v201506/account_management/create_account.rb +1 -5
- data/examples/v201506/account_management/get_account_changes.rb +1 -5
- data/examples/v201506/account_management/get_account_hierarchy.rb +1 -5
- data/examples/v201506/advanced_operations/add_ad_customizers.rb +1 -6
- data/examples/v201506/advanced_operations/add_ad_group_bid_modifier.rb +1 -5
- data/examples/v201506/advanced_operations/add_click_to_download_ad.rb +1 -5
- data/examples/v201506/advanced_operations/add_text_ad_with_upgraded_urls.rb +1 -5
- data/examples/v201506/advanced_operations/create_and_attach_shared_keyword_set.rb +8 -4
- data/examples/v201506/advanced_operations/find_and_remove_criteria_from_shared_set.rb +8 -5
- data/examples/v201506/advanced_operations/get_ad_group_bid_modifiers.rb +1 -5
- data/examples/v201506/advanced_operations/upload_offline_conversions.rb +1 -5
- data/examples/v201506/advanced_operations/use_shared_bidding_strategy.rb +1 -6
- data/examples/v201506/basic_operations/add_ad_groups.rb +1 -5
- data/examples/v201506/basic_operations/add_campaigns.rb +1 -5
- data/examples/v201506/basic_operations/add_keywords.rb +1 -5
- data/examples/v201506/basic_operations/add_text_ads.rb +1 -5
- data/examples/v201506/basic_operations/get_ad_groups.rb +1 -5
- data/examples/v201506/basic_operations/get_campaigns.rb +1 -5
- data/examples/v201506/basic_operations/get_campaigns_with_awql.rb +1 -5
- data/examples/v201506/basic_operations/get_keywords.rb +1 -5
- data/examples/v201506/basic_operations/get_text_ads.rb +1 -5
- data/examples/v201506/basic_operations/pause_ad.rb +1 -5
- data/examples/v201506/basic_operations/remove_ad.rb +1 -5
- data/examples/v201506/basic_operations/remove_ad_group.rb +1 -5
- data/examples/v201506/basic_operations/remove_campaign.rb +1 -5
- data/examples/v201506/basic_operations/remove_keyword.rb +1 -5
- data/examples/v201506/basic_operations/update_ad_group.rb +1 -5
- data/examples/v201506/basic_operations/update_campaign.rb +1 -5
- data/examples/v201506/basic_operations/update_keyword.rb +1 -5
- data/examples/v201506/campaign_management/add_campaign_labels.rb +1 -5
- data/examples/v201506/campaign_management/add_experiment.rb +1 -5
- data/examples/v201506/campaign_management/add_keywords_in_bulk.rb +1 -6
- data/examples/v201506/campaign_management/get_all_disapproved_ads.rb +1 -5
- data/examples/v201506/campaign_management/get_all_disapproved_ads_with_awql.rb +1 -5
- data/examples/v201506/campaign_management/get_campaigns_by_label.rb +1 -5
- data/examples/v201506/campaign_management/promote_experiment.rb +1 -5
- data/examples/v201506/campaign_management/set_ad_parameters.rb +1 -5
- data/examples/v201506/campaign_management/set_criterion_bid_modifier.rb +1 -5
- data/examples/v201506/campaign_management/validate_text_ad.rb +1 -5
- data/examples/v201506/error_handling/handle_partial_failures.rb +1 -5
- data/examples/v201506/error_handling/handle_policy_violation_error.rb +1 -5
- data/examples/v201506/extensions/add_google_my_business_location_extensions.rb +1 -5
- data/examples/v201506/extensions/add_site_links.rb +1 -5
- data/examples/v201506/extensions/add_site_links_using_feeds.rb +1 -6
- data/examples/v201506/migration/migrate_to_extension_settings.rb +1 -7
- data/examples/v201506/migration/upgrade_ad_url.rb +1 -5
- data/examples/v201506/misc/get_all_images_and_videos.rb +1 -5
- data/examples/v201506/misc/setup_oauth2.rb +0 -4
- data/examples/v201506/misc/upload_image.rb +1 -5
- data/examples/v201506/misc/use_oauth2_jwt.rb +0 -4
- data/examples/v201506/misc/use_runtime_config.rb +1 -3
- data/examples/v201506/optimization/estimate_keyword_traffic.rb +1 -5
- data/examples/v201506/optimization/get_keyword_bid_simulations.rb +1 -5
- data/examples/v201506/optimization/get_keyword_ideas.rb +1 -5
- data/examples/v201506/remarketing/add_audience.rb +1 -5
- data/examples/v201506/remarketing/add_conversion_tracker.rb +1 -5
- data/examples/v201506/remarketing/add_rule_based_user_lists.rb +1 -5
- data/examples/v201506/reporting/download_criteria_report.rb +1 -3
- data/examples/v201506/reporting/download_criteria_report_with_awql.rb +1 -3
- data/examples/v201506/reporting/get_report_fields.rb +1 -5
- data/examples/v201506/reporting/parallel_report_download.rb +1 -3
- data/examples/v201506/shopping_campaigns/add_product_partition_tree.rb +1 -3
- data/examples/v201506/shopping_campaigns/add_product_scope.rb +1 -5
- data/examples/v201506/shopping_campaigns/add_shopping_campaign.rb +1 -5
- data/examples/v201506/shopping_campaigns/get_product_category_taxonomy.rb +7 -9
- data/examples/v201506/targeting/add_campaign_targeting_criteria.rb +1 -5
- data/examples/v201506/targeting/add_demographic_targeting_criteria.rb +1 -5
- data/examples/v201506/targeting/get_campaign_targeting_criteria.rb +1 -5
- data/examples/v201506/targeting/get_targetable_languages_and_carriers.rb +1 -6
- data/examples/v201506/targeting/lookup_location.rb +1 -5
- data/lib/adwords_api.rb +0 -3
- data/lib/adwords_api/api_config.rb +0 -2
- data/lib/adwords_api/credential_handler.rb +0 -2
- data/lib/adwords_api/errors.rb +1 -2
- data/lib/adwords_api/report_header_handler.rb +0 -2
- data/lib/adwords_api/report_utils.rb +0 -2
- data/lib/adwords_api/utils.rb +0 -2
- data/lib/adwords_api/version.rb +1 -3
- data/test/adwords_api/test_adwords_api.rb +0 -2
- data/test/adwords_api/test_api_config.rb +0 -2
- data/test/adwords_api/test_choices.rb +0 -2
- data/test/adwords_api/test_credential_handler.rb +0 -2
- data/test/adwords_api/test_report_utils.rb +31 -23
- data/test/adwords_api/test_utils.rb +0 -2
- data/test/coverage.rb +0 -2
- data/test/suite_integration.rb +0 -2
- data/test/suite_unittests.rb +0 -2
- data/test/test_utils.rb +0 -2
- metadata +34 -8
data/lib/adwords_api/errors.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# Encoding: utf-8
|
2
2
|
#
|
3
|
-
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
|
-
#
|
5
3
|
# Copyright:: Copyright 2010, Google Inc. All Rights Reserved.
|
6
4
|
#
|
7
5
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -37,6 +35,7 @@ module AdwordsApi
|
|
37
35
|
exception_data = (exception_type.nil?) ? exception_fault :
|
38
36
|
extractor.extract_exception_data(exception_fault, exception_type)
|
39
37
|
exception_data.each { |key, value| set_field(key, value) }
|
38
|
+
super(exception_data[:message])
|
40
39
|
end
|
41
40
|
|
42
41
|
private
|
data/lib/adwords_api/utils.rb
CHANGED
data/lib/adwords_api/version.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# Encoding: utf-8
|
2
2
|
#
|
3
|
-
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
|
-
#
|
5
3
|
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
4
|
#
|
7
5
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -21,6 +19,6 @@
|
|
21
19
|
|
22
20
|
module AdwordsApi
|
23
21
|
module ApiConfig
|
24
|
-
CLIENT_LIB_VERSION = '0.16.
|
22
|
+
CLIENT_LIB_VERSION = '0.16.1'
|
25
23
|
end
|
26
24
|
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# Encoding: utf-8
|
3
3
|
#
|
4
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
5
|
-
#
|
6
4
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
7
5
|
#
|
8
6
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -78,28 +76,24 @@ class TestReportUtils < Test::Unit::TestCase
|
|
78
76
|
|
79
77
|
# Testing HTTP code 400.
|
80
78
|
def test_check_for_errors_400()
|
81
|
-
|
79
|
+
e = assert_raise(AdwordsApi::Errors::ReportXmlError) do
|
82
80
|
response = ResponseStub.new(400, XML_REPLY[:reply])
|
83
81
|
@report_utils.check_for_errors(response)
|
84
|
-
assert(false, 'No exception thrown for code 400')
|
85
|
-
rescue AdwordsApi::Errors::ReportXmlError => e
|
86
|
-
assert_equal(400, e.http_code)
|
87
|
-
assert_equal(XML_REPLY[:type], e.type)
|
88
|
-
assert_equal(XML_REPLY[:trigger], e.trigger)
|
89
|
-
assert_equal(XML_REPLY[:field_path], e.field_path)
|
90
|
-
assert_not_nil(e.message)
|
91
82
|
end
|
83
|
+
assert_equal(400, e.http_code)
|
84
|
+
assert_equal(XML_REPLY[:type], e.type)
|
85
|
+
assert_equal(XML_REPLY[:trigger], e.trigger)
|
86
|
+
assert_equal(XML_REPLY[:field_path], e.field_path)
|
87
|
+
assert_not_nil(e.message)
|
92
88
|
end
|
93
89
|
|
94
90
|
# Testing HTTP code 500.
|
95
91
|
def test_check_for_errors_500()
|
96
|
-
|
92
|
+
e = assert_raise(AdwordsApi::Errors::ReportError) do
|
97
93
|
response = ResponseStub.new(500, nil)
|
98
94
|
@report_utils.check_for_errors(response)
|
99
|
-
assert(false, 'No exception thrown for code 500')
|
100
|
-
rescue AdwordsApi::Errors::ReportError => e
|
101
|
-
assert_equal(500, e.http_code)
|
102
95
|
end
|
96
|
+
assert_equal(500, e.http_code)
|
103
97
|
end
|
104
98
|
|
105
99
|
# Testing HTTP code 200 with success.
|
@@ -186,16 +180,30 @@ class TestReportUtils < Test::Unit::TestCase
|
|
186
180
|
end
|
187
181
|
|
188
182
|
# Testing check_for_xml_error.
|
189
|
-
def
|
190
|
-
|
183
|
+
def test_check_for_xml_error()
|
184
|
+
e = assert_raise(AdwordsApi::Errors::ReportXmlError) do
|
191
185
|
@report_utils.check_for_xml_error(XML_REPLY[:reply], 42)
|
192
|
-
assert(false, 'No exception thrown for code 42')
|
193
|
-
rescue AdwordsApi::Errors::ReportXmlError => e
|
194
|
-
assert_equal(42, e.http_code)
|
195
|
-
assert_equal(XML_REPLY[:type], e.type)
|
196
|
-
assert_equal(XML_REPLY[:trigger], e.trigger)
|
197
|
-
assert_equal(XML_REPLY[:field_path], e.field_path)
|
198
|
-
assert_not_nil(e.message)
|
199
186
|
end
|
187
|
+
assert_equal(42, e.http_code)
|
188
|
+
assert_equal(XML_REPLY[:type], e.type)
|
189
|
+
assert_equal(XML_REPLY[:trigger], e.trigger)
|
190
|
+
assert_equal(XML_REPLY[:field_path], e.field_path)
|
191
|
+
assert_not_nil(e.message)
|
192
|
+
end
|
193
|
+
|
194
|
+
def test_check_for_xml_error_with_message()
|
195
|
+
http_code = 442
|
196
|
+
e = assert_raise(AdwordsApi::Errors::ReportXmlError) do
|
197
|
+
@report_utils.check_for_xml_error(XML_REPLY[:reply], http_code)
|
198
|
+
end
|
199
|
+
error_str = e.to_s
|
200
|
+
assert(error_str.include?(http_code.to_s),
|
201
|
+
'HTTP code was not passed to the error message')
|
202
|
+
assert(error_str.include?(XML_REPLY[:type]),
|
203
|
+
'Error type was not passed to the error message')
|
204
|
+
assert(error_str.include?(XML_REPLY[:trigger]),
|
205
|
+
'Error trigger was not passed to the error message')
|
206
|
+
assert(error_str.include?(XML_REPLY[:field_path]),
|
207
|
+
'Field path was not passed to the error message')
|
200
208
|
end
|
201
209
|
end
|
data/test/coverage.rb
CHANGED
data/test/suite_integration.rb
CHANGED
data/test/suite_unittests.rb
CHANGED
data/test/test_utils.rb
CHANGED
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.16.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danial Klimkin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-ads-common
|
@@ -17,18 +17,44 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.10.
|
20
|
+
version: 0.10.1
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.10.
|
27
|
+
version: 0.10.1
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rr
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 1.1.2
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 1.1.2
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: webmock
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.21.0
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.21.0
|
28
56
|
description: google-adwords-api is a AdWords API client library for Ruby
|
29
|
-
email:
|
30
|
-
- api.dklimkin@gmail.com
|
31
|
-
- api.mcloonan@gmail.com
|
57
|
+
email:
|
32
58
|
executables: []
|
33
59
|
extensions: []
|
34
60
|
extra_rdoc_files: []
|
@@ -363,7 +389,7 @@ files:
|
|
363
389
|
- test/templates/v201506/basic_operations_get_campaigns.def
|
364
390
|
- test/templates/v201506/misc_use_oauth2_service_account.def
|
365
391
|
- test/test_utils.rb
|
366
|
-
homepage:
|
392
|
+
homepage: https://github.com/googleads/google-api-ads-ruby
|
367
393
|
licenses:
|
368
394
|
- Apache-2.0
|
369
395
|
metadata: {}
|