google-adwords-api 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +8 -0
- data/README +22 -20
- data/adwords_api.yml +40 -0
- data/examples/v201109/account_management/create_account.rb +0 -1
- data/examples/v201109/account_management/get_account_alerts.rb +0 -1
- data/examples/v201109/account_management/get_account_changes.rb +0 -1
- data/examples/v201109/account_management/get_account_hierarchy.rb +0 -1
- data/examples/v201109/account_management/get_client_customer_id.rb +0 -1
- data/examples/v201109/account_management/get_client_unit_usage.rb +0 -1
- data/examples/v201109/basic_operations/add_ad_group.rb +0 -1
- data/examples/v201109/basic_operations/add_campaign.rb +0 -1
- data/examples/v201109/basic_operations/add_keywords.rb +0 -1
- data/examples/v201109/basic_operations/add_text_ads.rb +0 -1
- data/examples/v201109/basic_operations/delete_ad.rb +0 -1
- data/examples/v201109/basic_operations/delete_ad_group.rb +0 -1
- data/examples/v201109/basic_operations/delete_campaign.rb +0 -1
- data/examples/v201109/basic_operations/delete_keyword.rb +0 -1
- data/examples/v201109/basic_operations/get_ad_groups.rb +0 -1
- data/examples/v201109/basic_operations/get_campaigns.rb +0 -1
- data/examples/v201109/basic_operations/get_keywords.rb +0 -1
- data/examples/v201109/basic_operations/get_text_ads.rb +0 -1
- data/examples/v201109/basic_operations/pause_ad.rb +0 -1
- data/examples/v201109/basic_operations/update_ad_group.rb +0 -1
- data/examples/v201109/basic_operations/update_campaign.rb +0 -1
- data/examples/v201109/basic_operations/update_keyword.rb +0 -1
- data/examples/v201109/campaign_management/add_experiment.rb +0 -1
- data/examples/v201109/campaign_management/add_keywords_in_bulk.rb +0 -1
- data/examples/v201109/campaign_management/add_location_extension.rb +0 -1
- data/examples/v201109/campaign_management/add_location_extension_override.rb +0 -1
- data/examples/v201109/campaign_management/get_all_disapproved_ads.rb +0 -1
- data/examples/v201109/campaign_management/promote_experiment.rb +0 -1
- data/examples/v201109/campaign_management/set_ad_parameters.rb +0 -1
- data/examples/v201109/campaign_management/validate_text_ad.rb +0 -1
- data/examples/v201109/error_handling/handle_captcha_challenge.rb +94 -0
- data/examples/v201109/error_handling/handle_partial_failures.rb +0 -1
- data/examples/v201109/error_handling/handle_policy_violation_error.rb +0 -1
- data/examples/v201109/error_handling/handle_two_factor_authorization_error.rb +0 -1
- data/examples/v201109/misc/get_all_images_and_videos.rb +0 -1
- data/examples/v201109/misc/upload_image.rb +0 -1
- data/examples/v201109/misc/use_oauth.rb +0 -1
- data/examples/v201109/optimization/estimate_keyword_traffic.rb +0 -1
- data/examples/v201109/optimization/get_keyword_bid_simulations.rb +0 -1
- data/examples/v201109/optimization/get_keyword_ideas.rb +0 -1
- data/examples/v201109/optimization/get_placement_ideas.rb +0 -1
- data/examples/v201109/remarketing/add_audience.rb +0 -1
- data/examples/v201109/remarketing/add_conversion_tracker.rb +0 -1
- data/examples/v201109/reporting/download_criteria_report.rb +0 -1
- data/examples/v201109/reporting/download_defined_report.rb +0 -1
- data/examples/v201109/reporting/get_defined_reports.rb +0 -1
- data/examples/v201109/reporting/get_report_fields.rb +0 -1
- data/examples/v201109/reporting/parallel_report_download.rb +0 -1
- data/examples/v201109/targeting/add_campaign_targeting_criteria.rb +0 -1
- data/examples/v201109/targeting/get_campaign_targeting_criteria.rb +0 -1
- data/examples/v201109/targeting/get_targetable_languages_and_carriers.rb +0 -1
- data/examples/v201109/targeting/lookup_location.rb +0 -1
- data/lib/adwords_api.rb +1 -1
- data/lib/adwords_api/api_config.rb +36 -20
- data/lib/adwords_api/credential_handler.rb +5 -2
- data/lib/adwords_api/report_utils.rb +7 -5
- data/lib/adwords_api/v201109/ad_extension_override_service.rb +8 -10
- data/lib/adwords_api/v201109/ad_extension_override_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/ad_group_ad_service.rb +8 -10
- data/lib/adwords_api/v201109/ad_group_ad_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/ad_group_criterion_service.rb +8 -10
- data/lib/adwords_api/v201109/ad_group_criterion_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/ad_group_service.rb +8 -10
- data/lib/adwords_api/v201109/ad_group_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/ad_param_service.rb +8 -10
- data/lib/adwords_api/v201109/ad_param_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/alert_service.rb +4 -6
- data/lib/adwords_api/v201109/alert_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/bulk_mutate_job_service.rb +8 -10
- data/lib/adwords_api/v201109/bulk_mutate_job_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/campaign_ad_extension_service.rb +8 -10
- data/lib/adwords_api/v201109/campaign_ad_extension_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/campaign_criterion_service.rb +8 -10
- data/lib/adwords_api/v201109/campaign_criterion_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/campaign_service.rb +8 -10
- data/lib/adwords_api/v201109/campaign_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/campaign_target_service.rb +8 -10
- data/lib/adwords_api/v201109/campaign_target_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/constant_data_service.rb +4 -6
- data/lib/adwords_api/v201109/constant_data_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/conversion_tracker_service.rb +8 -10
- data/lib/adwords_api/v201109/conversion_tracker_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/create_account_service.rb +4 -6
- data/lib/adwords_api/v201109/create_account_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/customer_sync_service.rb +4 -6
- data/lib/adwords_api/v201109/customer_sync_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/data_service.rb +8 -10
- data/lib/adwords_api/v201109/data_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/experiment_service.rb +8 -10
- data/lib/adwords_api/v201109/experiment_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/geo_location_service.rb +4 -6
- data/lib/adwords_api/v201109/geo_location_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/info_service.rb +4 -6
- data/lib/adwords_api/v201109/info_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/location_criterion_service.rb +4 -6
- data/lib/adwords_api/v201109/location_criterion_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/media_service.rb +8 -10
- data/lib/adwords_api/v201109/media_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/mutate_job_service.rb +8 -10
- data/lib/adwords_api/v201109/mutate_job_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/report_definition_service.rb +8 -10
- data/lib/adwords_api/v201109/report_definition_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/serviced_account_service.rb +4 -6
- data/lib/adwords_api/v201109/serviced_account_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/targeting_idea_service.rb +8 -10
- data/lib/adwords_api/v201109/targeting_idea_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/traffic_estimator_service.rb +4 -6
- data/lib/adwords_api/v201109/traffic_estimator_service_registry.rb +6 -8
- data/lib/adwords_api/v201109/user_list_service.rb +8 -10
- data/lib/adwords_api/v201109/user_list_service_registry.rb +6 -8
- data/lib/adwords_api/version.rb +26 -0
- data/test/adwords_api/test_api_config.rb +2 -2
- data/test/adwords_api/test_report_utils.rb +1 -1
- data/test/adwords_api/test_utils.rb +1 -1
- data/test/bugs/test_issue_00000031.rb +0 -1
- data/test/suite_unittests.rb +32 -0
- metadata +130 -132
- data/Rakefile +0 -92
- data/examples/v201109/optimization/get_keyword_opportunities.rb +0 -96
- data/lib/adwords_api/v201109/bulk_opportunity_service.rb +0 -34
- data/lib/adwords_api/v201109/bulk_opportunity_service_registry.rb +0 -46
@@ -1,96 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: utf-8
|
3
|
-
#
|
4
|
-
# Author:: api.sgomes@gmail.com (Sérgio Gomes)
|
5
|
-
#
|
6
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
7
|
-
#
|
8
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
17
|
-
# implied.
|
18
|
-
# See the License for the specific language governing permissions and
|
19
|
-
# limitations under the License.
|
20
|
-
#
|
21
|
-
# This example reads all the keyword opportunities for the customer.
|
22
|
-
#
|
23
|
-
# Tags: BulkOpportunityService.get
|
24
|
-
|
25
|
-
require 'rubygems'
|
26
|
-
require 'adwords_api'
|
27
|
-
require 'adwords_api/utils'
|
28
|
-
|
29
|
-
API_VERSION = :v201109
|
30
|
-
PAGE_SIZE = 20
|
31
|
-
|
32
|
-
def get_keyword_opportunities()
|
33
|
-
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
|
34
|
-
# when called without parameters.
|
35
|
-
adwords = AdwordsApi::Api.new
|
36
|
-
|
37
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
38
|
-
# the configuration file or provide your own logger:
|
39
|
-
# adwords.logger = Logger.new('adwords_xml.log')
|
40
|
-
|
41
|
-
bulk_opportunity_srv = adwords.service(:BulkOpportunityService, API_VERSION)
|
42
|
-
|
43
|
-
# Construct selector object.
|
44
|
-
selector = {
|
45
|
-
:requested_attribute_types => ['KEYWORD', 'IDEA_TYPE'],
|
46
|
-
:paging => {
|
47
|
-
:start_index => 0,
|
48
|
-
:number_results => PAGE_SIZE
|
49
|
-
}
|
50
|
-
}
|
51
|
-
|
52
|
-
# Perform request.
|
53
|
-
ideas = []
|
54
|
-
index = 0
|
55
|
-
begin
|
56
|
-
page = bulk_opportunity_srv.get(selector)
|
57
|
-
if page and page[:entries]
|
58
|
-
page[:entries].each do |entry|
|
59
|
-
ideas += entry[:opportunity_ideas] if entry[:opportunity_ideas]
|
60
|
-
end
|
61
|
-
end
|
62
|
-
break if page[:total_num_entries] <= index
|
63
|
-
index += PAGE_SIZE
|
64
|
-
selector[:paging][:start_index] = index
|
65
|
-
end while page[:total_num_entries] > index
|
66
|
-
|
67
|
-
# Display results.
|
68
|
-
ideas.each do |idea|
|
69
|
-
data = AdwordsApi::Utils.map(idea[:data])
|
70
|
-
keyword = data['KEYWORD'][:value][:text]
|
71
|
-
idea_type = data['IDEA_TYPE'][:value]
|
72
|
-
puts " Found opportunity idea of type \"%s\": \"%s\"" % [idea_type, keyword]
|
73
|
-
end
|
74
|
-
puts "Total opportunity ideas: %d." % [ideas.length]
|
75
|
-
end
|
76
|
-
|
77
|
-
if __FILE__ == $0
|
78
|
-
begin
|
79
|
-
get_keyword_opportunities()
|
80
|
-
|
81
|
-
# HTTP errors.
|
82
|
-
rescue AdsCommon::Errors::HttpError => e
|
83
|
-
puts "HTTP Error: %s" % e
|
84
|
-
|
85
|
-
# API errors.
|
86
|
-
rescue AdwordsApi::Errors::ApiException => e
|
87
|
-
puts "Message: %s" % e.message
|
88
|
-
puts 'Errors:'
|
89
|
-
e.errors.each_with_index do |error, index|
|
90
|
-
puts "\tError [%d]:" % (index + 1)
|
91
|
-
error.each do |field, value|
|
92
|
-
puts "\t\t%s: %s" % [field, value]
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
#
|
3
|
-
# This is auto-generated code, changes will be overwritten.
|
4
|
-
#
|
5
|
-
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
|
-
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
-
#
|
8
|
-
# Code generated by AdsCommon library 0.6.2 on 2012-01-23 14:06:11.
|
9
|
-
|
10
|
-
require 'ads_common/savon_service'
|
11
|
-
require 'adwords_api/v201109/bulk_opportunity_service_registry'
|
12
|
-
|
13
|
-
module AdwordsApi; module V201109; module BulkOpportunityService
|
14
|
-
class BulkOpportunityService < AdsCommon::SavonService
|
15
|
-
def initialize(api, endpoint)
|
16
|
-
namespace = 'https://adwords.google.com/api/adwords/o/v201109'
|
17
|
-
super(api, endpoint, namespace, :v201109)
|
18
|
-
end
|
19
|
-
|
20
|
-
def get(*args, &block)
|
21
|
-
return execute_action('get', args, &block)
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def get_service_registry()
|
27
|
-
return BulkOpportunityServiceRegistry
|
28
|
-
end
|
29
|
-
|
30
|
-
def get_module()
|
31
|
-
return AdwordsApi::V201109::BulkOpportunityService
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end; end; end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# Encoding: utf-8
|
2
|
-
#
|
3
|
-
# This is auto-generated code, changes will be overwritten.
|
4
|
-
#
|
5
|
-
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
|
-
# License:: Licensed under the Apache License, Version 2.0.
|
7
|
-
#
|
8
|
-
# Code generated by AdsCommon library 0.6.2 on 2012-01-23 14:06:11.
|
9
|
-
|
10
|
-
require 'adwords_api/errors'
|
11
|
-
|
12
|
-
module AdwordsApi; module V201109; module BulkOpportunityService
|
13
|
-
class BulkOpportunityServiceRegistry
|
14
|
-
BULKOPPORTUNITYSERVICE_METHODS = {:get=>{:input=>[{:type=>"BulkOpportunitySelector", :min_occurs=>0, :max_occurs=>1, :name=>:selector}], :output=>{:fields=>[{:type=>"BulkOpportunityPage", :min_occurs=>0, :max_occurs=>1, :name=>:rval}], :name=>"get_response"}}}
|
15
|
-
BULKOPPORTUNITYSERVICE_TYPES = {:OpportunityIdeaType=>{:fields=>[]}, :OpportunityAttributeType=>{:fields=>[]}, :MoneyAttribute=>{:fields=>[{:type=>"Money", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :InStreamAdInfoAttribute=>{:fields=>[{:type=>"InStreamAdInfo", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :SoapResponseHeader=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :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=>"long", :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}], :ns=>0}, :Product=>{:fields=>[{:type=>"ProductCondition", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:conditions}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:text}], :base=>"Criterion", :ns=>0}, :Paging=>{:fields=>[{:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:start_index}, {:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:number_results}], :ns=>0}, :"BidLandscape.LandscapePoint"=>{:fields=>[{:type=>"Money", :min_occurs=>0, :max_occurs=>1, :name=>:bid}, {:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:clicks}, {:type=>"Money", :min_occurs=>0, :max_occurs=>1, :name=>:cost}, {:type=>"Money", :min_occurs=>0, :max_occurs=>1, :name=>:marginal_cpc}, {:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:impressions}], :ns=>0}, :BulkOpportunitySelector=>{:fields=>[{:type=>"OpportunityIdeaType", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:idea_types}, {:type=>"OpportunityAttributeType", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:requested_attribute_types}, {:type=>"Paging", :min_occurs=>0, :max_occurs=>1, :name=>:paging}]}, :WebpageDescriptor=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:url}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:title}]}, :ProductConditionOperand=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:operand}], :ns=>0}, :StringAttribute=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :MonthlySearchVolume=>{:fields=>[{:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:year}, {:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:month}, {:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:count}]}, :DataEntry=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:data_entry_type}], :ns=>0, :abstract=>true}, :Criterion=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:id}, {:type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1, :name=>:type}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:criterion_type}], :ns=>0}, :"SiteConstants.PlacementType"=>{:fields=>[]}, :OpportunityAttribute_AttributeMapEntry=>{:fields=>[{:type=>"OpportunityAttributeType", :min_occurs=>0, :max_occurs=>1, :name=>:key}, {:type=>"Attribute", :min_occurs=>0, :max_occurs=>1, :name=>:value}]}, :WebpageDescriptorAttribute=>{:fields=>[{:type=>"WebpageDescriptor", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :"CriterionUserList.MembershipStatus"=>{:fields=>[], :ns=>0}, :CriterionUserInterest=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:user_interest_id}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:user_interest_name}], :base=>"Criterion", :ns=>0}, :NumberValue=>{:fields=>[], :base=>"ComparableValue", :ns=>0, :abstract=>true}, :BidLandscape=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:campaign_id}, {:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:ad_group_id}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:start_date}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:end_date}, {:type=>"BidLandscape.LandscapePoint", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:landscape_points}], :base=>"DataEntry", :ns=>0, :abstract=>true}, :CriterionAttribute=>{:fields=>[{:type=>"Criterion", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :MonthlySearchVolumeAttribute=>{:fields=>[{:type=>"MonthlySearchVolume", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:value}], :base=>"Attribute"}, :IntegerAttribute=>{:fields=>[{:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :Keyword=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:text}, {:type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1, :name=>:match_type}], :base=>"Criterion", :ns=>0}, :ComparableValue=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:comparable_value_type}], :ns=>0, :abstract=>true}, :OpportunityIdea=>{:fields=>[{:type=>"OpportunityAttribute_AttributeMapEntry", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:data}]}, :LongAttribute=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :CriterionUserList=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:user_list_id}, {:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:user_list_name}, {:type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1, :name=>:user_list_membership_status}], :base=>"Criterion", :ns=>0}, :Attribute=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:attribute_type}], :abstract=>true}, :Range=>{:fields=>[{:type=>"ComparableValue", :min_occurs=>0, :max_occurs=>1, :name=>:min}, {:type=>"ComparableValue", :min_occurs=>0, :max_occurs=>1, :name=>:max}]}, :OpportunityIdeaTypeAttribute=>{:fields=>[{:type=>"OpportunityIdeaType", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :IntegerSetAttribute=>{:fields=>[{:type=>"int", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:value}], :base=>"Attribute"}, :KeywordMatchType=>{:fields=>[], :ns=>0}, :DoubleValue=>{:fields=>[{:type=>"double", :min_occurs=>0, :max_occurs=>1, :name=>:number}], :base=>"NumberValue", :ns=>0}, :Opportunity=>{:fields=>[{:type=>"OpportunityIdea", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:opportunity_ideas}]}, :BidLandscapeAttribute=>{:fields=>[{:type=>"BidLandscape", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :IdeaTypeAttribute=>{:fields=>[{:type=>"IdeaType", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :Vertical=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:path}], :base=>"Criterion", :ns=>0}, :CriterionBidLandscape=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:criterion_id}], :base=>"BidLandscape", :ns=>0}, :PlacementAttribute=>{:fields=>[{:type=>"Placement", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :KeywordAttribute=>{:fields=>[{:type=>"Keyword", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :DoubleAttribute=>{:fields=>[{:type=>"double", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :AdFormatSpec=>{:fields=>[{:type=>"SiteConstants.AdFormat", :min_occurs=>0, :max_occurs=>1, :name=>:format}]}, :IdeaType=>{:fields=>[]}, :BulkOpportunityPage=>{:fields=>[{:type=>"Opportunity", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:entries}, {:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:total_num_entries}]}, :LongRangeAttribute=>{:fields=>[{:type=>"Range", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :InStreamAdInfo=>{:fields=>[{:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:max_ad_duration}, {:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:min_ad_duration}, {:type=>"int", :min_occurs=>0, :max_occurs=>1, :name=>:median_ad_duration}, {:type=>"double", :min_occurs=>0, :max_occurs=>1, :name=>:pre_roll_percent}, {:type=>"double", :min_occurs=>0, :max_occurs=>1, :name=>:mid_roll_percent}, {:type=>"double", :min_occurs=>0, :max_occurs=>1, :name=>:post_roll_percent}]}, :BooleanAttribute=>{:fields=>[{:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :SoapHeader=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :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=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:validate_only}, {:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:partial_failure}], :ns=>0}, :ProductCondition=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:argument}, {:type=>"ProductConditionOperand", :min_occurs=>0, :max_occurs=>1, :name=>:operand}], :ns=>0}, :Money=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:micro_amount}], :base=>"ComparableValue", :ns=>0}, :"SiteConstants.AdFormat"=>{:fields=>[]}, :PlacementTypeAttribute=>{:fields=>[{:type=>"SiteConstants.PlacementType", :min_occurs=>0, :max_occurs=>1, :name=>:value}], :base=>"Attribute"}, :AdFormatSpecListAttribute=>{:fields=>[{:type=>"AdFormatSpec", :min_occurs=>0, :max_occurs=>:unbounded, :name=>:value}], :base=>"Attribute"}, :"Criterion.Type"=>{:fields=>[], :ns=>0}, :"AdGroupBidLandscape.Type"=>{:fields=>[], :ns=>0}, :Placement=>{:fields=>[{:type=>"string", :min_occurs=>0, :max_occurs=>1, :name=>:url}], :base=>"Criterion", :ns=>0}, :LongValue=>{:fields=>[{:type=>"long", :min_occurs=>0, :max_occurs=>1, :name=>:number}], :base=>"NumberValue", :ns=>0}, :AdGroupBidLandscape=>{:fields=>[{:type=>"AdGroupBidLandscape.Type", :min_occurs=>0, :max_occurs=>1, :name=>:type}, {:type=>"boolean", :min_occurs=>0, :max_occurs=>1, :name=>:landscape_current}], :base=>"BidLandscape", :ns=>0}}
|
16
|
-
BULKOPPORTUNITYSERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201109"]
|
17
|
-
|
18
|
-
def self.get_method_signature(method_name)
|
19
|
-
return BULKOPPORTUNITYSERVICE_METHODS[method_name.to_sym]
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.get_type_signature(type_name)
|
23
|
-
return BULKOPPORTUNITYSERVICE_TYPES[type_name.to_sym]
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.get_namespace(index)
|
27
|
-
return BULKOPPORTUNITYSERVICE_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)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end; end; end
|