google-adwords-api 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -0
- data/README +4 -7
- data/examples/v201206/account_management/create_account.rb +84 -0
- data/examples/v201206/account_management/get_account_alerts.rb +111 -0
- data/examples/v201206/account_management/get_account_changes.rb +137 -0
- data/examples/v201206/account_management/get_account_hierarchy.rb +92 -0
- data/examples/v201206/account_management/get_client_customer_id.rb +85 -0
- data/examples/v201206/account_management/get_client_unit_usage.rb +87 -0
- data/examples/v201206/basic_operations/add_ad_groups.rb +136 -0
- data/examples/v201206/basic_operations/add_campaigns.rb +146 -0
- data/examples/v201206/basic_operations/add_keywords.rb +108 -0
- data/examples/v201206/basic_operations/add_text_ads.rb +105 -0
- data/examples/v201206/basic_operations/delete_ad.rb +85 -0
- data/examples/v201206/basic_operations/delete_ad_group.rb +102 -0
- data/examples/v201206/basic_operations/delete_campaign.rb +103 -0
- data/examples/v201206/basic_operations/delete_keyword.rb +90 -0
- data/examples/v201206/basic_operations/get_ad_groups.rb +98 -0
- data/examples/v201206/basic_operations/get_campaigns.rb +93 -0
- data/examples/v201206/basic_operations/get_campaigns_with_awql.rb +85 -0
- data/examples/v201206/basic_operations/get_keywords.rb +104 -0
- data/examples/v201206/basic_operations/get_text_ads.rb +106 -0
- data/examples/v201206/basic_operations/pause_ad.rb +84 -0
- data/examples/v201206/basic_operations/update_ad_group.rb +81 -0
- data/examples/v201206/basic_operations/update_campaign.rb +84 -0
- data/examples/v201206/basic_operations/update_keyword.rb +99 -0
- data/examples/v201206/campaign_management/add_experiment.rb +158 -0
- data/examples/v201206/campaign_management/add_keywords_in_bulk.rb +150 -0
- data/examples/v201206/campaign_management/add_location_extension.rb +117 -0
- data/examples/v201206/campaign_management/add_location_extension_override.rb +83 -0
- data/examples/v201206/campaign_management/get_all_disapproved_ads.rb +93 -0
- data/examples/v201206/campaign_management/get_all_disapproved_ads_with_awql.rb +84 -0
- data/examples/v201206/campaign_management/promote_experiment.rb +77 -0
- data/examples/v201206/campaign_management/set_ad_parameters.rb +114 -0
- data/examples/v201206/campaign_management/validate_text_ad.rb +106 -0
- data/examples/v201206/error_handling/handle_captcha_challenge.rb +93 -0
- data/examples/v201206/error_handling/handle_partial_failures.rb +126 -0
- data/examples/v201206/error_handling/handle_policy_violation_error.rb +137 -0
- data/examples/v201206/error_handling/handle_two_factor_authorization_error.rb +87 -0
- data/examples/v201206/misc/get_all_images_and_videos.rb +101 -0
- data/examples/v201206/misc/upload_image.rb +90 -0
- data/examples/v201206/misc/use_oauth.rb +100 -0
- data/examples/v201206/misc/use_oauth2.rb +97 -0
- data/examples/v201206/optimization/estimate_keyword_traffic.rb +129 -0
- data/examples/v201206/optimization/get_keyword_bid_simulations.rb +92 -0
- data/examples/v201206/optimization/get_keyword_ideas.rb +115 -0
- data/examples/v201206/optimization/get_placement_ideas.rb +106 -0
- data/examples/v201206/remarketing/add_audience.rb +115 -0
- data/examples/v201206/remarketing/add_conversion_tracker.rb +97 -0
- data/examples/v201206/reporting/download_criteria_report.rb +79 -0
- data/examples/v201206/reporting/download_criteria_report_with_awql.rb +78 -0
- data/examples/v201206/reporting/get_campaign_stats.rb +105 -0
- data/examples/v201206/reporting/get_defined_reports.rb +75 -0
- data/examples/v201206/reporting/get_report_fields.rb +71 -0
- data/examples/v201206/reporting/parallel_report_download.rb +159 -0
- data/examples/v201206/targeting/add_campaign_targeting_criteria.rb +118 -0
- data/examples/v201206/targeting/get_campaign_targeting_criteria.rb +102 -0
- data/examples/v201206/targeting/get_targetable_languages_and_carriers.rb +86 -0
- data/examples/v201206/targeting/lookup_location.rb +104 -0
- data/lib/adwords_api/api_config.rb +69 -5
- data/lib/adwords_api/report_utils.rb +50 -1
- data/lib/adwords_api/v201109/ad_extension_override_service.rb +1 -1
- data/lib/adwords_api/v201109/ad_extension_override_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/ad_group_ad_service.rb +1 -1
- data/lib/adwords_api/v201109/ad_group_ad_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/ad_group_criterion_service.rb +1 -1
- data/lib/adwords_api/v201109/ad_group_criterion_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/ad_group_service.rb +1 -1
- data/lib/adwords_api/v201109/ad_group_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/ad_param_service.rb +1 -1
- data/lib/adwords_api/v201109/ad_param_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/alert_service.rb +1 -1
- data/lib/adwords_api/v201109/alert_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/budget_order_service.rb +1 -1
- data/lib/adwords_api/v201109/budget_order_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/bulk_mutate_job_service.rb +1 -1
- data/lib/adwords_api/v201109/bulk_mutate_job_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/campaign_ad_extension_service.rb +1 -1
- data/lib/adwords_api/v201109/campaign_ad_extension_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/campaign_criterion_service.rb +1 -1
- data/lib/adwords_api/v201109/campaign_criterion_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/campaign_service.rb +1 -1
- data/lib/adwords_api/v201109/campaign_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/campaign_target_service.rb +1 -1
- data/lib/adwords_api/v201109/campaign_target_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/constant_data_service.rb +1 -1
- data/lib/adwords_api/v201109/constant_data_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/conversion_tracker_service.rb +1 -1
- data/lib/adwords_api/v201109/conversion_tracker_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/create_account_service.rb +1 -1
- data/lib/adwords_api/v201109/create_account_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/customer_sync_service.rb +1 -1
- data/lib/adwords_api/v201109/customer_sync_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/data_service.rb +1 -1
- data/lib/adwords_api/v201109/data_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/experiment_service.rb +1 -1
- data/lib/adwords_api/v201109/experiment_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/geo_location_service.rb +1 -1
- data/lib/adwords_api/v201109/geo_location_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/info_service.rb +1 -1
- data/lib/adwords_api/v201109/info_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/location_criterion_service.rb +1 -1
- data/lib/adwords_api/v201109/location_criterion_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/media_service.rb +1 -1
- data/lib/adwords_api/v201109/media_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/mutate_job_service.rb +1 -1
- data/lib/adwords_api/v201109/mutate_job_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/report_definition_service.rb +1 -1
- data/lib/adwords_api/v201109/report_definition_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/serviced_account_service.rb +1 -1
- data/lib/adwords_api/v201109/serviced_account_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/targeting_idea_service.rb +1 -1
- data/lib/adwords_api/v201109/targeting_idea_service_registry.rb +2 -2
- data/lib/adwords_api/v201109/traffic_estimator_service.rb +1 -1
- data/lib/adwords_api/v201109/traffic_estimator_service_registry.rb +1 -1
- data/lib/adwords_api/v201109/user_list_service.rb +1 -1
- data/lib/adwords_api/v201109/user_list_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_extension_override_service.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_extension_override_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_group_ad_service.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_group_ad_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_group_criterion_service.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_group_criterion_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_group_service.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_group_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_param_service.rb +1 -1
- data/lib/adwords_api/v201109_1/ad_param_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/alert_service.rb +1 -1
- data/lib/adwords_api/v201109_1/alert_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/budget_order_service.rb +1 -1
- data/lib/adwords_api/v201109_1/budget_order_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/bulk_mutate_job_service.rb +1 -1
- data/lib/adwords_api/v201109_1/bulk_mutate_job_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/campaign_ad_extension_service.rb +1 -1
- data/lib/adwords_api/v201109_1/campaign_ad_extension_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/campaign_criterion_service.rb +1 -1
- data/lib/adwords_api/v201109_1/campaign_criterion_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/campaign_service.rb +1 -1
- data/lib/adwords_api/v201109_1/campaign_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/campaign_target_service.rb +1 -1
- data/lib/adwords_api/v201109_1/campaign_target_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/constant_data_service.rb +1 -1
- data/lib/adwords_api/v201109_1/constant_data_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/conversion_tracker_service.rb +1 -1
- data/lib/adwords_api/v201109_1/conversion_tracker_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/create_account_service.rb +1 -1
- data/lib/adwords_api/v201109_1/create_account_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/customer_service.rb +34 -0
- data/lib/adwords_api/v201109_1/customer_service_registry.rb +46 -0
- data/lib/adwords_api/v201109_1/customer_sync_service.rb +1 -1
- data/lib/adwords_api/v201109_1/customer_sync_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/data_service.rb +1 -1
- data/lib/adwords_api/v201109_1/data_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/experiment_service.rb +1 -1
- data/lib/adwords_api/v201109_1/experiment_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/geo_location_service.rb +1 -1
- data/lib/adwords_api/v201109_1/geo_location_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/info_service.rb +1 -1
- data/lib/adwords_api/v201109_1/info_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/location_criterion_service.rb +1 -1
- data/lib/adwords_api/v201109_1/location_criterion_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/managed_customer_service.rb +38 -0
- data/lib/adwords_api/v201109_1/managed_customer_service_registry.rb +46 -0
- data/lib/adwords_api/v201109_1/media_service.rb +1 -1
- data/lib/adwords_api/v201109_1/media_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/mutate_job_service.rb +1 -1
- data/lib/adwords_api/v201109_1/mutate_job_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/report_definition_service.rb +1 -1
- data/lib/adwords_api/v201109_1/report_definition_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/serviced_account_service.rb +1 -1
- data/lib/adwords_api/v201109_1/serviced_account_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/targeting_idea_service.rb +1 -1
- data/lib/adwords_api/v201109_1/targeting_idea_service_registry.rb +2 -2
- data/lib/adwords_api/v201109_1/traffic_estimator_service.rb +1 -1
- data/lib/adwords_api/v201109_1/traffic_estimator_service_registry.rb +1 -1
- data/lib/adwords_api/v201109_1/user_list_service.rb +1 -1
- data/lib/adwords_api/v201109_1/user_list_service_registry.rb +1 -1
- data/lib/adwords_api/v201206/ad_extension_override_service.rb +38 -0
- data/lib/adwords_api/v201206/ad_extension_override_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/ad_group_ad_service.rb +42 -0
- data/lib/adwords_api/v201206/ad_group_ad_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/ad_group_criterion_service.rb +42 -0
- data/lib/adwords_api/v201206/ad_group_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/ad_group_service.rb +42 -0
- data/lib/adwords_api/v201206/ad_group_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/ad_param_service.rb +38 -0
- data/lib/adwords_api/v201206/ad_param_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/alert_service.rb +34 -0
- data/lib/adwords_api/v201206/alert_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/budget_order_service.rb +42 -0
- data/lib/adwords_api/v201206/budget_order_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/bulk_mutate_job_service.rb +38 -0
- data/lib/adwords_api/v201206/bulk_mutate_job_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/campaign_ad_extension_service.rb +38 -0
- data/lib/adwords_api/v201206/campaign_ad_extension_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/campaign_criterion_service.rb +42 -0
- data/lib/adwords_api/v201206/campaign_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/campaign_service.rb +42 -0
- data/lib/adwords_api/v201206/campaign_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/constant_data_service.rb +62 -0
- data/lib/adwords_api/v201206/constant_data_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/conversion_tracker_service.rb +38 -0
- data/lib/adwords_api/v201206/conversion_tracker_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/customer_service.rb +34 -0
- data/lib/adwords_api/v201206/customer_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/customer_sync_service.rb +34 -0
- data/lib/adwords_api/v201206/customer_sync_service_registry.rb +47 -0
- data/lib/adwords_api/v201206/data_service.rb +38 -0
- data/lib/adwords_api/v201206/data_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/experiment_service.rb +38 -0
- data/lib/adwords_api/v201206/experiment_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/geo_location_service.rb +34 -0
- data/lib/adwords_api/v201206/geo_location_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/info_service.rb +34 -0
- data/lib/adwords_api/v201206/info_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/location_criterion_service.rb +34 -0
- data/lib/adwords_api/v201206/location_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/managed_customer_service.rb +38 -0
- data/lib/adwords_api/v201206/managed_customer_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/media_service.rb +38 -0
- data/lib/adwords_api/v201206/media_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/mutate_job_service.rb +42 -0
- data/lib/adwords_api/v201206/mutate_job_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/report_definition_service.rb +34 -0
- data/lib/adwords_api/v201206/report_definition_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/targeting_idea_service.rb +38 -0
- data/lib/adwords_api/v201206/targeting_idea_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/traffic_estimator_service.rb +34 -0
- data/lib/adwords_api/v201206/traffic_estimator_service_registry.rb +46 -0
- data/lib/adwords_api/v201206/user_list_service.rb +38 -0
- data/lib/adwords_api/v201206/user_list_service_registry.rb +46 -0
- data/lib/adwords_api/version.rb +1 -1
- data/test/adwords_api/test_api_config.rb +10 -10
- data/test/adwords_api/test_report_utils.rb +1 -1
- data/test/bugs/test_issue_00000031.rb +14 -14
- data/test/bugs/test_issue_00000063.rb +6 -6
- data/test/examples/v201206/test_account_management.rb +60 -0
- data/test/examples/v201206/test_basic_operations.rb +177 -0
- data/test/examples/v201206/test_campaign_management.rb +124 -0
- data/test/examples/v201206/test_error_handling.rb +63 -0
- data/test/examples/v201206/test_misc.rb +45 -0
- data/test/examples/v201206/test_optimization.rb +63 -0
- data/test/examples/v201206/test_remarketing.rb +39 -0
- data/test/examples/v201206/test_reporting.rb +89 -0
- data/test/examples/v201206/test_targeting.rb +60 -0
- data/test/examples/v201206/utils.rb +239 -0
- data/test/suite_exampletests_v201206.rb +37 -0
- metadata +155 -50
data/lib/adwords_api/version.rb
CHANGED
@@ -32,35 +32,35 @@ class TestApiConfig < Test::Unit::TestCase
|
|
32
32
|
|
33
33
|
# Tests correct require path.
|
34
34
|
def test_do_require()
|
35
|
-
name1 = @config.do_require(:
|
36
|
-
assert_equal('adwords_api/
|
35
|
+
name1 = @config.do_require(:v201206, :InfoService)
|
36
|
+
assert_equal('adwords_api/v201206/info_service', name1)
|
37
37
|
end
|
38
38
|
|
39
39
|
# Tests correct module name.
|
40
40
|
def test_module_name()
|
41
|
-
name1 = @config.module_name(:
|
42
|
-
assert_equal('AdwordsApi::
|
41
|
+
name1 = @config.module_name(:v201206, :InfoService)
|
42
|
+
assert_equal('AdwordsApi::V201206::InfoService', name1)
|
43
43
|
end
|
44
44
|
|
45
45
|
# Tests correct interface name.
|
46
46
|
def test_interface_name()
|
47
|
-
name1 = @config.interface_name(:
|
48
|
-
assert_equal('AdwordsApi::
|
47
|
+
name1 = @config.interface_name(:v201206, :InfoService)
|
48
|
+
assert_equal('AdwordsApi::V201206::InfoService::InfoService', name1)
|
49
49
|
end
|
50
50
|
|
51
51
|
# Tests AdHoc report URL generator (prod).
|
52
52
|
def test_adhoc_report_download_url_prod()
|
53
|
-
url = AdwordsApi::ApiConfig.adhoc_report_download_url(:PRODUCTION, :
|
53
|
+
url = AdwordsApi::ApiConfig.adhoc_report_download_url(:PRODUCTION, :v201206)
|
54
54
|
expected_url =
|
55
|
-
'https://adwords.google.com/api/adwords/reportdownload/
|
55
|
+
'https://adwords.google.com/api/adwords/reportdownload/v201206'
|
56
56
|
assert_equal(expected_url, url)
|
57
57
|
end
|
58
58
|
|
59
59
|
# Tests AdHoc report URL generator (sandbox).
|
60
60
|
def test_adhoc_report_download_url_sandbox()
|
61
|
-
url = AdwordsApi::ApiConfig.adhoc_report_download_url(:SANDBOX, :
|
61
|
+
url = AdwordsApi::ApiConfig.adhoc_report_download_url(:SANDBOX, :v201206)
|
62
62
|
expected_url =
|
63
|
-
'https://adwords-sandbox.google.com/api/adwords/reportdownload/
|
63
|
+
'https://adwords-sandbox.google.com/api/adwords/reportdownload/v201206'
|
64
64
|
assert_equal(expected_url, url)
|
65
65
|
end
|
66
66
|
end
|
@@ -25,12 +25,12 @@ require 'test/unit'
|
|
25
25
|
|
26
26
|
require 'ads_common/parameters_validator'
|
27
27
|
require 'adwords_api'
|
28
|
-
require 'adwords_api/
|
28
|
+
require 'adwords_api/v201206/targeting_idea_service_registry'
|
29
29
|
|
30
30
|
class TestIssue31 < Test::Unit::TestCase
|
31
31
|
def setup()
|
32
32
|
@registry =
|
33
|
-
AdwordsApi::
|
33
|
+
AdwordsApi::V201206::TargetingIdeaService::TargetingIdeaServiceRegistry
|
34
34
|
end
|
35
35
|
|
36
36
|
def run_test(selector)
|
@@ -42,34 +42,34 @@ class TestIssue31 < Test::Unit::TestCase
|
|
42
42
|
def test_issue_31_single_xsi_type()
|
43
43
|
selector = {
|
44
44
|
:search_parameters => [
|
45
|
-
{:xsi_type => '
|
46
|
-
:
|
45
|
+
{:xsi_type => 'RelatedToQuerySearchParameter',
|
46
|
+
:queries => ['test']}
|
47
47
|
]
|
48
48
|
}
|
49
49
|
result_xml = run_test(selector)
|
50
|
-
r = /searchParameters xsi:type="
|
50
|
+
r = /searchParameters xsi:type="RelatedToQuerySearchParameter"/ =~
|
51
51
|
result_xml
|
52
52
|
assert_not_nil(r, 'Unable to find item with xsi_type ' +
|
53
|
-
'
|
53
|
+
'RelatedToQuerySearchParameter')
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_issue_31_multiple_xsi_types()
|
57
57
|
selector = {
|
58
58
|
:search_parameters => [
|
59
|
-
{:xsi_type => '
|
60
|
-
:
|
61
|
-
{:xsi_type => '
|
62
|
-
:
|
59
|
+
{:xsi_type => 'CategoryProductsAndServicesSearchParameter',
|
60
|
+
:category_id => 42},
|
61
|
+
{:xsi_type => 'RelatedToQuerySearchParameter',
|
62
|
+
:queries => ['test']}
|
63
63
|
]
|
64
64
|
}
|
65
65
|
result_xml = run_test(selector)
|
66
|
-
r1 = /searchParameters xsi:type="
|
66
|
+
r1 = /searchParameters xsi:type="CategoryProductsAndServicesSearchParameter"/ =~
|
67
67
|
result_xml
|
68
|
-
r2 = /searchParameters xsi:type="
|
68
|
+
r2 = /searchParameters xsi:type="RelatedToQuerySearchParameter"/ =~
|
69
69
|
result_xml
|
70
70
|
assert_not_nil(r1, 'Unable to find item with xsi_type ' +
|
71
|
-
'
|
71
|
+
'CategoryProductsAndServicesSearchParameter')
|
72
72
|
assert_not_nil(r2, 'Unable to find item with xsi_type ' +
|
73
|
-
'
|
73
|
+
'RelatedToQuerySearchParameter')
|
74
74
|
end
|
75
75
|
end
|
@@ -26,12 +26,12 @@ require 'test/unit'
|
|
26
26
|
|
27
27
|
require 'ads_common/results_extractor'
|
28
28
|
require 'adwords_api'
|
29
|
-
require 'adwords_api/
|
29
|
+
require 'adwords_api/v201206/mutate_job_service_registry'
|
30
30
|
|
31
31
|
class TestIssue63 < Test::Unit::TestCase
|
32
32
|
def setup()
|
33
33
|
@registry =
|
34
|
-
AdwordsApi::
|
34
|
+
AdwordsApi::V201206::MutateJobService::MutateJobServiceRegistry
|
35
35
|
end
|
36
36
|
|
37
37
|
def run_test(xml_text)
|
@@ -59,7 +59,7 @@ class TestIssue63 < Test::Unit::TestCase
|
|
59
59
|
<?xml version="1.0"?>
|
60
60
|
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
61
61
|
<soap:Header>
|
62
|
-
<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/
|
62
|
+
<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201206">
|
63
63
|
<requestId>123</requestId>
|
64
64
|
<serviceName>MutateJobService</serviceName>
|
65
65
|
<methodName>getResult</methodName>
|
@@ -69,7 +69,7 @@ class TestIssue63 < Test::Unit::TestCase
|
|
69
69
|
</ResponseHeader>
|
70
70
|
</soap:Header>
|
71
71
|
<soap:Body>
|
72
|
-
<getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/
|
72
|
+
<getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/v201206">
|
73
73
|
<rval>
|
74
74
|
<SimpleMutateResult>
|
75
75
|
<results>
|
@@ -98,7 +98,7 @@ EOT
|
|
98
98
|
<?xml version="1.0"?>
|
99
99
|
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
|
100
100
|
<soap:Header>
|
101
|
-
<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/
|
101
|
+
<ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201206">
|
102
102
|
<requestId>123</requestId>
|
103
103
|
<serviceName>MutateJobService</serviceName>
|
104
104
|
<methodName>getResult</methodName>
|
@@ -108,7 +108,7 @@ EOT
|
|
108
108
|
</ResponseHeader>
|
109
109
|
</soap:Header>
|
110
110
|
<soap:Body>
|
111
|
-
<getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/
|
111
|
+
<getResultResponse xmlns="https://adwords.google.com/api/adwords/cm/v201206">
|
112
112
|
<rval>
|
113
113
|
<SimpleMutateResult>
|
114
114
|
<results>
|
@@ -0,0 +1,60 @@
|
|
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 account managements examples.
|
22
|
+
|
23
|
+
require 'test/unit'
|
24
|
+
|
25
|
+
require 'account_management/create_account'
|
26
|
+
require 'account_management/get_account_alerts'
|
27
|
+
require 'account_management/get_account_changes'
|
28
|
+
require 'account_management/get_account_hierarchy'
|
29
|
+
require 'account_management/get_client_customer_id'
|
30
|
+
require 'account_management/get_client_unit_usage'
|
31
|
+
|
32
|
+
class TestAccountManagementV201206 < Test::Unit::TestCase
|
33
|
+
def setup
|
34
|
+
end
|
35
|
+
|
36
|
+
# This test is disabled to avoid creating too many accounts.
|
37
|
+
def disabled_test_create_account
|
38
|
+
create_account()
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_get_account_alerts
|
42
|
+
get_account_alerts()
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_get_account_changes
|
46
|
+
get_account_changes()
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_get_account_hierarchy
|
50
|
+
get_account_hierarchy()
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_get_client_customer_id
|
54
|
+
get_client_customer_id('user@example.com')
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_get_client_unit_usage
|
58
|
+
get_client_unit_usage(1234567890)
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,177 @@
|
|
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 basic operations examples.
|
22
|
+
|
23
|
+
require 'test/unit'
|
24
|
+
|
25
|
+
require 'basic_operations/add_ad_groups'
|
26
|
+
require 'basic_operations/add_campaigns'
|
27
|
+
require 'basic_operations/add_keywords'
|
28
|
+
require 'basic_operations/add_text_ads'
|
29
|
+
require 'basic_operations/delete_ad_group'
|
30
|
+
require 'basic_operations/delete_ad'
|
31
|
+
require 'basic_operations/delete_campaign'
|
32
|
+
require 'basic_operations/delete_keyword'
|
33
|
+
require 'basic_operations/get_ad_groups'
|
34
|
+
require 'basic_operations/get_campaigns'
|
35
|
+
require 'basic_operations/get_campaigns_with_awql'
|
36
|
+
require 'basic_operations/get_keywords'
|
37
|
+
require 'basic_operations/get_text_ads'
|
38
|
+
require 'basic_operations/pause_ad'
|
39
|
+
require 'basic_operations/update_ad_group'
|
40
|
+
require 'basic_operations/update_campaign'
|
41
|
+
require 'basic_operations/update_keyword'
|
42
|
+
|
43
|
+
class TestBasicOperationsV201206 < Test::Unit::TestCase
|
44
|
+
def setup
|
45
|
+
@logger = Logger.new(STDOUT)
|
46
|
+
@logger.level = Logger::ERROR
|
47
|
+
@adwords = AdwordsApi::Api.new
|
48
|
+
@adwords.logger = @logger
|
49
|
+
@utils = UtilsV201206.new(@adwords)
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_add_campaigns
|
53
|
+
add_campaigns()
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_get_campaigns
|
57
|
+
get_campaigns()
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_get_campaigns_with_awql
|
61
|
+
get_campaigns_with_awql()
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_add_ad_groups
|
65
|
+
campaign = @utils.get_campaign()
|
66
|
+
assert_not_nil(campaign)
|
67
|
+
assert_not_nil(campaign[:id])
|
68
|
+
add_ad_groups(campaign[:id])
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_add_keywords
|
72
|
+
ad_group = @utils.get_ad_group()
|
73
|
+
assert_not_nil(ad_group)
|
74
|
+
assert_not_nil(ad_group[:id])
|
75
|
+
add_keywords(ad_group[:id])
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_get_keywords
|
79
|
+
ad_group = @utils.get_ad_group()
|
80
|
+
assert_not_nil(ad_group)
|
81
|
+
assert_not_nil(ad_group[:id])
|
82
|
+
get_keywords(ad_group[:id])
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_add_text_ads
|
86
|
+
ad_group = @utils.get_ad_group()
|
87
|
+
assert_not_nil(ad_group)
|
88
|
+
assert_not_nil(ad_group[:id])
|
89
|
+
add_text_ads(ad_group[:id])
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_get_text_ads
|
93
|
+
ad_group = @utils.get_ad_group()
|
94
|
+
assert_not_nil(ad_group)
|
95
|
+
assert_not_nil(ad_group[:id])
|
96
|
+
get_text_ads(ad_group[:id])
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_pause_ad
|
100
|
+
ad_group = @utils.get_ad_group()
|
101
|
+
assert_not_nil(ad_group)
|
102
|
+
assert_not_nil(ad_group[:id])
|
103
|
+
ad = @utils.get_ad()
|
104
|
+
assert_not_nil(ad)
|
105
|
+
assert_not_nil(ad[:ad])
|
106
|
+
assert_not_nil(ad[:ad][:id])
|
107
|
+
pause_ad(ad_group[:id], ad[:ad][:id])
|
108
|
+
end
|
109
|
+
|
110
|
+
def test_update_ad_group
|
111
|
+
ad_group = @utils.get_ad_group()
|
112
|
+
assert_not_nil(ad_group)
|
113
|
+
assert_not_nil(ad_group[:id])
|
114
|
+
update_ad_group(ad_group[:id])
|
115
|
+
end
|
116
|
+
|
117
|
+
def test_update_campaign
|
118
|
+
campaign = @utils.get_campaign()
|
119
|
+
assert_not_nil(campaign)
|
120
|
+
assert_not_nil(campaign[:id])
|
121
|
+
update_campaign(campaign[:id])
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_update_keyword
|
125
|
+
ad_group = @utils.get_ad_group()
|
126
|
+
assert_not_nil(ad_group)
|
127
|
+
assert_not_nil(ad_group[:id])
|
128
|
+
keyword = @utils.get_keyword()
|
129
|
+
assert_not_nil(keyword)
|
130
|
+
assert_not_nil(keyword[:criterion])
|
131
|
+
assert_not_nil(keyword[:criterion][:id])
|
132
|
+
update_keyword(ad_group[:id], keyword[:criterion][:id])
|
133
|
+
end
|
134
|
+
|
135
|
+
def test_delete_keyword
|
136
|
+
ad_group = @utils.get_ad_group()
|
137
|
+
assert_not_nil(ad_group)
|
138
|
+
assert_not_nil(ad_group[:id])
|
139
|
+
keyword = @utils.get_keyword()
|
140
|
+
assert_not_nil(keyword)
|
141
|
+
assert_not_nil(keyword[:criterion])
|
142
|
+
assert_not_nil(keyword[:criterion][:id])
|
143
|
+
delete_keyword(ad_group[:id], keyword[:criterion][:id])
|
144
|
+
end
|
145
|
+
|
146
|
+
def test_delete_ad
|
147
|
+
ad_group = @utils.get_ad_group()
|
148
|
+
assert_not_nil(ad_group)
|
149
|
+
assert_not_nil(ad_group[:id])
|
150
|
+
ad = @utils.get_ad()
|
151
|
+
assert_not_nil(ad)
|
152
|
+
assert_not_nil(ad[:ad])
|
153
|
+
assert_not_nil(ad[:ad][:id])
|
154
|
+
delete_ad(ad_group[:id], ad[:ad][:id])
|
155
|
+
end
|
156
|
+
|
157
|
+
def test_delete_ad_group
|
158
|
+
ad_group = @utils.get_ad_group()
|
159
|
+
assert_not_nil(ad_group)
|
160
|
+
assert_not_nil(ad_group[:id])
|
161
|
+
delete_ad_group(ad_group[:id])
|
162
|
+
end
|
163
|
+
|
164
|
+
def test_delete_campaign
|
165
|
+
campaign = @utils.get_campaign()
|
166
|
+
assert_not_nil(campaign)
|
167
|
+
assert_not_nil(campaign[:id])
|
168
|
+
delete_campaign(campaign[:id])
|
169
|
+
end
|
170
|
+
|
171
|
+
def test_get_ad_groups
|
172
|
+
campaign = @utils.get_campaign()
|
173
|
+
assert_not_nil(campaign)
|
174
|
+
assert_not_nil(campaign[:id])
|
175
|
+
get_ad_groups(campaign[:id])
|
176
|
+
end
|
177
|
+
end
|
@@ -0,0 +1,124 @@
|
|
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/validate_text_ad'
|
34
|
+
|
35
|
+
RETRY_INTERVAL = 5
|
36
|
+
RETRIES_COUNT = 3
|
37
|
+
KEYWORD_NUMBER = 3
|
38
|
+
|
39
|
+
class TestCampaignManagementV201206 < Test::Unit::TestCase
|
40
|
+
def setup
|
41
|
+
@logger = Logger.new(STDOUT)
|
42
|
+
@logger.level = Logger::ERROR
|
43
|
+
@adwords = AdwordsApi::Api.new
|
44
|
+
@adwords.logger = @logger
|
45
|
+
@utils = UtilsV201206.new(@adwords)
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_add_experiment
|
49
|
+
campaign = @utils.get_campaign()
|
50
|
+
ad_group = @utils.get_ad_group()
|
51
|
+
criterion = @utils.get_keyword()
|
52
|
+
assert_not_nil(campaign)
|
53
|
+
assert_not_nil(campaign[:id])
|
54
|
+
assert_not_nil(ad_group)
|
55
|
+
assert_not_nil(ad_group[:id])
|
56
|
+
assert_not_nil(criterion)
|
57
|
+
assert_not_nil(criterion[:criterion])
|
58
|
+
assert_not_nil(criterion[:criterion][:id])
|
59
|
+
add_experiment(campaign[:id], ad_group[:id], criterion[:criterion][:id])
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_add_keywords_in_bulk
|
63
|
+
add_keywords_in_bulk()
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_add_location_extension
|
67
|
+
campaign = @utils.get_campaign()
|
68
|
+
assert_not_nil(campaign)
|
69
|
+
assert_not_nil(campaign[:id])
|
70
|
+
add_location_extension(campaign[:id])
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_add_location_extension_override
|
74
|
+
ad = @utils.get_ad()
|
75
|
+
location_extension = @utils.get_location_extension()
|
76
|
+
assert_not_nil(ad)
|
77
|
+
assert_not_nil(ad[:ad])
|
78
|
+
assert_not_nil(ad[:ad][:id])
|
79
|
+
assert_not_nil(location_extension)
|
80
|
+
assert_not_nil(location_extension[:ad_extension])
|
81
|
+
assert_not_nil(location_extension[:ad_extension][:id])
|
82
|
+
add_location_extension_override(
|
83
|
+
ad[:ad][:id], location_extension[:ad_extension][:id])
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_get_all_disapproved_ads
|
87
|
+
ad_group = @utils.get_ad_group()
|
88
|
+
assert_not_nil(ad_group)
|
89
|
+
assert_not_nil(ad_group[:id])
|
90
|
+
get_all_disapproved_ads(ad_group[:id])
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_get_all_disapproved_ads_with_awql
|
94
|
+
ad_group = @utils.get_ad_group()
|
95
|
+
assert_not_nil(ad_group)
|
96
|
+
assert_not_nil(ad_group[:id])
|
97
|
+
get_all_disapproved_ads_with_awql(ad_group[:id])
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_promote_experiment
|
101
|
+
experiment = @utils.get_experiment()
|
102
|
+
assert_not_nil(experiment)
|
103
|
+
assert_not_nil(experiment[:id])
|
104
|
+
promote_experiment(experiment[:id])
|
105
|
+
end
|
106
|
+
|
107
|
+
def test_set_ad_parameters
|
108
|
+
ad_group = @utils.get_ad_group()
|
109
|
+
assert_not_nil(ad_group)
|
110
|
+
assert_not_nil(ad_group[:id])
|
111
|
+
criterion = @utils.get_keyword()
|
112
|
+
assert_not_nil(criterion)
|
113
|
+
assert_not_nil(criterion[:criterion])
|
114
|
+
assert_not_nil(criterion[:criterion][:id])
|
115
|
+
set_ad_parameters(ad_group[:id], criterion[:criterion][:id])
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_validate_text_ad
|
119
|
+
ad_group = @utils.get_ad_group()
|
120
|
+
assert_not_nil(ad_group)
|
121
|
+
assert_not_nil(ad_group[:id])
|
122
|
+
validate_text_ad(ad_group[:id])
|
123
|
+
end
|
124
|
+
end
|