google-adwords-api 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/ChangeLog +5 -0
- data/README.md +53 -30
- data/examples/v201406/account_management/create_account.rb +92 -0
- data/examples/v201406/account_management/get_account_alerts.rb +122 -0
- data/examples/v201406/account_management/get_account_changes.rb +145 -0
- data/examples/v201406/account_management/get_account_hierarchy.rb +103 -0
- data/examples/v201406/advanced_operations/add_ad_group_bid_modifier.rb +105 -0
- data/examples/v201406/advanced_operations/add_click_to_download_ad.rb +137 -0
- data/examples/v201406/advanced_operations/add_places_location_extensions.rb +159 -0
- data/examples/v201406/advanced_operations/add_site_links.rb +306 -0
- data/examples/v201406/advanced_operations/add_text_ad_with_upgraded_urls.rb +137 -0
- data/examples/v201406/advanced_operations/get_ad_group_bid_modifiers.rb +106 -0
- data/examples/v201406/advanced_operations/update_site_links.rb +194 -0
- data/examples/v201406/advanced_operations/upload_offline_conversions.rb +117 -0
- data/examples/v201406/advanced_operations/use_shared_bidding_strategy.rb +164 -0
- data/examples/v201406/basic_operations/add_ad_groups.rb +142 -0
- data/examples/v201406/basic_operations/add_campaigns.rb +153 -0
- data/examples/v201406/basic_operations/add_keywords.rb +116 -0
- data/examples/v201406/basic_operations/add_text_ads.rb +113 -0
- data/examples/v201406/basic_operations/get_ad_groups.rb +106 -0
- data/examples/v201406/basic_operations/get_campaigns.rb +101 -0
- data/examples/v201406/basic_operations/get_campaigns_with_awql.rb +93 -0
- data/examples/v201406/basic_operations/get_keywords.rb +112 -0
- data/examples/v201406/basic_operations/get_text_ads.rb +114 -0
- data/examples/v201406/basic_operations/pause_ad.rb +92 -0
- data/examples/v201406/basic_operations/remove_ad.rb +93 -0
- data/examples/v201406/basic_operations/remove_ad_group.rb +110 -0
- data/examples/v201406/basic_operations/remove_campaign.rb +111 -0
- data/examples/v201406/basic_operations/remove_keyword.rb +98 -0
- data/examples/v201406/basic_operations/update_ad_group.rb +89 -0
- data/examples/v201406/basic_operations/update_campaign.rb +90 -0
- data/examples/v201406/basic_operations/update_keyword.rb +110 -0
- data/examples/v201406/campaign_management/add_campaign_labels.rb +86 -0
- data/examples/v201406/campaign_management/add_experiment.rb +166 -0
- data/examples/v201406/campaign_management/add_keywords_in_bulk.rb +158 -0
- data/examples/v201406/campaign_management/add_location_extension.rb +125 -0
- data/examples/v201406/campaign_management/get_all_disapproved_ads.rb +101 -0
- data/examples/v201406/campaign_management/get_all_disapproved_ads_with_awql.rb +93 -0
- data/examples/v201406/campaign_management/get_campaigns_by_label.rb +112 -0
- data/examples/v201406/campaign_management/promote_experiment.rb +85 -0
- data/examples/v201406/campaign_management/set_ad_parameters.rb +122 -0
- data/examples/v201406/campaign_management/set_criterion_bid_modifier.rb +108 -0
- data/examples/v201406/campaign_management/validate_text_ad.rb +114 -0
- data/examples/v201406/error_handling/handle_captcha_challenge.rb +93 -0
- data/examples/v201406/error_handling/handle_partial_failures.rb +134 -0
- data/examples/v201406/error_handling/handle_policy_violation_error.rb +145 -0
- data/examples/v201406/error_handling/handle_two_factor_authorization_error.rb +88 -0
- data/examples/v201406/misc/create_ad_words_session_without_properties_file.rb +94 -0
- data/examples/v201406/misc/get_all_images_and_videos.rb +108 -0
- data/examples/v201406/misc/setup_oauth2.rb +88 -0
- data/examples/v201406/misc/upload_image.rb +97 -0
- data/examples/v201406/misc/use_oauth2_jwt.rb +97 -0
- data/examples/v201406/optimization/estimate_keyword_traffic.rb +137 -0
- data/examples/v201406/optimization/get_keyword_bid_simulations.rb +100 -0
- data/examples/v201406/optimization/get_keyword_ideas.rb +130 -0
- data/examples/v201406/optimization/get_placement_ideas.rb +112 -0
- data/examples/v201406/remarketing/add_audience.rb +123 -0
- data/examples/v201406/remarketing/add_conversion_tracker.rb +105 -0
- data/examples/v201406/reporting/download_criteria_report.rb +87 -0
- data/examples/v201406/reporting/download_criteria_report_with_awql.rb +86 -0
- data/examples/v201406/reporting/get_report_fields.rb +79 -0
- data/examples/v201406/reporting/parallel_report_download.rb +171 -0
- data/examples/v201406/shopping_campaigns/add_product_partition_tree.rb +269 -0
- data/examples/v201406/shopping_campaigns/add_product_scope.rb +133 -0
- data/examples/v201406/shopping_campaigns/add_shopping_campaign.rb +135 -0
- data/examples/v201406/shopping_campaigns/get_product_category_taxonomy.rb +117 -0
- data/examples/v201406/shopping_campaigns/set_product_sales_channel.rb +98 -0
- data/examples/v201406/targeting/add_campaign_targeting_criteria.rb +173 -0
- data/examples/v201406/targeting/add_demographic_targeting_criteria.rb +116 -0
- data/examples/v201406/targeting/get_campaign_targeting_criteria.rb +110 -0
- data/examples/v201406/targeting/get_targetable_languages_and_carriers.rb +94 -0
- data/examples/v201406/targeting/lookup_location.rb +112 -0
- data/lib/adwords_api/api_config.rb +91 -5
- data/lib/adwords_api/v201402/campaign_shared_set_service.rb +38 -0
- data/lib/adwords_api/v201402/campaign_shared_set_service_registry.rb +47 -0
- data/lib/adwords_api/v201402/shared_criterion_service.rb +38 -0
- data/lib/adwords_api/v201402/shared_criterion_service_registry.rb +47 -0
- data/lib/adwords_api/v201402/shared_set_service.rb +38 -0
- data/lib/adwords_api/v201402/shared_set_service_registry.rb +47 -0
- data/lib/adwords_api/v201406/ad_group_ad_service.rb +46 -0
- data/lib/adwords_api/v201406/ad_group_ad_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/ad_group_bid_modifier_service.rb +42 -0
- data/lib/adwords_api/v201406/ad_group_bid_modifier_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/ad_group_criterion_service.rb +46 -0
- data/lib/adwords_api/v201406/ad_group_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/ad_group_feed_service.rb +42 -0
- data/lib/adwords_api/v201406/ad_group_feed_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/ad_group_service.rb +46 -0
- data/lib/adwords_api/v201406/ad_group_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/ad_param_service.rb +38 -0
- data/lib/adwords_api/v201406/ad_param_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/adwords_user_list_service.rb +38 -0
- data/lib/adwords_api/v201406/adwords_user_list_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/alert_service.rb +34 -0
- data/lib/adwords_api/v201406/alert_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/bidding_strategy_service.rb +42 -0
- data/lib/adwords_api/v201406/bidding_strategy_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/budget_order_service.rb +42 -0
- data/lib/adwords_api/v201406/budget_order_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/budget_service.rb +42 -0
- data/lib/adwords_api/v201406/budget_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/campaign_ad_extension_service.rb +38 -0
- data/lib/adwords_api/v201406/campaign_ad_extension_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/campaign_criterion_service.rb +42 -0
- data/lib/adwords_api/v201406/campaign_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/campaign_feed_service.rb +42 -0
- data/lib/adwords_api/v201406/campaign_feed_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/campaign_service.rb +46 -0
- data/lib/adwords_api/v201406/campaign_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/campaign_shared_set_service.rb +38 -0
- data/lib/adwords_api/v201406/campaign_shared_set_service_registry.rb +47 -0
- data/lib/adwords_api/v201406/constant_data_service.rb +66 -0
- data/lib/adwords_api/v201406/constant_data_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/conversion_tracker_service.rb +38 -0
- data/lib/adwords_api/v201406/conversion_tracker_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/customer_feed_service.rb +42 -0
- data/lib/adwords_api/v201406/customer_feed_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/customer_service.rb +38 -0
- data/lib/adwords_api/v201406/customer_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/customer_sync_service.rb +34 -0
- data/lib/adwords_api/v201406/customer_sync_service_registry.rb +47 -0
- data/lib/adwords_api/v201406/data_service.rb +54 -0
- data/lib/adwords_api/v201406/data_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/experiment_service.rb +38 -0
- data/lib/adwords_api/v201406/experiment_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/feed_item_service.rb +42 -0
- data/lib/adwords_api/v201406/feed_item_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/feed_mapping_service.rb +42 -0
- data/lib/adwords_api/v201406/feed_mapping_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/feed_service.rb +42 -0
- data/lib/adwords_api/v201406/feed_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/geo_location_service.rb +34 -0
- data/lib/adwords_api/v201406/geo_location_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/label_service.rb +42 -0
- data/lib/adwords_api/v201406/label_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/location_criterion_service.rb +38 -0
- data/lib/adwords_api/v201406/location_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/managed_customer_service.rb +50 -0
- data/lib/adwords_api/v201406/managed_customer_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/media_service.rb +42 -0
- data/lib/adwords_api/v201406/media_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/mutate_job_service.rb +42 -0
- data/lib/adwords_api/v201406/mutate_job_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/offline_conversion_feed_service.rb +34 -0
- data/lib/adwords_api/v201406/offline_conversion_feed_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/report_definition_service.rb +34 -0
- data/lib/adwords_api/v201406/report_definition_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/shared_criterion_service.rb +38 -0
- data/lib/adwords_api/v201406/shared_criterion_service_registry.rb +47 -0
- data/lib/adwords_api/v201406/shared_set_service.rb +38 -0
- data/lib/adwords_api/v201406/shared_set_service_registry.rb +47 -0
- data/lib/adwords_api/v201406/targeting_idea_service.rb +38 -0
- data/lib/adwords_api/v201406/targeting_idea_service_registry.rb +46 -0
- data/lib/adwords_api/v201406/traffic_estimator_service.rb +34 -0
- data/lib/adwords_api/v201406/traffic_estimator_service_registry.rb +46 -0
- data/lib/adwords_api/version.rb +1 -1
- data/lib/adwords_api.rb +1 -1
- data/test/adwords_api/test_adwords_api.rb +7 -3
- metadata +423 -274
- data/test/bugs/test_issue_00000063.rb +0 -141
@@ -1,141 +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 issue #63.
|
22
|
-
|
23
|
-
require 'nori'
|
24
|
-
require 'savon'
|
25
|
-
require 'test/unit'
|
26
|
-
|
27
|
-
require 'ads_common/results_extractor'
|
28
|
-
require 'adwords_api'
|
29
|
-
require 'adwords_api/v201309/mutate_job_service_registry'
|
30
|
-
|
31
|
-
class TestIssue63 < Test::Unit::TestCase
|
32
|
-
def setup()
|
33
|
-
@registry =
|
34
|
-
AdwordsApi::V201309::MutateJobService::MutateJobServiceRegistry
|
35
|
-
end
|
36
|
-
|
37
|
-
def run_test(xml_text)
|
38
|
-
data = Nori.parse(xml_text)[:envelope][:body]
|
39
|
-
extractor = AdsCommon::ResultsExtractor.new(@registry)
|
40
|
-
return extractor.extract_result(data, :get_result)
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_issue_63_single_mutate_error()
|
44
|
-
result = run_test(single_error_xml)
|
45
|
-
errors = result[:simple_mutate_result][:errors]
|
46
|
-
assert_kind_of(Array, errors)
|
47
|
-
assert_equal(1, errors.size)
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_issue_63_multiple_mutate_errors()
|
51
|
-
result = run_test(multiple_errors_xml)
|
52
|
-
errors = result[:simple_mutate_result][:errors]
|
53
|
-
assert_kind_of(Array, errors)
|
54
|
-
assert_equal(2, errors.size)
|
55
|
-
end
|
56
|
-
|
57
|
-
def single_error_xml()
|
58
|
-
return <<EOT
|
59
|
-
<?xml version="1.0"?>
|
60
|
-
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
61
|
-
<soap:Header>
|
62
|
-
<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201309">
|
63
|
-
<requestId>123</requestId>
|
64
|
-
<serviceName>MutateJobService</serviceName>
|
65
|
-
<methodName>getResult</methodName>
|
66
|
-
<operations>1</operations>
|
67
|
-
<responseTime>180</responseTime>
|
68
|
-
<units>1</units>
|
69
|
-
</ResponseHeader>
|
70
|
-
</soap:Header>
|
71
|
-
<soap:Body>
|
72
|
-
<getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/v201309">
|
73
|
-
<rval>
|
74
|
-
<SimpleMutateResult>
|
75
|
-
<results>
|
76
|
-
<PlaceHolder/>
|
77
|
-
</results>
|
78
|
-
<results>
|
79
|
-
<PlaceHolder/>
|
80
|
-
</results>
|
81
|
-
<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="EntityNotFound">
|
82
|
-
<fieldPath>operations[0].operand.adGroupId</fieldPath>
|
83
|
-
<trigger>AdGroupId: 0</trigger>
|
84
|
-
<errorString>EntityNotFound.INVALID_ID</errorString>
|
85
|
-
<ApiError.Type>EntityNotFound</ApiError.Type>
|
86
|
-
<reason>INVALID_ID</reason>
|
87
|
-
</errors>
|
88
|
-
</SimpleMutateResult>
|
89
|
-
</rval>
|
90
|
-
</getResultResponse>
|
91
|
-
</soap:Body>
|
92
|
-
</soap:Envelope>
|
93
|
-
EOT
|
94
|
-
end
|
95
|
-
|
96
|
-
def multiple_errors_xml
|
97
|
-
return <<EOT
|
98
|
-
<?xml version="1.0"?>
|
99
|
-
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
100
|
-
<soap:Header>
|
101
|
-
<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201309">
|
102
|
-
<requestId>123</requestId>
|
103
|
-
<serviceName>MutateJobService</serviceName>
|
104
|
-
<methodName>getResult</methodName>
|
105
|
-
<operations>1</operations>
|
106
|
-
<responseTime>180</responseTime>
|
107
|
-
<units>1</units>
|
108
|
-
</ResponseHeader>
|
109
|
-
</soap:Header>
|
110
|
-
<soap:Body>
|
111
|
-
<getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/v201309">
|
112
|
-
<rval>
|
113
|
-
<SimpleMutateResult>
|
114
|
-
<results>
|
115
|
-
<PlaceHolder/>
|
116
|
-
</results>
|
117
|
-
<results>
|
118
|
-
<PlaceHolder/>
|
119
|
-
</results>
|
120
|
-
<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="EntityNotFound">
|
121
|
-
<fieldPath>operations[0].operand.adGroupId</fieldPath>
|
122
|
-
<trigger>AdGroupId: 0</trigger>
|
123
|
-
<errorString>EntityNotFound.INVALID_ID</errorString>
|
124
|
-
<ApiError.Type>EntityNotFound</ApiError.Type>
|
125
|
-
<reason>INVALID_ID</reason>
|
126
|
-
</errors>
|
127
|
-
<errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="EntityNotFound">
|
128
|
-
<fieldPath>operations[1].operand.adGroupId</fieldPath>
|
129
|
-
<trigger>AdGroupId: 0</trigger>
|
130
|
-
<errorString>EntityNotFound.INVALID_ID</errorString>
|
131
|
-
<ApiError.Type>EntityNotFound</ApiError.Type>
|
132
|
-
<reason>INVALID_ID</reason>
|
133
|
-
</errors>
|
134
|
-
</SimpleMutateResult>
|
135
|
-
</rval>
|
136
|
-
</getResultResponse>
|
137
|
-
</soap:Body>
|
138
|
-
</soap:Envelope>
|
139
|
-
EOT
|
140
|
-
end
|
141
|
-
end
|