google-adwords-api 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3 -0
- data/examples/v201206/campaign_management/add_keywords_in_bulk.rb +1 -1
- data/examples/v201209/campaign_management/add_keywords_in_bulk.rb +1 -1
- data/examples/v201302/account_management/create_account.rb +87 -0
- data/examples/v201302/account_management/get_account_alerts.rb +114 -0
- data/examples/v201302/account_management/get_account_changes.rb +137 -0
- data/examples/v201302/account_management/get_account_hierarchy.rb +95 -0
- data/examples/v201302/advanced_operations/add_click_to_download_ad.rb +129 -0
- data/examples/v201302/advanced_operations/add_site_links.rb +213 -0
- data/examples/v201302/basic_operations/add_ad_groups.rb +135 -0
- data/examples/v201302/basic_operations/add_campaigns.rb +154 -0
- data/examples/v201302/basic_operations/add_keywords.rb +108 -0
- data/examples/v201302/basic_operations/add_text_ads.rb +105 -0
- data/examples/v201302/basic_operations/delete_ad.rb +85 -0
- data/examples/v201302/basic_operations/delete_ad_group.rb +102 -0
- data/examples/v201302/basic_operations/delete_campaign.rb +103 -0
- data/examples/v201302/basic_operations/delete_keyword.rb +90 -0
- data/examples/v201302/basic_operations/get_ad_groups.rb +98 -0
- data/examples/v201302/basic_operations/get_campaigns.rb +93 -0
- data/examples/v201302/basic_operations/get_campaigns_with_awql.rb +85 -0
- data/examples/v201302/basic_operations/get_keywords.rb +104 -0
- data/examples/v201302/basic_operations/get_text_ads.rb +106 -0
- data/examples/v201302/basic_operations/pause_ad.rb +84 -0
- data/examples/v201302/basic_operations/update_ad_group.rb +81 -0
- data/examples/v201302/basic_operations/update_campaign.rb +82 -0
- data/examples/v201302/basic_operations/update_keyword.rb +102 -0
- data/examples/v201302/campaign_management/add_experiment.rb +158 -0
- data/examples/v201302/campaign_management/add_keywords_in_bulk.rb +150 -0
- data/examples/v201302/campaign_management/add_location_extension.rb +117 -0
- data/examples/v201302/campaign_management/add_location_extension_override.rb +83 -0
- data/examples/v201302/campaign_management/get_all_disapproved_ads.rb +93 -0
- data/examples/v201302/campaign_management/get_all_disapproved_ads_with_awql.rb +84 -0
- data/examples/v201302/campaign_management/promote_experiment.rb +77 -0
- data/examples/v201302/campaign_management/set_ad_parameters.rb +114 -0
- data/examples/v201302/campaign_management/set_campaign_enhanced.rb +83 -0
- data/examples/v201302/campaign_management/set_criterion_bid_modifier.rb +102 -0
- data/examples/v201302/campaign_management/validate_text_ad.rb +106 -0
- data/examples/v201302/error_handling/handle_captcha_challenge.rb +93 -0
- data/examples/v201302/error_handling/handle_partial_failures.rb +126 -0
- data/examples/v201302/error_handling/handle_policy_violation_error.rb +137 -0
- data/examples/v201302/error_handling/handle_two_factor_authorization_error.rb +88 -0
- data/examples/v201302/misc/get_all_images_and_videos.rb +100 -0
- data/examples/v201302/misc/upload_image.rb +89 -0
- data/examples/v201302/misc/use_oauth2.rb +97 -0
- data/examples/v201302/misc/use_oauth2_jwt.rb +93 -0
- data/examples/v201302/optimization/estimate_keyword_traffic.rb +129 -0
- data/examples/v201302/optimization/get_keyword_bid_simulations.rb +92 -0
- data/examples/v201302/optimization/get_keyword_ideas.rb +122 -0
- data/examples/v201302/optimization/get_placement_ideas.rb +104 -0
- data/examples/v201302/remarketing/add_audience.rb +115 -0
- data/examples/v201302/remarketing/add_conversion_tracker.rb +96 -0
- data/examples/v201302/reporting/download_criteria_report.rb +79 -0
- data/examples/v201302/reporting/download_criteria_report_with_awql.rb +78 -0
- data/examples/v201302/reporting/get_campaign_stats.rb +105 -0
- data/examples/v201302/reporting/get_report_fields.rb +71 -0
- data/examples/v201302/reporting/parallel_report_download.rb +163 -0
- data/examples/v201302/targeting/add_campaign_targeting_criteria.rb +115 -0
- data/examples/v201302/targeting/add_demographic_targeting_criteria.rb +108 -0
- data/examples/v201302/targeting/get_campaign_targeting_criteria.rb +102 -0
- data/examples/v201302/targeting/get_targetable_languages_and_carriers.rb +86 -0
- data/examples/v201302/targeting/lookup_location.rb +104 -0
- data/lib/adwords_api/api_config.rb +74 -4
- data/lib/adwords_api/v201302/ad_extension_override_service.rb +38 -0
- data/lib/adwords_api/v201302/ad_extension_override_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/ad_group_ad_service.rb +42 -0
- data/lib/adwords_api/v201302/ad_group_ad_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/ad_group_criterion_service.rb +42 -0
- data/lib/adwords_api/v201302/ad_group_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/ad_group_feed_service.rb +38 -0
- data/lib/adwords_api/v201302/ad_group_feed_service_registry.rb +47 -0
- data/lib/adwords_api/v201302/ad_group_service.rb +42 -0
- data/lib/adwords_api/v201302/ad_group_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/ad_param_service.rb +38 -0
- data/lib/adwords_api/v201302/ad_param_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/alert_service.rb +34 -0
- data/lib/adwords_api/v201302/alert_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/budget_order_service.rb +42 -0
- data/lib/adwords_api/v201302/budget_order_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/budget_service.rb +38 -0
- data/lib/adwords_api/v201302/budget_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/campaign_ad_extension_service.rb +38 -0
- data/lib/adwords_api/v201302/campaign_ad_extension_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/campaign_criterion_service.rb +42 -0
- data/lib/adwords_api/v201302/campaign_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/campaign_feed_service.rb +38 -0
- data/lib/adwords_api/v201302/campaign_feed_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/campaign_service.rb +42 -0
- data/lib/adwords_api/v201302/campaign_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/campaign_shared_set_service.rb +38 -0
- data/lib/adwords_api/v201302/campaign_shared_set_service_registry.rb +47 -0
- data/lib/adwords_api/v201302/constant_data_service.rb +62 -0
- data/lib/adwords_api/v201302/constant_data_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/conversion_tracker_service.rb +38 -0
- data/lib/adwords_api/v201302/conversion_tracker_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/customer_service.rb +34 -0
- data/lib/adwords_api/v201302/customer_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/customer_sync_service.rb +34 -0
- data/lib/adwords_api/v201302/customer_sync_service_registry.rb +47 -0
- data/lib/adwords_api/v201302/data_service.rb +38 -0
- data/lib/adwords_api/v201302/data_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/experiment_service.rb +38 -0
- data/lib/adwords_api/v201302/experiment_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/feed_item_service.rb +38 -0
- data/lib/adwords_api/v201302/feed_item_service_registry.rb +47 -0
- data/lib/adwords_api/v201302/feed_mapping_service.rb +38 -0
- data/lib/adwords_api/v201302/feed_mapping_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/feed_service.rb +38 -0
- data/lib/adwords_api/v201302/feed_service_registry.rb +47 -0
- data/lib/adwords_api/v201302/geo_location_service.rb +34 -0
- data/lib/adwords_api/v201302/geo_location_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/location_criterion_service.rb +34 -0
- data/lib/adwords_api/v201302/location_criterion_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/managed_customer_service.rb +50 -0
- data/lib/adwords_api/v201302/managed_customer_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/media_service.rb +38 -0
- data/lib/adwords_api/v201302/media_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/mutate_job_service.rb +42 -0
- data/lib/adwords_api/v201302/mutate_job_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/report_definition_service.rb +34 -0
- data/lib/adwords_api/v201302/report_definition_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/shared_criterion_service.rb +38 -0
- data/lib/adwords_api/v201302/shared_criterion_service_registry.rb +47 -0
- data/lib/adwords_api/v201302/targeting_idea_service.rb +38 -0
- data/lib/adwords_api/v201302/targeting_idea_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/traffic_estimator_service.rb +34 -0
- data/lib/adwords_api/v201302/traffic_estimator_service_registry.rb +46 -0
- data/lib/adwords_api/v201302/user_list_service.rb +38 -0
- data/lib/adwords_api/v201302/user_list_service_registry.rb +46 -0
- data/lib/adwords_api/version.rb +1 -1
- data/test/adwords_api/test_adwords_api.rb +1 -1
- data/test/adwords_api/test_api_config.rb +8 -8
- data/test/adwords_api/test_report_utils.rb +1 -1
- data/test/bugs/test_issue_00000031.rb +2 -2
- data/test/bugs/test_issue_00000063.rb +6 -6
- data/test/examples/v201302/test_account_management.rb +50 -0
- data/test/examples/v201302/test_advanced_operations.rb +54 -0
- data/test/examples/v201302/test_basic_operations.rb +177 -0
- data/test/examples/v201302/test_campaign_management.rb +140 -0
- data/test/examples/v201302/test_error_handling.rb +63 -0
- data/test/examples/v201302/test_misc.rb +39 -0
- data/test/examples/v201302/test_optimization.rb +63 -0
- data/test/examples/v201302/test_remarketing.rb +39 -0
- data/test/examples/v201302/test_reporting.rb +84 -0
- data/test/examples/v201302/test_targeting.rb +68 -0
- data/test/examples/v201302/utils.rb +267 -0
- data/test/suite_exampletests_v201302.rb +37 -0
- data/test/templates/v201209/basic_operations_get_campaigns.def +1 -1
- data/test/templates/v201302/basic_operations_get_campaigns.def +114 -0
- metadata +139 -2
@@ -0,0 +1,38 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# This is auto-generated code, changes will be overwritten.
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2013, Google Inc. All Rights Reserved.
|
6
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
+
#
|
8
|
+
# Code generated by AdsCommon library 0.9.3 on 2013-03-05 13:30:44.
|
9
|
+
|
10
|
+
require 'ads_common/savon_service'
|
11
|
+
require 'adwords_api/v201302/user_list_service_registry'
|
12
|
+
|
13
|
+
module AdwordsApi; module V201302; module UserListService
|
14
|
+
class UserListService < AdsCommon::SavonService
|
15
|
+
def initialize(config, endpoint)
|
16
|
+
namespace = 'https://adwords.google.com/api/adwords/cm/v201302'
|
17
|
+
super(config, endpoint, namespace, :v201302)
|
18
|
+
end
|
19
|
+
|
20
|
+
def get(*args, &block)
|
21
|
+
return execute_action('get', args, &block)
|
22
|
+
end
|
23
|
+
|
24
|
+
def mutate(*args, &block)
|
25
|
+
return execute_action('mutate', args, &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def get_service_registry()
|
31
|
+
return UserListServiceRegistry
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_module()
|
35
|
+
return AdwordsApi::V201302::UserListService
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end; end; end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# This is auto-generated code, changes will be overwritten.
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2013, Google Inc. All Rights Reserved.
|
6
|
+
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
+
#
|
8
|
+
# Code generated by AdsCommon library 0.9.3 on 2013-03-05 13:30:44.
|
9
|
+
|
10
|
+
require 'adwords_api/errors'
|
11
|
+
|
12
|
+
module AdwordsApi; module V201302; module UserListService
|
13
|
+
class UserListServiceRegistry
|
14
|
+
USERLISTSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"UserListPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"UserListOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"UserListReturnValue", :min_occurs=>0, :max_occurs=>1}]}}}
|
15
|
+
USERLISTSERVICE_TYPES = {:ApiError=>{:fields=>[{:name=>:field_path, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:trigger, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:api_error_type, :original_name=>"ApiError.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :ApplicationException=>{:fields=>[{:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:application_exception_type, :original_name=>"ApplicationException.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExternalRemarketingUserList=>{:fields=>[], :base=>"UserList"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UserListConversionType=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:category, :type=>"UserListConversionType.Category", :min_occurs=>0, :max_occurs=>1}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateRange=>{:fields=>[{:name=>:min, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :LogicalUserList=>{:fields=>[{:name=>:rules, :type=>"UserListLogicalRule", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"UserList"}, :LogicalUserListOperand=>{:fields=>[], :choices=>[{:name=>:user_interest, :original_name=>"UserInterest", :type=>"UserInterest", :min_occurs=>1, :max_occurs=>1}, {:name=>:user_list, :original_name=>"UserList", :type=>"UserList", :min_occurs=>1, :max_occurs=>1}]}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotWhitelistedError=>{:fields=>[{:name=>:reason, :type=>"NotWhitelistedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Operation=>{:fields=>[{:name=>:operator, :type=>"Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:operation_type, :original_name=>"Operation.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OrderBy=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sort_order, :type=>"SortOrder", :min_occurs=>0, :max_occurs=>1}]}, :Page=>{:fields=>[{:name=>:total_num_entries, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:page_type, :original_name=>"Page.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Predicate=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:operator, :type=>"Predicate.Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:values, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RateExceededError=>{:fields=>[{:name=>:reason, :type=>"RateExceededError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:rate_scope, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:retry_after_seconds, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RemarketingUserList=>{:fields=>[{:name=>:conversion_types, :type=>"UserListConversionType", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"UserList"}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Selector=>{:fields=>[{:name=>:fields, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:predicates, :type=>"Predicate", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:date_range, :type=>"DateRange", :min_occurs=>0, :max_occurs=>1}, {:name=>:ordering, :type=>"OrderBy", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:paging, :type=>"Paging", :min_occurs=>0, :max_occurs=>1}]}, :SelectorError=>{:fields=>[{:name=>:reason, :type=>"SelectorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{:name=>:auth_token, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:client_customer_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:developer_token, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_agent, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:validate_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:partial_failure, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SoapResponseHeader=>{:fields=>[{:name=>:request_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:service_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:method_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:operations, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:response_time, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UserInterest=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:size_range, :type=>"SizeRange", :min_occurs=>0, :max_occurs=>1}]}, :UserList=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_read_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"UserListMembershipStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:access_reason, :type=>"AccessReason", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_user_list_status, :type=>"AccountUserListStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:membership_life_span, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:size_range, :type=>"SizeRange", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"UserList.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_type, :original_name=>"UserList.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :UserListError=>{:fields=>[{:name=>:reason, :type=>"UserListError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UserListLogicalRule=>{:fields=>[{:name=>:operator, :type=>"UserListLogicalRule.Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:rule_operands, :type=>"LogicalUserListOperand", :min_occurs=>0, :max_occurs=>:unbounded}]}, :UserListOperation=>{:fields=>[{:name=>:operand, :type=>"UserList", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :UserListPage=>{:fields=>[{:name=>:entries, :type=>"UserList", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :UserListReturnValue=>{:fields=>[{:name=>:value, :type=>"UserList", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :AccessReason=>{:fields=>[]}, :AccountUserListStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"UserListConversionType.Category"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NotWhitelistedError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SizeRange=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UserList.Type"=>{:fields=>[]}, :"UserListError.Reason"=>{:fields=>[]}, :"UserListLogicalRule.Operator"=>{:fields=>[]}, :UserListMembershipStatus=>{:fields=>[]}}
|
16
|
+
USERLISTSERVICE_NAMESPACES = []
|
17
|
+
|
18
|
+
def self.get_method_signature(method_name)
|
19
|
+
return USERLISTSERVICE_METHODS[method_name.to_sym]
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.get_type_signature(type_name)
|
23
|
+
return USERLISTSERVICE_TYPES[type_name.to_sym]
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.get_namespace(index)
|
27
|
+
return USERLISTSERVICE_NAMESPACES[index]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# Base class for exceptions.
|
32
|
+
class ApplicationException < AdwordsApi::Errors::ApiException
|
33
|
+
attr_reader :message # string
|
34
|
+
attr_reader :application_exception_type # string
|
35
|
+
end
|
36
|
+
|
37
|
+
# Exception class for holding a list of service errors.
|
38
|
+
class ApiException < ApplicationException
|
39
|
+
attr_reader :errors # ApiError
|
40
|
+
def initialize(exception_fault)
|
41
|
+
@array_fields ||= []
|
42
|
+
@array_fields << 'errors'
|
43
|
+
super(exception_fault, UserListServiceRegistry)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end; end; end
|
data/lib/adwords_api/version.rb
CHANGED
@@ -32,27 +32,27 @@ 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(:v201302, :CampaignService)
|
36
|
+
assert_equal('adwords_api/v201302/campaign_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(:v201302, :CampaignService)
|
42
|
+
assert_equal('AdwordsApi::V201302::CampaignService', 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(:v201302, :CampaignService)
|
48
|
+
assert_equal('AdwordsApi::V201302::CampaignService::CampaignService', 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, :v201302)
|
54
54
|
expected_url =
|
55
|
-
'https://adwords.google.com/api/adwords/reportdownload/
|
55
|
+
'https://adwords.google.com/api/adwords/reportdownload/v201302'
|
56
56
|
assert_equal(expected_url, url)
|
57
57
|
end
|
58
58
|
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/v201302/targeting_idea_service_registry'
|
29
29
|
|
30
30
|
class TestIssue31 < Test::Unit::TestCase
|
31
31
|
def setup()
|
32
32
|
@registry =
|
33
|
-
AdwordsApi::
|
33
|
+
AdwordsApi::V201302::TargetingIdeaService::TargetingIdeaServiceRegistry
|
34
34
|
end
|
35
35
|
|
36
36
|
def run_test(selector)
|
@@ -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/v201302/mutate_job_service_registry'
|
30
30
|
|
31
31
|
class TestIssue63 < Test::Unit::TestCase
|
32
32
|
def setup()
|
33
33
|
@registry =
|
34
|
-
AdwordsApi::
|
34
|
+
AdwordsApi::V201302::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/v201302">
|
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/v201302">
|
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/v201302">
|
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/v201302">
|
112
112
|
<rval>
|
113
113
|
<SimpleMutateResult>
|
114
114
|
<results>
|
@@ -0,0 +1,50 @@
|
|
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
|
+
|
30
|
+
class TestAccountManagementV201302 < Test::Unit::TestCase
|
31
|
+
def setup
|
32
|
+
end
|
33
|
+
|
34
|
+
# This test is disabled to avoid creating too many accounts.
|
35
|
+
def disabled_test_create_account
|
36
|
+
create_account()
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_get_account_alerts
|
40
|
+
get_account_alerts()
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_get_account_changes
|
44
|
+
get_account_changes()
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_get_account_hierarchy
|
48
|
+
get_account_hierarchy()
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,54 @@
|
|
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 advanced operations examples.
|
22
|
+
|
23
|
+
require 'test/unit'
|
24
|
+
|
25
|
+
require 'advanced_operations/add_site_links'
|
26
|
+
require 'advanced_operations/add_click_to_download_ad'
|
27
|
+
|
28
|
+
PLACEHOLDER_SITELINKS = 1
|
29
|
+
PLACEHOLDER_FIELD_SITELINK_LINK_TEXT = 1
|
30
|
+
PLACEHOLDER_FIELD_SITELINK_LINK_URL = 2
|
31
|
+
|
32
|
+
class TestAdvancedOperationsV201302 < 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
|
+
def test_add_site_links()
|
42
|
+
campaign = @utils.get_campaign()
|
43
|
+
assert_not_nil(campaign)
|
44
|
+
assert_not_nil(campaign[:id])
|
45
|
+
add_site_links(campaign[:id])
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_add_click_to_download_ad()
|
49
|
+
ad_group = @utils.get_ad_group()
|
50
|
+
assert_not_nil(ad_group)
|
51
|
+
assert_not_nil(ad_group[:id])
|
52
|
+
add_click_to_download_ad(ad_group[:id])
|
53
|
+
end
|
54
|
+
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 TestBasicOperationsV201302 < 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 = UtilsV201302.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
|