diff --git a/adwords_api/ChangeLog b/adwords_api/ChangeLog index 340ae5652..fd86c5096 100755 --- a/adwords_api/ChangeLog +++ b/adwords_api/ChangeLog @@ -1,3 +1,6 @@ +0.14.2: + - Support and examples for v201502. + 0.14.1: - Corrected the comments and settings regarding target_all in add_ad_groups examples. diff --git a/adwords_api/examples/v201406/advanced_operations/update_site_links.rb b/adwords_api/examples/v201406/advanced_operations/update_site_links.rb deleted file mode 100755 index db6a20386..000000000 --- a/adwords_api/examples/v201406/advanced_operations/update_site_links.rb +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Author:: api.mcloonan@gmail.com (Michael Cloonan) -# -# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# This example updates an existing sitelinks feed as follows: -# * Adds FeedItemAttributes for line 1 and line 2 descriptions to the Feed -# * Populates the new FeedItemAttributes on FeedItems in the Feed -# * Replaces the Feed's existing FeedMapping with one that contains the new -# set of FeedItemAttributes -# -# The end result of this is that any campaign or ad group whose CampaignFeed -# or AdGroupFeed points to the Feed's ID will now serve line 1 and line 2 -# descriptions in its sitelinks. -# -# Tags: FeedItemService.mutate -# Tags: FeedMappingService.mutate, FeedService.mutate - -require 'adwords_api' - -def update_site_links(feed_id, feed_item_descriptions) - # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml - # when called without parameters. - adwords = AdwordsApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # adwords.logger = Logger.new('adwords_xml.log') - - feed_srv = adwords.service(:FeedService, API_VERSION) - feed_item_srv = adwords.service(:FeedItemService, API_VERSION) - feed_mapping_srv = adwords.service(:FeedMappingService, API_VERSION) - - feed_selector = { - :fields => ['Id', 'Attributes'], - :predicates => [ - {:field => 'Id', :operator => 'EQUALS', :values => [feed_id]} - ] - } - - feed = feed_srv.get(feed_selector)[:entries][0] - - # Add new line1 and line2 feed attributes. - next_attribute_index = feed[:attributes].length() - - feed[:attributes] = [ - {:type => 'STRING', :name => 'Line 1 Description'}, - {:type => 'STRING', :name => 'Line 2 Description'} - ] - - mutated_feed_result = feed_srv.mutate([ - {:operator => 'SET', :operand => feed} - ]) - - mutated_feed = mutated_feed_result[:value][0] - line_1_attribute = mutated_feed[:attributes][next_attribute_index] - line_2_attribute = mutated_feed[:attributes][next_attribute_index + 1] - - # Update feed items. - feed_item_ids = feed_item_descriptions.keys - item_selector = { - :fields => ['FeedId', 'FeedItemId', 'AttributeValues'], - :predicates => [ - {:field => 'FeedId', :operator => 'EQUALS', :values => [feed_id]}, - {:field => 'FeedItemId', :operator => 'IN', :values => feed_item_ids} - ] - } - - feed_items = feed_item_srv.get(item_selector)[:entries] - - item_operations = feed_items.map do |feed_item| - feed_item[:attribute_values] = [ - { - :feed_attribute_id => line_1_attribute[:id], - :string_value => feed_item_descriptions[feed_item[:feed_item_id]][0] - }, - { - :feed_attribute_id => line_2_attribute[:id], - :string_value => feed_item_descriptions[feed_item[:feed_item_id]][1] - } - ] - - {:operator => 'SET', :operand => feed_item} - end - items_update_result = feed_item_srv.mutate(item_operations) - puts 'Updated %d items' % items_update_result[:value].length - - # Update feed mapping. - mapping_selector = { - :fields => [ - 'FeedId', - 'FeedMappingId', - 'PlaceholderType', - 'AttributeFieldMappings' - ], - :predicates => [ - {:field => 'FeedId', :operator => 'EQUALS', :values => [feed_id]} - ] - } - feed_mapping_results = feed_mapping_srv.get(mapping_selector) - feed_mapping = feed_mapping_results[:entries][0] - - # Feed mappings are immutable, so we have to delete it and re-add - # it with modifications. - feed_mapping_srv.mutate([ - {:operator => 'REMOVE', :operand => feed_mapping} - ])[:value][0] - - feed_mapping[:attribute_field_mappings].push( - { - :feed_attribute_id => line_1_attribute[:id], - :field_id => PLACEHOLDER_FIELD_LINE_1_TEXT - }, - { - :feed_attribute_id => line_2_attribute[:id], - :field_id => PLACEHOLDER_FIELD_LINE_2_TEXT - } - ) - mapping_update_result = feed_mapping_srv.mutate([ - {:operator => 'ADD', :operand => feed_mapping} - ]) - - mutated_mapping = mapping_update_result[:value][0] - puts 'Updated field mappings for feedId %d and feedMappingId %d to:' % - [mutated_mapping[:feed_id], mutated_mapping[:feed_mapping_id]] - mutated_mapping[:attribute_field_mappings].each do |field_mapping| - puts "\tfeedAttributeId %d --> fieldId %d" % - [field_mapping[:feed_attribute_id], field_mapping[:field_id]] - end -end - -if __FILE__ == $0 - API_VERSION = :v201406 - - # See the Placeholder reference page for a list of all the placeholder types - # and fields: - # https://developers.google.com/adwords/api/docs/appendix/placeholders - PLACEHOLDER_FIELD_LINE_1_TEXT = 3 - PLACEHOLDER_FIELD_LINE_2_TEXT = 4 - - begin - feed_id = 'INSERT_FEED_ID_HERE'.to_i - feed_item_descriptions = { - 'INSERT_FEED_ITEM_A_ID_HERE'.to_i => [ - 'INSERT_FEED_ITEM_A_LINE1_DESC_HERE', - 'INSERT_FEED_ITEM_A_LINE2_DESC_HERE' - ], - 'INSERT_FEED_ITEM_B_ID_HERE'.to_i => [ - 'INSERT_FEED_ITEM_B_LINE1_DESC_HERE', - 'INSERT_FEED_ITEM_B_LINE2_DESC_HERE' - ] - } - - update_site_links(feed_id, feed_item_descriptions) - - # Authorization error. - rescue AdsCommon::Errors::OAuth2VerificationRequired => e - puts "Authorization credentials are not valid. Edit adwords_api.yml for " + - "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + - "to retrieve and store OAuth2 tokens." - puts "See this wiki page for more details:\n\n " + - 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue AdwordsApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end -end diff --git a/adwords_api/examples/v201406/optimization/estimate_keyword_traffic.rb b/adwords_api/examples/v201406/optimization/estimate_keyword_traffic.rb index 16e67aa30..8bd896021 100755 --- a/adwords_api/examples/v201406/optimization/estimate_keyword_traffic.rb +++ b/adwords_api/examples/v201406/optimization/estimate_keyword_traffic.rb @@ -84,27 +84,45 @@ def estimate_keyword_traffic() keyword = keyword_requests[index][:keyword] # Find the mean of the min and max values. - mean_avg_cpc = (estimate[:min][:average_cpc][:micro_amount] + - estimate[:max][:average_cpc][:micro_amount]) / 2 - mean_avg_position = (estimate[:min][:average_position] + - estimate[:max][:average_position]) / 2 - mean_clicks = (estimate[:min][:clicks_per_day] + - estimate[:max][:clicks_per_day]) / 2 - mean_total_cost = (estimate[:min][:total_cost][:micro_amount] + - estimate[:max][:total_cost][:micro_amount]) / 2 + mean_avg_cpc = calculate_mean( + estimate[:min][:average_cpc][:micro_amount], + estimate[:max][:average_cpc][:micro_amount] + ) + mean_avg_position = calculate_mean( + estimate[:min][:average_position], + estimate[:max][:average_position]) + ) + mean_clicks = calculate_mean( + estimate[:min][:clicks_per_day], + estimate[:max][:clicks_per_day] + ) + mean_total_cost = calculate_mean( + estimate[:min][:total_cost][:micro_amount], + estimate[:max][:total_cost][:micro_amount] + ) puts "Results for the keyword with text '%s' and match type %s:" % [keyword[:text], keyword[:match_type]] - puts "\tEstimated average CPC: %d" % mean_avg_cpc - puts "\tEstimated ad position: %.2f" % mean_avg_position - puts "\tEstimated daily clicks: %d" % mean_clicks - puts "\tEstimated daily cost: %d" % mean_total_cost + puts "\tEstimated average CPC: %s" % format_mean(mean_avg_cpc) + puts "\tEstimated ad position: %s" % format_mean(mean_avg_position) + puts "\tEstimated daily clicks: %s" % format_mean(mean_clicks) + puts "\tEstimated daily cost: %s" % format_mean(mean_total_cost) end else puts 'No traffic estimates were returned.' end end +def format_mean(mean) + return "nil" if mean.nil? + return "%.2f" % mean +end + +def calculate_mean(min_money, max_money) + return nil if min_money.nil? || max_money.nil? + return (min_money.to_f + max_money.to_f) / 2.0 +end + if __FILE__ == $0 API_VERSION = :v201406 diff --git a/adwords_api/examples/v201409/advanced_operations/update_site_links.rb b/adwords_api/examples/v201409/advanced_operations/update_site_links.rb deleted file mode 100755 index 878164ead..000000000 --- a/adwords_api/examples/v201409/advanced_operations/update_site_links.rb +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env ruby -# Encoding: utf-8 -# -# Author:: api.mcloonan@gmail.com (Michael Cloonan) -# -# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. -# -# License:: Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# This example updates an existing sitelinks feed as follows: -# * Adds FeedItemAttributes for line 1 and line 2 descriptions to the Feed -# * Populates the new FeedItemAttributes on FeedItems in the Feed -# * Replaces the Feed's existing FeedMapping with one that contains the new -# set of FeedItemAttributes -# -# The end result of this is that any campaign or ad group whose CampaignFeed -# or AdGroupFeed points to the Feed's ID will now serve line 1 and line 2 -# descriptions in its sitelinks. -# -# Tags: FeedItemService.mutate -# Tags: FeedMappingService.mutate, FeedService.mutate - -require 'adwords_api' - -def update_site_links(feed_id, feed_item_descriptions) - # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml - # when called without parameters. - adwords = AdwordsApi::Api.new - - # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in - # the configuration file or provide your own logger: - # adwords.logger = Logger.new('adwords_xml.log') - - feed_srv = adwords.service(:FeedService, API_VERSION) - feed_item_srv = adwords.service(:FeedItemService, API_VERSION) - feed_mapping_srv = adwords.service(:FeedMappingService, API_VERSION) - - feed_selector = { - :fields => ['Id', 'Attributes'], - :predicates => [ - {:field => 'Id', :operator => 'EQUALS', :values => [feed_id]} - ] - } - - feed = feed_srv.get(feed_selector)[:entries][0] - - # Add new line1 and line2 feed attributes. - next_attribute_index = feed[:attributes].length() - - feed[:attributes] = [ - {:type => 'STRING', :name => 'Line 1 Description'}, - {:type => 'STRING', :name => 'Line 2 Description'} - ] - - mutated_feed_result = feed_srv.mutate([ - {:operator => 'SET', :operand => feed} - ]) - - mutated_feed = mutated_feed_result[:value][0] - line_1_attribute = mutated_feed[:attributes][next_attribute_index] - line_2_attribute = mutated_feed[:attributes][next_attribute_index + 1] - - # Update feed items. - feed_item_ids = feed_item_descriptions.keys - item_selector = { - :fields => ['FeedId', 'FeedItemId', 'AttributeValues'], - :predicates => [ - {:field => 'FeedId', :operator => 'EQUALS', :values => [feed_id]}, - {:field => 'FeedItemId', :operator => 'IN', :values => feed_item_ids} - ] - } - - feed_items = feed_item_srv.get(item_selector)[:entries] - - item_operations = feed_items.map do |feed_item| - feed_item[:attribute_values] = [ - { - :feed_attribute_id => line_1_attribute[:id], - :string_value => feed_item_descriptions[feed_item[:feed_item_id]][0] - }, - { - :feed_attribute_id => line_2_attribute[:id], - :string_value => feed_item_descriptions[feed_item[:feed_item_id]][1] - } - ] - - {:operator => 'SET', :operand => feed_item} - end - items_update_result = feed_item_srv.mutate(item_operations) - puts 'Updated %d items' % items_update_result[:value].length - - # Update feed mapping. - mapping_selector = { - :fields => [ - 'FeedId', - 'FeedMappingId', - 'PlaceholderType', - 'AttributeFieldMappings' - ], - :predicates => [ - {:field => 'FeedId', :operator => 'EQUALS', :values => [feed_id]} - ] - } - feed_mapping_results = feed_mapping_srv.get(mapping_selector) - feed_mapping = feed_mapping_results[:entries][0] - - # Feed mappings are immutable, so we have to delete it and re-add - # it with modifications. - feed_mapping_srv.mutate([ - {:operator => 'REMOVE', :operand => feed_mapping} - ])[:value][0] - - feed_mapping[:attribute_field_mappings].push( - { - :feed_attribute_id => line_1_attribute[:id], - :field_id => PLACEHOLDER_FIELD_LINE_1_TEXT - }, - { - :feed_attribute_id => line_2_attribute[:id], - :field_id => PLACEHOLDER_FIELD_LINE_2_TEXT - } - ) - mapping_update_result = feed_mapping_srv.mutate([ - {:operator => 'ADD', :operand => feed_mapping} - ]) - - mutated_mapping = mapping_update_result[:value][0] - puts 'Updated field mappings for feedId %d and feedMappingId %d to:' % - [mutated_mapping[:feed_id], mutated_mapping[:feed_mapping_id]] - mutated_mapping[:attribute_field_mappings].each do |field_mapping| - puts "\tfeedAttributeId %d --> fieldId %d" % - [field_mapping[:feed_attribute_id], field_mapping[:field_id]] - end -end - -if __FILE__ == $0 - API_VERSION = :v201409 - - # See the Placeholder reference page for a list of all the placeholder types - # and fields: - # https://developers.google.com/adwords/api/docs/appendix/placeholders - PLACEHOLDER_FIELD_LINE_1_TEXT = 3 - PLACEHOLDER_FIELD_LINE_2_TEXT = 4 - - begin - feed_id = 'INSERT_FEED_ID_HERE'.to_i - feed_item_descriptions = { - 'INSERT_FEED_ITEM_A_ID_HERE'.to_i => [ - 'INSERT_FEED_ITEM_A_LINE1_DESC_HERE', - 'INSERT_FEED_ITEM_A_LINE2_DESC_HERE' - ], - 'INSERT_FEED_ITEM_B_ID_HERE'.to_i => [ - 'INSERT_FEED_ITEM_B_LINE1_DESC_HERE', - 'INSERT_FEED_ITEM_B_LINE2_DESC_HERE' - ] - } - - update_site_links(feed_id, feed_item_descriptions) - - # Authorization error. - rescue AdsCommon::Errors::OAuth2VerificationRequired => e - puts "Authorization credentials are not valid. Edit adwords_api.yml for " + - "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + - "to retrieve and store OAuth2 tokens." - puts "See this wiki page for more details:\n\n " + - 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' - - # HTTP errors. - rescue AdsCommon::Errors::HttpError => e - puts "HTTP Error: %s" % e - - # API errors. - rescue AdwordsApi::Errors::ApiException => e - puts "Message: %s" % e.message - puts 'Errors:' - e.errors.each_with_index do |error, index| - puts "\tError [%d]:" % (index + 1) - error.each do |field, value| - puts "\t\t%s: %s" % [field, value] - end - end - end -end diff --git a/adwords_api/examples/v201409/basic_operations/add_keywords.rb b/adwords_api/examples/v201409/basic_operations/add_keywords.rb index 9ff469108..64e2e0515 100755 --- a/adwords_api/examples/v201409/basic_operations/add_keywords.rb +++ b/adwords_api/examples/v201409/basic_operations/add_keywords.rb @@ -51,7 +51,9 @@ def add_keywords(ad_group_id) }, # Optional fields: :user_status => 'PAUSED', - :final_urls => ['http://example.com/mars'] + :final_urls => { + :urls => ['http://example.com/mars'] + } }, {:xsi_type => 'BiddableAdGroupCriterion', :ad_group_id => ad_group_id, diff --git a/adwords_api/examples/v201409/advanced_operations/add_google_my_business_location_extensions.rb b/adwords_api/examples/v201409/extensions/add_google_my_business_location_extensions.rb similarity index 99% rename from adwords_api/examples/v201409/advanced_operations/add_google_my_business_location_extensions.rb rename to adwords_api/examples/v201409/extensions/add_google_my_business_location_extensions.rb index db70b468f..4076ea08f 100755 --- a/adwords_api/examples/v201409/advanced_operations/add_google_my_business_location_extensions.rb +++ b/adwords_api/examples/v201409/extensions/add_google_my_business_location_extensions.rb @@ -81,7 +81,7 @@ def add_gmb_location_extensions(gmb_email_address, gmb_access_token, :matching_function => { :operator => 'IDENTITY', :lhsOperand => { - :xsi_type => 'FunctionArgumentOperand', + :xsi_type => 'ConstantOperand', :type => 'BOOLEAN', :boolean_value => true } diff --git a/adwords_api/examples/v201409/extensions/add_site_links.rb b/adwords_api/examples/v201409/extensions/add_site_links.rb new file mode 100755 index 000000000..64e4f01c0 --- /dev/null +++ b/adwords_api/examples/v201409/extensions/add_site_links.rb @@ -0,0 +1,167 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds a sitelinks feed and associates it with a campaign. +# +# Tags: CampaignExtensionSettingService.mutate + +require 'adwords_api' +require 'date' + +def add_site_links(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + customer_srv = adwords.service(:CustomerService, API_VERSION) + customer = customer_srv.get() + customer_time_zone = customer[:date_time_zone] + + campaign_extension_setting_srv = + adwords.service(:CampaignExtensionSettingService, API_VERSION) + + sitelink_1 = { + :xsi_type => "SitelinkFeedItem", + :sitelink_text => "Store Hours", + :sitelink_url => "http://www.example.com/storehours" + } + + sitelink_2 = { + :xsi_type => "SitelinkFeedItem", + :sitelink_text => "Thanksgiving Specials", + :sitelink_url => "http://www.example.com/thanksgiving", + :start_time => DateTime.new(Date.today.year, 11, 20, 0, 0, 0). + strftime("%Y%m%d %H%M%S ") + customer_time_zone, + :end_time => DateTime.new(Date.today.year, 11, 27, 23, 59, 59). + strftime("%Y%m%d %H%M%S ") + customer_time_zone + } + + sitelink_3 = { + :xsi_type => "SitelinkFeedItem", + :sitelink_text => "Wifi available", + :sitelink_url => "http://www.example.com/mobile/wifi", + :device_preference => {:device_preference => 30001} + } + + sitelink_4 = { + :xsi_type => "SitelinkFeedItem", + :sitelink_text => "Happy hours", + :sitelink_url => "http://www.example.com/happyhours", + :scheduling => { + :feed_item_schedules => [ + { + :day_of_week => 'MONDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + }, + { + :day_of_week => 'TUESDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + }, + { + :day_of_week => 'WEDNESDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + }, + { + :day_of_week => 'THURSDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + }, + { + :day_of_week => 'FRIDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + } + ] + } + } + + campaign_extension_setting = { + :campaign_id => campaign_id, + :extension_type => 'SITELINK', + :extension_setting => { + :extensions => [sitelink_1, sitelink_2, sitelink_3, sitelink_4] + } + } + + operation = { + :operand => campaign_extension_setting, + :operator => 'ADD' + } + + response = campaign_extension_setting_srv.mutate([operation]) + if response and response[:value] + new_extension_setting = response[:value].first + puts "Extension setting wiht type = %s was added to campaign ID %d" % + [new_extension_setting[:extension_type][:value], + new_extension_setting[:campaign_id]] + elsif + puts "No extension settings were created." + end +end + +if __FILE__ == $0 + API_VERSION = :v201409 + + begin + # Campaign ID to add site link to. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + add_site_links(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201409/advanced_operations/add_site_links.rb b/adwords_api/examples/v201409/extensions/add_site_links_using_feeds.rb similarity index 100% rename from adwords_api/examples/v201409/advanced_operations/add_site_links.rb rename to adwords_api/examples/v201409/extensions/add_site_links_using_feeds.rb diff --git a/adwords_api/examples/v201409/migration/migrate_to_extension_settings.rb b/adwords_api/examples/v201409/migration/migrate_to_extension_settings.rb new file mode 100755 index 000000000..6f151dfec --- /dev/null +++ b/adwords_api/examples/v201409/migration/migrate_to_extension_settings.rb @@ -0,0 +1,365 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example migrates your feed based sitelinks at campaign level to use +# extension settings. To learn more about extensionsettings, see +# https://developers.google.com/adwords/api/docs/guides/extension-settings. +# To learn more about migrating Feed based extensions to extension settings, +# see +# https://developers.google.com/adwords/api/docs/guides/migrate-to-extension-settings. +# +# Tags: FeedService.query, FeedMappingService.query, FeedItemService.query +# Tags: CampaignExtensionSettingService.mutate, CampaignFeedService.query +# Tags: CampaignFeedService.mutate + +require 'adwords_api' +require 'set' + +def migrate_to_extension_settings() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + # Get all of the feeds for the current user. + feeds = get_feeds(adwords) + + feeds.each do |feed| + # Retrieve all the sitelinks from the current feed. + feed_items = get_site_links_from_feed(adwords, feed) + + # Get all the instances where a sitelink from this feed has been added + # to a campaign. + campaign_feeds = get_campaign_feeds(adwords, feed, PLACEHOLDER_SITELINKS) + + all_feed_items_to_delete = campaign_feeds.map do |campaign_feed| + # Retrieve the sitelinks that have been associated with this campaign. + feed_item_ids = get_feed_item_ids_for_campaign(campaign_feed) + + if feed_item_ids.empty? + puts("Migration skipped for campaign feed with campaign ID %d " + + "and feed ID %d because no mapped feed item IDs were found in " + + "the campaign feed's matching function.") % + [campaign_feed[:campaign_id], campaign_feed[:feed_id]] + next + end + + # Delete the campaign feed that associates the sitelinks from the + # feed to the campaign. + delete_campaign_feed(adwords, campaign_feed) + + # Create extension settings instead of sitelinks. + create_extension_setting(adwords, feed_items, campaign_feed, + feed_item_ids) + + # Mark the sitelinks from the feed for deletion. + feed_item_ids + end.flatten.to_set + + # Delete all the sitelinks from the feed. + delete_old_feed_items(adwords, all_feed_items_to_delete, feed) + end +end + +def get_site_links_from_feed(adwords, feed) + # Retrieve the feed's attribute mapping. + feed_mappings = get_feed_mapping(adwords, feed, PLACEHOLDER_SITELINKS) + + feed_items = {} + + get_feed_items(adwords, feed).each do |feed_item| + site_link_from_feed = {} + + feed_item[:attribute_values].each do |attribute_value| + # Skip this attribute if it hasn't been mapped to a field. + next unless feed_mappings.has_key?( + attribute_value[:feed_attribute_id]) + + feed_mappings[attribute_value[:feed_attribute_id]].each do |field_id| + case field_id + when PLACEHOLDER_FIELD_SITELINK_LINK_TEXT + site_link_from_feed[:text] = attribute_value[:string_value] + when PLACEHOLDER_FIELD_SITELINK_URL + site_link_from_feed[:url] = attribute_value[:string_value] + when PLACEHOLDER_FIELD_FINAL_URLS + site_link_from_feed[:final_urls] = attribute_value[:string_values] + when PLACEHOLDER_FIELD_FINAL_MOBILE_URLS + site_link_from_feed[:final_mobile_urls] = + attribute_value[:string_values] + when PLACEHOLDER_FIELD_TRACKING_URL_TEMPLATE + site_link_from_feed[:tracking_url_template] = + attribute_value[:string_value] + when PLACEHOLDER_FIELD_LINE_2_TEXT + site_link_from_feed[:line2] = attribute_value[:string_value] + when PLACEHOLDER_FIELD_LINE_3_TEXT + site_link_from_feed[:line3] = attribute_value[:string_value] + end + end + end + site_link_from_feed[:scheduling] = feed_item[:scheduling] + + feed_items[feed_item[:feed_item_id]] = site_link_from_feed + end + return feed_items +end + +def get_feed_mapping(adwords, feed, placeholder_type) + feed_mapping_srv = adwords.service(:FeedMappingService, API_VERSION) + query = ("SELECT FeedMappingId, AttributeFieldMappings " + + "WHERE FeedId = %d AND PlaceholderType = %d AND Status = 'ENABLED'") % + [feed[:id], placeholder_type] + + attribute_mappings = {} + offset = 0 + + begin + page_query = (query + " LIMIT %d, %d") % [offset, PAGE_SIZE] + page = feed_mapping_srv.query(page_query) + + unless page[:entries].nil? + # Normally, a feed attribute is mapped only to one field. However, you + # may map it to more than one field if needed. + page[:entries].each do |feed_mapping| + feed_mapping[:attribute_field_mappings].each do |attribute_mapping| + # Since attribute_mappings can have multiple values for each key, + # we set up an array to store the values. + if attribute_mappings.has_key?(attribute_mapping[:feed_attribute_id]) + attribute_mappings[attribute_mapping[:feed_attribute_id]] << + attribute_mapping[:field_id] + else + attribute_mappings[attribute_mapping[:feed_attribute_id]] = + [attribute_mapping[:field_id]] + end + end + end + end + offset += PAGE_SIZE + end while page[:total_num_entries] > offset + + return attribute_mappings +end + +def get_feeds(adwords) + feed_srv = adwords.service(:FeedService, API_VERSION) + query = "SELECT Id, Name, Attributes " + + "WHERE Origin = 'USER' AND FeedStatus = 'ENABLED'" + + feeds = [] + offset = 0 + + begin + page_query = (query + " LIMIT %d, %d") % [offset, PAGE_SIZE] + page = feed_srv.query(page_query) + + unless page[:entries].nil? + feeds += page[:entries] + end + offset += PAGE_SIZE + end while page[:total_num_entries] > offset + + return feeds +end + +def get_feed_items(adwords, feed) + feed_item_srv = adwords.service(:FeedItemService, API_VERSION) + query = ("SELECT FeedItemId, AttributeValues, Scheduling " + + "WHERE Status = 'ENABLED' AND FeedId = %d") % feed[:id] + + feed_items = [] + offset = 0 + + begin + page_query = (query + " LIMIT %d, %d") % [offset, PAGE_SIZE] + page = feed_item_srv.query(page_query) + + unless page[:entries].nil? + feed_items += page[:entries] + end + offset += PAGE_SIZE + end while page[:total_num_entries] > offset + + return feed_items +end + +def delete_old_feed_items(adwords, feed_item_ids, feed) + return if feed_item_ids.empty? + + feed_item_srv = adwords.service(:FeedItemService, API_VERSION) + + operations = feed_item_ids.map do |feed_item_id| + { + :operator => 'REMOVE', + :operand => { + :feed_id => feed[:id], + :feed_item_id => feed_item_id + } + } + end + + feed_item_srv.mutate(operations) +end + +def create_extension_setting(adwords, feed_items, campaign_feed, feed_item_ids) + campaign_extension_setting_srv = adwords.service( + :CampaignExtensionSettingService, API_VERSION) + + extension_feed_items = feed_item_ids.map do |feed_item_id| + site_link_from_feed = feed_items[:feed_item_id] + site_link_feed_item = { + :sitelink_text => site_link_from_feed[:text], + :sitelink_line2 => site_link_from_feed[:line2], + :sitelink_line3 => site_link_from_feed[:line3], + :scheduling => site_link_from_feed[:scheduling] + } + if !site_link_from_feed.final_urls.nil? && + site_link_from_feed[:final_urls].length > 0 + site_link_feed_item[:sitelink_final_urls] = { + :urls => site_link_from_feed[:final_urls] + } + unless site_link_from_feed[:final_mobile_urls].nil? + site_link_feed_item[:sitelink_final_mobile_urls] = { + :urls => site_link_from_feed[:final_mobile_urls] + } + end + site_link_feed_item[:sitelink_tracking_url_template] = + site_link_from_feed[:tracking_url_template] + else + site_link_feed_item[:sitelink_url] = site_link_from_feed[:url] + end + + site_link_feed_item + end + + extension_setting = { + :extensions => extension_feed_items + } + + campaign_extension_setting = { + :campaign_id => campaign_feed[:campaign_id], + :extension_type => 'SITELINK', + :extension_setting => extension_setting + } + + operation = { + :operand => campaign_extension_setting, + :operator => 'ADD' + } + + campaign_extension_setting_srv.mutate([operation]) +end + +def delete_campaign_feed(adwords, campaign_feed) + campaign_feed_srv = adwords.service(:CampaignFeedService, API_VERSION) + + operation = { + :operand => campaign_feed, + :operator => 'REMOVE' + } + + campaign_feed_srv.mutate([operation]) +end + +def get_feed_item_ids_for_campaign(campaign_feed) + feed_item_ids = Set.new + if !campaign_feed[:matching_function][:lhs_operand].empty? && + campaign_feed[:matching_function][:lhs_operand].first[:xsi_type] == + 'RequestContextOperand' + request_context_operand = + campaign_feed[:matching_function][:lhs_operand].first + if request_context_operand[:context_type] == 'FEED_ITEM_ID' && + campaign_feed[:matching_function][:operator] == 'IN' + campaign_feed[:matching_function][:rhs_operand].each do |argument| + if argument[:xsi_type] == 'ConstantOperand' + feed_item_ids.add(argument[:long_value]) + end + end + end + end + return feed_item_ids +end + +def get_campaign_feeds(adwords, feed, placeholder_type) + campaign_feed_srv = adwords.service(:CampaignFeedService, API_VERSION) + query = ("SELECT CampaignId, MatchingFunction, PlaceholderTypes " + + "WHERE Status = 'ENABLED' AND FeedId = %d " + + "AND PlaceholderTypes CONTAINS_ANY [%d]") % [feed[:id], placeholder_type] + + campaign_feeds = [] + offset = 0 + + begin + page_query = (query + " LIMIT %d, %d") % [offset, PAGE_SIZE] + page = campaign_feed_srv.query(page_query) + + unless page[:entries].nil? + campaign_feeds += page[:entries] + end + offset += PAGE_SIZE + end while page[:total_num_entries] > offset + + return campaign_feeds +end + +if __FILE__ == $0 + API_VERSION = :v201409 + PAGE_SIZE = 500 + + # See the Placeholder reference page for a liste of all placeholder types + # and fields. + # https://developers.google.com/adwords/api/docs/appendix/placeholders + PLACEHOLDER_SITELINKS = 1 + PLACEHOLDER_FIELD_SITELINK_LINK_TEXT = 1 + PLACEHOLDER_FIELD_SITELINK_URL = 2 + PLACEHOLDER_FIELD_LINE_2_TEXT = 3 + PLACEHOLDER_FIELD_LINE_3_TEXT = 4 + PLACEHOLDER_FIELD_FINAL_URLS = 5 + PLACEHOLDER_FIELD_FINAL_MOBILE_URLS = 6 + PLACEHOLDER_FIELD_TRACKING_URL_TEMPLATE = 7 + + begin + migrate_to_extension_settings() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201409/optimization/estimate_keyword_traffic.rb b/adwords_api/examples/v201409/optimization/estimate_keyword_traffic.rb index 47db5f2a1..ec8745b37 100755 --- a/adwords_api/examples/v201409/optimization/estimate_keyword_traffic.rb +++ b/adwords_api/examples/v201409/optimization/estimate_keyword_traffic.rb @@ -84,27 +84,44 @@ def estimate_keyword_traffic() keyword = keyword_requests[index][:keyword] # Find the mean of the min and max values. - mean_avg_cpc = (estimate[:min][:average_cpc][:micro_amount] + - estimate[:max][:average_cpc][:micro_amount]) / 2 - mean_avg_position = (estimate[:min][:average_position] + - estimate[:max][:average_position]) / 2 - mean_clicks = (estimate[:min][:clicks_per_day] + - estimate[:max][:clicks_per_day]) / 2 - mean_total_cost = (estimate[:min][:total_cost][:micro_amount] + - estimate[:max][:total_cost][:micro_amount]) / 2 + mean_avg_cpc = calculate_mean( + estimate[:min][:average_cpc][:micro_amount], + estimate[:max][:average_cpc][:micro_amount] + ) + mean_avg_position = calculate_mean( + estimate[:min][:average_position], + estimate[:max][:average_position]) + ) + mean_clicks = calculate_mean( + estimate[:min][:clicks_per_day], + estimate[:max][:clicks_per_day] + ) + mean_total_cost = calculate_mean( + estimate[:min][:total_cost][:micro_amount], + estimate[:max][:total_cost][:micro_amount] + ) puts "Results for the keyword with text '%s' and match type %s:" % [keyword[:text], keyword[:match_type]] - puts "\tEstimated average CPC: %d" % mean_avg_cpc - puts "\tEstimated ad position: %.2f" % mean_avg_position - puts "\tEstimated daily clicks: %d" % mean_clicks - puts "\tEstimated daily cost: %d" % mean_total_cost - end + puts "\tEstimated average CPC: %s" % format_mean(mean_avg_cpc) + puts "\tEstimated ad position: %s" % format_mean(mean_avg_position) + puts "\tEstimated daily clicks: %s" % format_mean(mean_clicks) + puts "\tEstimated daily cost: %s" % format_mean(mean_total_cost) else puts 'No traffic estimates were returned.' end end +def format_mean(mean) + return "nil" if mean.nil? + return "%.2f" % mean +end + +def calculate_mean(min_money, max_money) + return nil if min_money.nil? || max_money.nil? + return (min_money.to_f + max_money.to_f) / 2.0 +end + if __FILE__ == $0 API_VERSION = :v201409 diff --git a/adwords_api/examples/v201502/account_management/create_account.rb b/adwords_api/examples/v201502/account_management/create_account.rb new file mode 100755 index 000000000..d841f1787 --- /dev/null +++ b/adwords_api/examples/v201502/account_management/create_account.rb @@ -0,0 +1,92 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to create an account. Note by default this +# account will only be accessible via parent MCC. +# +# Tags: ManagedCustomerService.mutate + +require 'adwords_api' +require 'adwords_api/utils' + +def create_account() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + managed_customer_srv = adwords.service(:ManagedCustomerService, API_VERSION) + + # Create a local Customer object. + customer = { + :name => 'Account created with ManagedCustomerService', + :currency_code => 'EUR', + :date_time_zone => 'Europe/London' + } + + # Prepare operation to create an account. + operation = { + :operator => 'ADD', + :operand => customer + } + + # Create the account. It is possible to create multiple accounts with one + # request by sending an array of operations. + response = managed_customer_srv.mutate([operation]) + + response[:value].each do |new_account| + puts "Account with customer ID '%s' was successfully created." % + AdwordsApi::Utils.format_id(new_account[:customer_id]) + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + create_account() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/account_management/get_account_changes.rb b/adwords_api/examples/v201502/account_management/get_account_changes.rb new file mode 100755 index 000000000..f3192bb3a --- /dev/null +++ b/adwords_api/examples/v201502/account_management/get_account_changes.rb @@ -0,0 +1,143 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets all account changes that happened within the last 24 hours, +# for all your campaigns. +# +# Tags: CustomerSyncService.get + +require 'adwords_api' +require 'date' +require 'pp' + +def get_account_changes() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_srv = adwords.service(:CampaignService, API_VERSION) + customer_sync_srv = adwords.service(:CustomerSyncService, API_VERSION) + + today_at_midnight = DateTime.parse(Date.today.to_s) + yesterday_at_midnight = DateTime.parse((Date.today - 1).to_s) + min_date_time = yesterday_at_midnight.strftime("%Y%m%d %H%M%S") + max_date_time = today_at_midnight.strftime("%Y%m%d %H%M%S") + + # Get all the campaigns for this account. + selector = { + :fields => ['Id'] + } + response = campaign_srv.get(selector) + + campaign_ids = [] + + if response and response[:entries] + campaign_ids = response[:entries].map { |campaign| campaign[:id] } + else + raise StandardError, 'No campaigns were found.' + end + + # Create a selector for CustomerSyncService. + selector = { + :campaign_ids => campaign_ids, + :date_time_range => { + :min => min_date_time, + :max => max_date_time + } + } + + # Get all account changes for the campaigns. + campaign_changes = customer_sync_srv.get(selector) + + # Display changes. + if campaign_changes + puts "Most recent change: %s" % campaign_changes[:last_change_timestamp] + campaign_changes[:changed_campaigns].each do |campaign| + puts "Campaign with ID %d was changed:" % campaign[:campaign_id] + puts "\tCampaign change status: '%s'" % campaign[:campaign_change_status] + unless ['NEW', 'FIELDS_UNCHANGED'].include?( + campaign[:campaign_change_status]) + puts "\tAdded ad extensions: '%s'" % + campaign[:added_ad_extensions].pretty_inspect.chomp + puts "\tAdded campaign criteria: '%s'" % + campaign[:added_campaign_criteria].pretty_inspect.chomp + puts "\tDeleted ad extensions: '%s'" % + campaign[:deleted_ad_extensions].pretty_inspect.chomp + puts "\tDeleted campaign criteria: '%s'" % + campaign[:deleted_campaign_criteria].pretty_inspect.chomp + + if campaign[:changed_ad_groups] + campaign[:changed_ad_groups].each do |ad_group| + puts "\tAd group with ID %d was changed:" % ad_group[:ad_group_id] + puts "\t\tAd group changed status: '%s'" % + ad_group[:ad_group_change_status] + unless ['NEW', 'FIELDS_UNCHANGED'].include?( + ad_group[:ad_group_change_status]) + puts "\t\tAds changed: '%s'" % + ad_group[:changed_ads].pretty_inspect.chomp + puts "\t\tCriteria changed: '%s'" % + ad_group[:changed_criteria].pretty_inspect.chomp + puts "\t\tCriteria deleted: '%s'" % + ad_group[:deleted_criteria].pretty_inspect.chomp + end + end + end + end + puts + end + else + puts 'No account changes were found.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + get_account_changes() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/account_management/get_account_hierarchy.rb b/adwords_api/examples/v201502/account_management/get_account_hierarchy.rb new file mode 100755 index 000000000..680a6db2d --- /dev/null +++ b/adwords_api/examples/v201502/account_management/get_account_hierarchy.rb @@ -0,0 +1,98 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve the account hierarchy under an +# account. This example needs to be run against an MCC account. +# +# Tags: ManagedCustomerService.get + +require 'adwords_api' +require 'adwords_api/utils' + +def get_account_hierarchy() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + managed_customer_srv = adwords.service(:ManagedCustomerService, API_VERSION) + + # Get the account hierarchy for this account. + selector = { + :fields => ['CustomerId', 'Name'] + } + + graph = managed_customer_srv.get(selector) + + if graph and graph[:entries] + puts 'Accounts under this hierarchy: %d' % graph[:total_num_entries] + graph[:entries].each_with_index do |account, index| + puts "%d) Customer ID: %s" % + [index + 1, AdwordsApi::Utils.format_id(account[:customer_id])] + puts "\tName: %s" % account[:name] + end + + # Display the links. + if graph[:links] + puts 'Hierarchy links:' + graph[:links].each do |link| + puts "\tThere is a link from %s to %s" % + [AdwordsApi::Utils.format_id(link[:manager_customer_id]), + AdwordsApi::Utils.format_id(link[:client_customer_id])] + end + end + else + puts 'No accounts were found.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + get_account_hierarchy() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/add_ad_customizer.rb b/adwords_api/examples/v201502/advanced_operations/add_ad_customizer.rb new file mode 100755 index 000000000..57c73406d --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/add_ad_customizer.rb @@ -0,0 +1,277 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds an ad customizer feed and associates it with the customer. +# Then it adds an ad that uses the feed to populate dynamic data. +# +# Tags: CustomerFeedService.mutate, FeedItemService.mutate +# Tags: FeedMappingService.mutate, FeedService.mutate +# Tags: AdGroupAdService.mutate + +require 'adwords_api' + +def add_ad_customizer(ad_group_ids) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + feed_srv = adwords.service(:FeedService, API_VERSION) + feed_item_srv = adwords.service(:FeedItemService, API_VERSION) + feed_mapping_srv = adwords.service(:FeedMappingService, API_VERSION) + customer_feed_srv = adwords.service(:CustomerFeedService, API_VERSION) + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # First, create a customizer feed. One feed per account can be used for + # all ads. + customizer_feed = { + :name => 'CustomizerFeed', + :attributes => [ + {:type => 'STRING', :name => 'Name'}, + {:type => 'STRING', :name => 'Price'}, + {:type => 'DATE_TIME', :name => 'Date'} + ] + } + + response = feed_srv.mutate([ + {:operator => 'ADD', :operand => customizer_feed} + ]) + + feed_data = {} + if response and response[:value] + feed = response[:value].first + feed_data = { + :feed_id => feed[:id], + :name_id => feed[:attributes][0][:id], + :price_id => feed[:attributes][1][:id], + :date_id => feed[:attributes][2][:id] + } + puts "Feed with name '%s' and ID %d was added with:" % + [feed[:name], feed[:id]] + puts ("\tName attribute ID %d and price attribute ID %d " + + "and date attribute ID %d.") % [ + feed_data[:name_id], + feed_data[:price_id], + feed_data[:date_id] + ] + else + raise new StandardError, 'No feeds were added.' + end + + # Creating feed mapping to map the fields with customizer IDs. + feed_mapping = { + :placeholder_type => PLACEHOLDER_AD_CUSTOMIZER, + :feed_id => feed_data[:feed_id], + :attribute_field_mappings => [ + { + :feed_attribute_id => feed_data[:name_id], + :field_id => PLACEHOLDER_FIELD_STRING + }, + { + :feed_attribute_id => feed_data[:price_id], + :field_id => PLACEHOLDER_FIELD_PRICE + }, + { + :feed_attribute_id => feed_data[:date_id], + :field_id => PLACEHOLDER_FIELD_DATE + } + ] + } + + response = feed_mapping_srv.mutate([ + {:operator => 'ADD', :operand => feed_mapping} + ]) + if response and response[:value] + feed_mapping = response[:value].first + puts ('Feed mapping with ID %d and placeholder type %d was saved for feed' + + ' with ID %d.') % [ + feed_mapping[:feed_mapping_id], + feed_mapping[:placeholder_type], + feed_mapping[:feed_id] + ] + else + raise new StandardError, 'No feed mappings were added.' + end + + # Now adding feed items -- the values we'd like to place. + items_data = [ + { + :name => 'Mars', + :price => '$1234.56', + :date => '20140601 000000', + :ad_group_id => ad_group_ids[0] + }, + { + :name => 'Venus', + :price => '$1450.00', + :date => '20140615 120000', + :ad_group_id => ad_group_ids[1] + } + ] + + feed_items = items_data.map do |item| + { + :feed_id => feed_data[:feed_id], + :attribute_values => [ + { + :feed_attribute_id => feed_data[:name_id], + :string_value => item[:name] + }, + { + :feed_attribute_id => feed_data[:price_id], + :string_value => item[:price] + }, + { + :feed_attribute_id => feed_data[:date_id], + :string_value => item[:date] + } + ], + :ad_group_targeting => { + :targeting_ad_group_id => item[:ad_group_id] + } + } + end + + feed_items_operations = feed_items.map do |item| + {:operator => 'ADD', :operand => item} + end + + response = feed_item_srv.mutate(feed_items_operations) + if response and response[:value] + response[:value].each do |feed_item| + puts 'Feed item with ID %d was added.' % feed_item[:feed_item_id] + end + else + raise new StandardError, 'No feed items were added.' + end + + # Finally, creating a customer (account-level) feed with a matching function + # that determines when to use this feed. For this case we use the "IDENTITY" + # matching function that is always 'true' just to associate this feed with + # the customer. The targeting is done within the feed items using the + # :campaign_targeting, :ad_group_targeting, or :keyword_targeting attributes. + matching_function = { + :operator => 'IDENTITY', + :lhs_operand => [ + { + :xsi_type => 'ConstantOperand', + :type => 'BOOLEAN', + :boolean_value => true + } + ] + } + + customer_feed = { + :feed_id => feed_data[:feed_id], + :matching_function => matching_function, + :placeholder_types => [PLACEHOLDER_AD_CUSTOMIZER] + } + + response = customer_feed_srv.mutate([ + {:operator => 'ADD', :operand => customer_feed} + ]) + if response and response[:value] + feed = response[:value].first + puts 'Customer feed with ID %d was added.' % [feed[:feed_id]] + else + raise new StandardError, 'No customer feeds were added.' + end + + # All set! We can now create ads with customizations. + text_ad = { + :xsi_type => 'TextAd', + :headline => 'Luxury Cruise to {=CustomizerFeed.Name}', + :description1 => 'Only {=CustomizerFeed.Price}', + :description2 => 'Offer ends in {=countdown(CustomizerFeed.Date)}!', + :final_urls => ['http://www.example.com'], + :display_url => 'www.example.com' + } + + # We add the same ad to both ad groups. When they serve, they will show + # different values, since they match different feed items. + operations = ad_group_ids.map do |ad_group_id| + { + :operator => 'ADD', + :operand => { + :ad_group_id => ad_group_id, + :ad => text_ad + } + } + end + + response = ad_group_ad_srv.mutate(operations) + if response and response[:value] + ads = response[:value] + ads.each do |ad| + puts "\tCreated an ad with ID %d, type '%s' and status '%s'" % + [ad[:ad][:id], ad[:ad][:ad_type], ad[:status]] + end + else + raise StandardError, 'No ads were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + # See the Placeholder reference page for a list of all the placeholder types + # and fields: + # https://developers.google.com/adwords/api/docs/appendix/placeholders + PLACEHOLDER_AD_CUSTOMIZER = 10 + PLACEHOLDER_FIELD_INTEGER = 1 + PLACEHOLDER_FIELD_FLOAT = 2 + PLACEHOLDER_FIELD_PRICE = 3 + PLACEHOLDER_FIELD_DATE = 4 + PLACEHOLDER_FIELD_STRING = 5 + + begin + ad_group_ids = [ + 'INSERT_AD_GROUP_ID_HERE'.to_i, + 'INSERT_AD_GROUP_ID_HERE'.to_i + ] + add_ad_customizer(ad_group_ids) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/add_ad_group_bid_modifier.rb b/adwords_api/examples/v201502/advanced_operations/add_ad_group_bid_modifier.rb new file mode 100755 index 000000000..8bc3905af --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/add_ad_group_bid_modifier.rb @@ -0,0 +1,105 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to add an ad group level mobile bid modifier +# override for a campaign. +# +# Tags: AdGroupBidModifierService.mutate + +require 'adwords_api' + +def add_ad_group_bid_modifier(ad_group_id, bid_modifier) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + bid_modifier_srv = adwords.service(:AdGroupBidModifierService, API_VERSION) + + # Mobile criterion ID. + criterion_id = 30001 + + # Prepare to add an ad group level override. + operation = { + # Use 'ADD' to add a new modifier and 'SET' to update an existing one. A + # modifier can be removed with the 'REMOVE' operator. + :operator => 'ADD', + :operand => { + :ad_group_id => ad_group_id, + :criterion => { + :xsi_type => 'Platform', + :id => criterion_id + }, + :bid_modifier => bid_modifier + } + } + + # Add ad group level mobile bid modifier. + response = bid_modifier_srv.mutate([operation]) + if response and response[:value] + modifier = response[:value].first + value = modifier[:bid_modifier] || 'unset' + puts ('Campaign ID %d, AdGroup ID %d, Criterion ID %d was updated with ' + + 'ad group level modifier: %s') % + [modifier[:campaign_id], modifier[:ad_group_id], + modifier[:criterion][:id], value] + else + puts 'No modifiers were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of an ad group to add an override for. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + # Bid modifier to override with. + bid_modifier = 1.5 + + add_ad_group_bid_modifier(ad_group_id, bid_modifier) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/add_click_to_download_ad.rb b/adwords_api/examples/v201502/advanced_operations/add_click_to_download_ad.rb new file mode 100755 index 000000000..153bdffcd --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/add_click_to_download_ad.rb @@ -0,0 +1,137 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This code example creates a click-to-download ad, also known as an app +# promotion ad to a given ad group. To list ad groups, run get_ad_groups.rb. +# +# Tags: AdGroupAdService.mutate + +require 'adwords_api' + +def add_click_to_download_ad(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Create the template elements for the ad. You can refer to + # https://developers.google.com/adwords/api/docs/appendix/templateads + # for the list of available template fields. + ad_data = { + :unique_name => 'adData', + :fields => [ + { + :name => 'headline', + :field_text => 'Enjoy your drive in Mars', + :type => 'TEXT' + }, + { + :name => 'description1', + :field_text => 'Realistic physics simulation', + :type => 'TEXT' + }, + { + :name => 'description2', + :field_text => 'Race against players online', + :type => 'TEXT' + }, + { + :name => 'appId', + :field_text => 'com.example.demogame', + :type => 'TEXT' + }, + { + :name => 'appStore', + :field_text => '2', + :type => 'ENUM' + } + ] + } + + # Create click to download ad. + click_to_download_app_ad = { + :xsi_type => 'TemplateAd', + :name => 'Ad for demo game', + :template_id => 353, + :final_urls => + ['http://play.google.com/store/apps/details?id=com.example.demogame'], + :display_url => 'play.google.com', + :template_elements => [ad_data] + } + + # Create ad group ad. + ad_group_ad = { + :ad_group_id => ad_group_id, + :ad => click_to_download_app_ad, + # Optional. + :status => 'PAUSED' + } + + # Add ad. + response = ad_group_ad_srv.mutate([ + {:operator => 'ADD', :operand => ad_group_ad} + ]) + if response and response[:value] + response[:value].each do |ad| + puts "Added new click-to-download ad to ad group ID %d with url '%s'." % + [ad[:ad][:id], ad[:ad][:final_urls[0]]] + end + else + raise StandardError, 'No ads were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # Ad group ID to add text ads to. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + add_click_to_download_ad(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/add_text_ad_with_upgraded_urls.rb b/adwords_api/examples/v201502/advanced_operations/add_text_ad_with_upgraded_urls.rb new file mode 100755 index 000000000..1b3a9b84e --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/add_text_ad_with_upgraded_urls.rb @@ -0,0 +1,137 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This code example adds a text ad that uses advanced features of upgraded +# URLs. +# +# Tags: AdGroupAdService.mutate + +require 'adwords_api' + +def add_text_ad_with_upgraded_urls(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Since your tracking URL will have two custom parameters, provide their + # values too. This can be provided at campaign, ad group, ad, criterion, or + # feed item levels. + season_parameter = { + :key => 'season', + :value => 'christmas' + } + + promo_code_parameter = { + :key => 'promocode', + :value => 'NYC123' + } + + tracking_url_parameters = { + :parameters => [season_parameter, promo_code_parameter] + } + + text_ad = { + :xsi_type => 'TextAd', + :headline => 'Luxury Cruise to Mars', + :description1 => 'Visit the Red Planet in style.', + :description2 => 'Low-gravity fun for everyone!', + :display_url => 'www.example.com', + # Specify a tracking URL for 3rd party tracking provider. You may specify + # one at customer, campaign, ad group, ad, criterion, or feed item levels. + :tracking_url_template => 'http://tracker.example.com/' + + '?season={_season}&promocode={_promocode}&u={lpurl}', + :url_custom_parameters => tracking_url_parameters, + # Specify a list of final URLs. This field cannot be set if :url field + # is set. This may be specified at ad, criterion, and feed item levels. + :final_urls => [ + 'http://www.example.com/cruise/space/', + 'http://www.example.com/locations/mars/' + ], + # Specify a list of final mobile URLs. This field cannot be set if :url + # field is set. This may be specificed at ad, criterion, and + # feed item levels. + :final_mobile_urls => [ + 'http://mobile.example.com/cruise/space/', + 'http://mobile.example.com/locations/mars/' + ] + } + + operation = { + :operator => 'ADD', + :operand => {:ad_group_id => ad_group_id, :ad => text_ad} + } + + # Add ads. + response = ad_group_ad_srv.mutate([operation]) + if response and response[:value] + response[:value].each do |ad| + text_ad = ad[:ad] + puts "Ad with ID %d and displayUrl '%s' was added." % + [text_ad[:id], text_ad[:display_url]] + puts "\tFinal URLs: %s" % [text_ad[:final_urls].join(', ')] + puts "\tFinal Mobile URLs: %s" % [text_ad[:final_mobile_urls].join(', ')] + puts "\tTracking URL template: %s" % [text_ad[:tracking_url_template]] + custom_parameters = text_ad[:custom_parameters].map do |custom_parameter| + "%s=%s" % [custom_parameter[:key], custom_parameter[:value]] + end + puts "\tCustom parameters: %s" % [custom_parameters.join(', ')] + end + else + raise StandardError, 'No ads were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + add_text_ad_with_upgraded_urls(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/create_and_attach_shared_keyword_set.rb b/adwords_api/examples/v201502/advanced_operations/create_and_attach_shared_keyword_set.rb new file mode 100755 index 000000000..5dda267ef --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/create_and_attach_shared_keyword_set.rb @@ -0,0 +1,137 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example creates a shared list of negative broad match keywords, it then +# attaches them to a campaign. +# +# Tags: SharedSetService.mutate, CampaignSharedSetService.mutate + +require 'adwords_api' +require 'date' + +def create_and_attach_shared_keyword_set(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + shared_set_srv = adwords.service(:SharedSetService, API_VERSION) + shared_criterion_srv = adwords.service(:SharedCriterionService, API_VERSION) + campaign_shared_set_srv = + adwords.service(:CampaignSharedSetService, API_VERSION) + + # Keywords to create a shared set of. + keywords = ['mars cruise', 'mars hotels'] + + # Create shared negative keyword set. + shared_set = { + :name => 'API Negative keyword list - %d' % (Time.new.to_f * 1000).to_i, + :type => 'NEGATIVE_KEYWORDS' + } + + # Add shared set. + response = shared_set_srv.mutate([ + {:operator => 'ADD', :operand => shared_set} + ]) + + if response and response[:value] + shared_set = response[:value].first + shared_set_id = shared_set[:shared_set_id] + puts "Shared set with ID %d and name '%s' was successfully added." % + [shared_set_id, shared_set[:name]] + else + raise StandardError, 'No shared set was added' + end + + # Add negative keywords to shared set. + shared_criteria = keywords.map do |keyword| + { + :criterion => { + :xsi_type => 'Keyword', + :text => keyword, + :match_type => 'BROAD' + }, + :negative => true, + :shared_set_id => shared_set_id + } + end + + operations = shared_criteria.map do |criterion| + {:operator => 'ADD', :operand => criterion} + end + + response = shared_criterion_srv.mutate(operations) + if response and response[:value] + response[:value].each do |shared_criterion| + puts "Added shared criterion ID %d '%s' to shared set with ID %d." % + [shared_criterion[:criterion][:id], + shared_criterion[:criterion][:text], + shared_criterion[:shared_set_id]] + end + else + raise StandardError, 'No shared keyword was added' + end + + # Attach the articles to the campaign. + campaign_set = { + :campaign_id => campaign_id, + :shared_set_id => shared_set_id + } + + response = campaign_shared_set_srv.mutate([ + {:operator => 'ADD', :operand => campaign_set} + ]) + if response and response[:value] + campaign_shared_set = response[:value].first + puts 'Shared set ID %d was attached to campaign ID %d' % + [campaign_shared_set[:shared_set_id], campaign_shared_set[:campaign_id]] + else + raise StandardError, 'No campaign shared set was added' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # Campaign ID to attach shared keyword set to. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + + create_and_attach_shared_keyword_set(campaign_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/find_and_remove_criteria_from_shared_set.rb b/adwords_api/examples/v201502/advanced_operations/find_and_remove_criteria_from_shared_set.rb new file mode 100755 index 000000000..e99824f1e --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/find_and_remove_criteria_from_shared_set.rb @@ -0,0 +1,171 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example demonstrates how to find shared sets, shared set criterions and +# how to remove them. +# +# Tags: CampaignSharedSetService.get +# Tags: SharedCriterionService.get, SharedCriterionService.mutate + +require 'adwords_api' + +def find_and_remove_criteria_from_shared_set(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_shared_set_srv = + adwords.service(:CampaignSharedSetService, API_VERSION) + shared_criterion_srv = adwords.service(:SharedCriterionService, API_VERSION) + + shared_set_ids = [] + criterion_ids = [] + + # First, retrieve all shared sets associated with the campaign. + + # Create selector for shared sets to: + # - filter by campaign ID, + # - filter by shared set type. + selector = { + :fields => ['SharedSetId', 'CampaignId', 'SharedSetName', 'SharedSetType', + 'Status'], + :predicates => [ + {:field => 'CampaignId', :operator => 'EQUALS', :values => [campaign_id]}, + {:field => 'SharedSetType', :operator => 'IN', :values => + ['NEGATIVE_KEYWORDS', 'NEGATIVE_PLACEMENTS']} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = campaign_shared_set_srv.get(selector) + if page[:entries] + page[:entries].each do |shared_set| + puts "Campaign shared set ID %d and name '%s'" % + [shared_set[:shared_set_id], shared_set[:shared_set_name]] + shared_set_ids << shared_set[:shared_set_id] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset + + # Next, Retrieve criterion IDs for all found shared sets. + selector = { + :fields => ['SharedSetId', 'Id', 'KeywordText', 'KeywordMatchType', + 'PlacementUrl'], + :predicates => [ + {:field => 'SharedSetId', :operator => 'IN', :values => shared_set_ids} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = shared_criterion_srv.get(selector) + if page[:entries] + page[:entries].each do |shared_criterion| + if shared_criterion[:criterion][:type] == 'KEYWORD' + puts "Shared negative keyword with ID %d and text '%s' was found." % + [shared_criterion[:criterion][:id], + shared_criterion[:criterion][:text]] + elsif shared_criterion[:criterion][:type] == 'PLACEMENT' + puts "Shared negative placement with ID %d and url '%s' was found." % + [shared_criterion[:criterion][:id], + shared_criterion[:criterion][:url]] + else + puts 'Shared criterion with ID %d was found.' % + [shared_criterion[:criterion][:id]] + end + criterion_ids << { + :shared_set_id => shared_criterion[:shared_set_id], + :criterion_id => shared_criterion[:criterion][:id] + } + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset + + # Finally, remove the criteria. + operations = criterion_ids.map do |criterion| + { + :operator => 'REMOVE', + :operand => { + :criterion => {:id => criterion[:criterion_id]}, + :shared_set_id => criterion[:shared_set_id] + } + } + end + + response = shared_criterion_srv.mutate(operations) + if response and response[:value] + response[:value].each do |criterion| + puts "Criterion ID %d was successfully removed from shared set ID %d." % + [criterion[:criterion][:id], criterion[:shared_set_id]] + end + else + puts 'No shared criteria were removed.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + # ID of a campaign to remove shared criteria from. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + + find_and_remove_criteria_from_shared_set(campaign_id) + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/get_ad_group_bid_modifiers.rb b/adwords_api/examples/v201502/advanced_operations/get_ad_group_bid_modifiers.rb new file mode 100755 index 000000000..c4a1c070c --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/get_ad_group_bid_modifiers.rb @@ -0,0 +1,106 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve ad group level bid modifiers for a +# campaign. +# +# Tags: AdGroupBidModifierService.get + +require 'adwords_api' + +def get_ad_group_bid_modifiers(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + bid_modifier_srv = adwords.service(:AdGroupBidModifierService, API_VERSION) + + # Get all ad group bid modifiers for the campaign. + selector = { + :fields => ['CampaignId', 'AdGroupId', 'Id', 'BidModifier'], + :predicates => [ + {:field => 'CampaignId', :operator => 'EQUALS', :values => [campaign_id]} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = bid_modifier_srv.get(selector) + if page[:entries] + page[:entries].each do |modifier| + value = modifier[:bid_modifier] || 'unset' + puts ('Campaign ID %d, AdGroup ID %d, Criterion ID %d has ad group ' + + 'level modifier: %s') % + [modifier[:campaign_id], modifier[:ad_group_id], + modifier[:criterion][:id], value] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + else + puts 'No ad group level bid overrides returned.' + end + end while page[:total_num_entries] > offset +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + # ID of a campaign to pull overrides for. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + + get_ad_group_bid_modifiers(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/upload_offline_conversions.rb b/adwords_api/examples/v201502/advanced_operations/upload_offline_conversions.rb new file mode 100755 index 000000000..61e4bcc05 --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/upload_offline_conversions.rb @@ -0,0 +1,117 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This code example imports offline conversion values for specific clicks to +# your account. To get Google Click ID for a click, run +# CLICK_PERFORMANCE_REPORT. +# +# Tags: ConversionTrackerService.mutate, OfflineConversionFeedService.mutate + +require 'adwords_api' +require 'date' + +def upload_offline_conversions(conversion_name, google_click_id, + conversion_time, conversion_value) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + conversion_tracker_srv = + adwords.service(:ConversionTrackerService, API_VERSION) + conversion_feed_srv = + adwords.service(:OfflineConversionFeedService, API_VERSION) + + # Create an upload conversion. Once created, this entry will be visible under + # Tools and Analysis->Conversion and will have Source = Import. + upload_conversion = { + :xsi_type => 'UploadConversion', + :category => 'PAGE_VIEW', + :name => conversion_name, + :viewthrough_lookback_window => 30, + :ctc_lookback_window => 90 + } + return_conversions = conversion_tracker_srv.mutate([ + {:operator => 'ADD', :operand => upload_conversion}]) + return_conversions[:value].each do |tracker| + puts "Upload conversion tracker with name '%s' and ID %d was created." % + [tracker[:name], tracker[:id]] + end + + # Associate offline conversions with the upload conversion tracker we created. + feed = { + :conversion_name => conversion_name, + :google_click_id => google_click_id, + :conversion_time => conversion_time, + :conversion_value => conversion_value + } + return_feeds = conversion_feed_srv.mutate([ + {:operator => 'ADD', :operand => feed}]) + return_feeds[:value].each do |return_feed| + puts ("Uploaded offline conversion value %.2f for Google Click ID '%s', " + + 'to %s') % [return_feed[:conversion_value], + return_feed[:google_click_id], + return_feed[:conversion_name]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # Name of the upload conversion to be created. + conversion_name = 'INSERT_CONVERSION_NAME_HERE' + # Google Click ID of the click for which offline conversions are uploaded. + google_click_id = 'INSERT_GOOGLE_CLICK_ID_HERE' + # Conversion time in 'yyyymmdd hhmmss' format. + conversion_time = Time.new.strftime("%Y%m%d %H%M%S") + # Conversion value to be uploaded. + conversion_value = 'INSERT_CONVERSION_VALUE_HERE'.to_f + + upload_offline_conversions(conversion_name, google_click_id, + conversion_time, conversion_value) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/advanced_operations/use_shared_bidding_strategy.rb b/adwords_api/examples/v201502/advanced_operations/use_shared_bidding_strategy.rb new file mode 100755 index 000000000..3c5149604 --- /dev/null +++ b/adwords_api/examples/v201502/advanced_operations/use_shared_bidding_strategy.rb @@ -0,0 +1,152 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds a Shared Bidding Strategy and uses it to construct a +# campaign. +# +# Tags: BiddingStrategyService.mutate, CampaignService.mutate +# Tags: BudgetService.mutate + +require 'adwords_api' +require 'date' + +def use_shared_bidding_strategy() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + budget_srv = adwords.service(:BudgetService, API_VERSION) + bidding_srv = adwords.service(:BiddingStrategyService, API_VERSION) + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + # Create a budget, which can be shared by multiple campaigns. + budget = { + :name => 'Interplanetary budget #%d' % (Time.new.to_f * 1000).to_i, + :amount => {:micro_amount => 50000000}, + :delivery_method => 'STANDARD', + :period => 'DAILY', + :is_explicitly_shared => true + } + return_budget = budget_srv.mutate([ + {:operator => 'ADD', :operand => budget}]) + budget_id = return_budget[:value].first[:budget_id] + + # Create a shared bidding strategy. + shared_bidding_strategy = { + :name => 'Maximize Clicks #%d' % (Time.new.to_f * 1000).to_i, + :bidding_scheme => { + :xsi_type => 'TargetSpendBiddingScheme', + # Optionally set additional bidding scheme parameters. + :bid_ceiling => {:micro_amount => 20000000}, + :spend_target => {:micro_amount => 40000000} + } + } + return_strategy = bidding_srv.mutate([ + {:operator => 'ADD', :operand => shared_bidding_strategy}]) + + bidding_strategy = return_strategy[:value].first + puts ("Shared bidding strategy with name '%s' and ID %d of type '%s' was " + + 'created') % + [bidding_strategy[:name], bidding_strategy[:id], bidding_strategy[:type]] + + # Create campaigns. + campaigns = [ + { + :name => "Interplanetary Cruise #%d" % (Time.new.to_f * 1000).to_i, + :status => 'PAUSED', + :bidding_strategy_configuration => { + :bidding_strategy_id => bidding_strategy[:id] + }, + # Budget (required) - note only the budget ID is required. + :budget => {:budget_id => budget_id}, + :advertising_channel_type => 'SEARCH', + :network_setting => { + :target_google_search => true, + :target_search_network => true, + :target_content_network => true + } + }, + { + :name => "Interplanetary Cruise banner #%d" % (Time.new.to_f * 1000).to_i, + :status => 'PAUSED', + :bidding_strategy_configuration => { + :bidding_strategy_id => bidding_strategy[:id] + }, + :budget => {:budget_id => budget_id}, + :advertising_channel_type => 'DISPLAY', + :network_setting => { + :target_google_search => false, + :target_search_network => false, + :target_content_network => true + } + } + ] + + # Prepare for adding campaign. + operations = campaigns.map do |campaign| + {:operator => 'ADD', :operand => campaign} + end + + # Add campaign. + response = campaign_srv.mutate(operations) + if response and response[:value] + response[:value].each do |campaign| + puts "Campaign with name '%s' and ID %d was added." % + [campaign[:name], campaign[:id]] + end + else + raise new StandardError, 'No campaigns were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + use_shared_bidding_strategy() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/add_ad_groups.rb b/adwords_api/examples/v201502/basic_operations/add_ad_groups.rb new file mode 100755 index 000000000..4c0b44d19 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/add_ad_groups.rb @@ -0,0 +1,144 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to create ad groups. To get a list of existing +# campaigns run get_campaigns.rb. +# +# Tags: AdGroupService.mutate + +require 'adwords_api' + +def add_ad_groups(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_srv = adwords.service(:AdGroupService, API_VERSION) + + ad_groups = [ + { + :name => "Earth to Mars Cruises #%d" % (Time.new.to_f * 1000).to_i, + :status => 'ENABLED', + :campaign_id => campaign_id, + :bidding_strategy_configuration => { + :bids => [ + { + # The 'xsi_type' field allows you to specify the xsi:type of the + # object being created. It's only necessary when you must provide + # an explicit type that the client library can't infer. + :xsi_type => 'CpcBid', + :bid => {:micro_amount => 10000000} + } + ] + }, + :settings => [ + # Targeting restriction settings - these settings only affect serving + # for the Display Network. + { + :xsi_type => 'TargetingSetting', + :details => [ + # Restricting to serve ads that match your ad group placements. + # This is equivalent to choosing "Target and bid" in the UI. + { + :xsi_type => 'TargetingSettingDetail', + :criterion_type_group => 'PLACEMENT', + :target_all => false + }, + # Using your ad group verticals only for bidding. This is equivalent + # to choosing "Bid only" in the UI. + { + :xsi_type => 'TargetingSettingDetail', + :criterion_type_group => 'VERTICAL', + :target_all => true + } + ] + } + ] + }, + { + :name => 'Earth to Pluto Cruises #%d' % (Time.new.to_f * 1000).to_i, + :status => 'ENABLED', + :campaign_id => campaign_id, + :bidding_strategy_configuration => { + :bids => [ + { + # The 'xsi_type' field allows you to specify the xsi:type of the + # object being created. It's only necessary when you must provide + # an explicit type that the client library can't infer. + :xsi_type => 'CpcBid', + :bid => {:micro_amount => 10000000} + } + ] + } + } + ] + + # Prepare operations for adding ad groups. + operations = ad_groups.map do |ad_group| + {:operator => 'ADD', :operand => ad_group} + end + + # Add ad groups. + response = ad_group_srv.mutate(operations) + if response and response[:value] + response[:value].each do |ad_group| + puts "Ad group ID %d was successfully added." % ad_group[:id] + end + else + raise StandardError, 'No ad group was added' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # Campaign ID to add ad group to. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + add_ad_groups(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/add_campaigns.rb b/adwords_api/examples/v201502/basic_operations/add_campaigns.rb new file mode 100755 index 000000000..753496146 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/add_campaigns.rb @@ -0,0 +1,143 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to create campaigns. +# +# Tags: CampaignService.mutate, BudgetService.mutate + +require 'adwords_api' +require 'date' + +def add_campaigns() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + budget_srv = adwords.service(:BudgetService, API_VERSION) + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + # Create a budget, which can be shared by multiple campaigns. + budget = { + :name => 'Interplanetary budget #%d' % (Time.new.to_f * 1000).to_i, + :amount => {:micro_amount => 50000000}, + :delivery_method => 'STANDARD', + :period => 'DAILY' + } + budget_operation = {:operator => 'ADD', :operand => budget} + + # Add budget. + return_budget = budget_srv.mutate([budget_operation]) + budget_id = return_budget[:value].first[:budget_id] + + # Create campaigns. + campaigns = [ + { + :name => "Interplanetary Cruise #%d" % (Time.new.to_f * 1000).to_i, + :status => 'PAUSED', + :bidding_strategy_configuration => { + :bidding_strategy_type => 'MANUAL_CPC' + }, + # Budget (required) - note only the budget ID is required. + :budget => {:budget_id => budget_id}, + :advertising_channel_type => 'SEARCH', + # Optional fields: + :start_date => + DateTime.parse((Date.today + 1).to_s).strftime('%Y%m%d'), + :ad_serving_optimization_status => 'ROTATE', + :network_setting => { + :target_google_search => true, + :target_search_network => true, + :target_content_network => true + }, + :settings => [ + { + :xsi_type => 'GeoTargetTypeSetting', + :positive_geo_target_type => 'DONT_CARE', + :negative_geo_target_type => 'DONT_CARE' + } + ], + :frequency_cap => { + :impressions => '5', + :time_unit => 'DAY', + :level => 'ADGROUP' + } + }, + { + :name => "Interplanetary Cruise banner #%d" % (Time.new.to_f * 1000).to_i, + :status => 'PAUSED', + :bidding_strategy_configuration => { + :bidding_strategy_type => 'MANUAL_CPC' + }, + :budget => {:budget_id => budget_id}, + :advertising_channel_type => 'DISPLAY' + } + ] + + # Prepare for adding campaign. + operations = campaigns.map do |campaign| + {:operator => 'ADD', :operand => campaign} + end + + # Add campaign. + response = campaign_srv.mutate(operations) + if response and response[:value] + response[:value].each do |campaign| + puts "Campaign with name '%s' and ID %d was added." % + [campaign[:name], campaign[:id]] + end + else + raise new StandardError, 'No campaigns were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + add_campaigns() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/add_keywords.rb b/adwords_api/examples/v201502/basic_operations/add_keywords.rb new file mode 100755 index 000000000..efcd17449 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/add_keywords.rb @@ -0,0 +1,118 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to add multiple keywords to a given ad group. To +# create an ad group, run add_ad_group.rb. +# +# Tags: AdGroupCriterionService.mutate + +require 'adwords_api' + +def add_keywords(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_criterion_srv = + adwords.service(:AdGroupCriterionService, API_VERSION) + + # Create keywords. + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + keywords = [ + {:xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => { + :xsi_type => 'Keyword', + :text => 'mars cruise', + :match_type => 'BROAD' + }, + # Optional fields: + :user_status => 'PAUSED', + :final_urls => { + :urls => ['http://example.com/mars'] + } + }, + {:xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => { + :xsi_type => 'Keyword', + :text => 'space hotel', + :match_type => 'BROAD'}} + ] + + # Create 'ADD' operations. + operations = keywords.map do |keyword| + {:operator => 'ADD', :operand => keyword} + end + + # Add keywords. + response = ad_group_criterion_srv.mutate(operations) + if response and response[:value] + ad_group_criteria = response[:value] + puts "Added %d keywords to ad group ID %d:" % + [ad_group_criteria.length, ad_group_id] + ad_group_criteria.each do |ad_group_criterion| + puts "\tKeyword ID is %d and type is '%s'" % + [ad_group_criterion[:criterion][:id], + ad_group_criterion[:criterion][:type]] + end + else + raise StandardError, 'No keywords were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # Ad group ID to add keywords to. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + add_keywords(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/add_text_ads.rb b/adwords_api/examples/v201502/basic_operations/add_text_ads.rb new file mode 100755 index 000000000..40da49ad2 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/add_text_ads.rb @@ -0,0 +1,113 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to add text ads to a given ad group. To create an +# ad group, run add_ad_group.rb. +# +# Tags: AdGroupAdService.mutate + +require 'adwords_api' + +def add_text_ads(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Create text ads. + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + text_ads = [ + { + :xsi_type => 'TextAd', + :headline => 'Luxury Cruise to Mars', + :description1 => 'Visit the Red Planet in style.', + :description2 => 'Low-gravity fun for everyone!', + :final_urls => ['http://www.example.com'], + :display_url => 'www.example.com' + }, + { + :xsi_type => 'TextAd', + :headline => 'Luxury Cruise to Mars', + :description1 => 'Enjoy your stay at Red Planet.', + :description2 => 'Buy your tickets now!', + :final_urls => ['http://www.example.com'], + :display_url => 'www.example.com' + } + ] + + # Create ad 'ADD' operations. + text_ad_operations = text_ads.map do |text_ad| + {:operator => 'ADD', + :operand => {:ad_group_id => ad_group_id, :ad => text_ad}} + end + + # Add ads. + response = ad_group_ad_srv.mutate(text_ad_operations) + if response and response[:value] + ads = response[:value] + puts "Added %d ad(s) to ad group ID %d:" % [ads.length, ad_group_id] + ads.each do |ad| + puts "\tAd ID %d, type '%s' and status '%s'" % + [ad[:ad][:id], ad[:ad][:ad_type], ad[:status]] + end + else + raise StandardError, 'No ads were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # Ad group ID to add text ads to. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + add_text_ads(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/get_ad_groups.rb b/adwords_api/examples/v201502/basic_operations/get_ad_groups.rb new file mode 100755 index 000000000..d9992d997 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/get_ad_groups.rb @@ -0,0 +1,106 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all the ad groups for a campaign. To +# create an ad group, run add_ad_group.rb. +# +# Tags: AdGroupService.get + +require 'adwords_api' + +def get_ad_groups(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_srv = adwords.service(:AdGroupService, API_VERSION) + + # Get all the ad groups for this campaign. + selector = { + :fields => ['Id', 'Name'], + :ordering => [{:field => 'Name', :sort_order => 'ASCENDING'}], + :predicates => [ + {:field => 'CampaignId', :operator => 'IN', :values => [campaign_id]} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = ad_group_srv.get(selector) + if page[:entries] + page[:entries].each do |ad_group| + puts "Ad group name is '%s' and ID is %d" % + [ad_group[:name], ad_group[:id]] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset + + if page.include?(:total_num_entries) + puts "\tCampaign ID %d has %d ad group(s)." % + [campaign_id, page[:total_num_entries]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + # Campaign ID to get ad groups for. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + get_ad_groups(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/get_campaigns.rb b/adwords_api/examples/v201502/basic_operations/get_campaigns.rb new file mode 100755 index 000000000..6242b1e74 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/get_campaigns.rb @@ -0,0 +1,101 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all the campaigns for an account. +# +# Tags: CampaignService.get + +require 'adwords_api' + +def get_campaigns() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + # Get all the campaigns for this account. + selector = { + :fields => ['Id', 'Name', 'Status'], + :ordering => [ + {:field => 'Name', :sort_order => 'ASCENDING'} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = campaign_srv.get(selector) + if page[:entries] + page[:entries].each do |campaign| + puts "Campaign ID %d, name '%s' and status '%s'" % + [campaign[:id], campaign[:name], campaign[:status]] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset + + if page.include?(:total_num_entries) + puts "\tTotal number of campaigns found: %d." % [page[:total_num_entries]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + get_campaigns() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/get_campaigns_with_awql.rb b/adwords_api/examples/v201502/basic_operations/get_campaigns_with_awql.rb new file mode 100755 index 000000000..35e807dcf --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/get_campaigns_with_awql.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2012, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all the campaigns for an account with +# AWQL. +# +# Tags: CampaignService.query + +require 'adwords_api' + +def get_campaigns_with_awql() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + # Get all the campaigns for this account. + query = 'SELECT Id, Name, Status ORDER BY Name' + + # Set initial values. + offset, page = 0, {} + + begin + page_query = query + ' LIMIT %d,%d' % [offset, PAGE_SIZE] + page = campaign_srv.query(page_query) + if page[:entries] + page[:entries].each do |campaign| + puts "Campaign ID %d, name '%s' and status '%s'" % + [campaign[:id], campaign[:name], campaign[:status]] + end + # Increment values to request the next page. + offset += PAGE_SIZE + end + end while page[:total_num_entries] > offset + + if page.include?(:total_num_entries) + puts "\tTotal number of campaigns found: %d." % page[:total_num_entries] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + get_campaigns_with_awql() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts 'HTTP Error: %s' % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts 'Message: %s' % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/get_keywords.rb b/adwords_api/examples/v201502/basic_operations/get_keywords.rb new file mode 100755 index 000000000..0a8580158 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/get_keywords.rb @@ -0,0 +1,112 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all keywords for an ad group. To add +# keywords to an existing ad group, run add_keywords.rb. +# +# Tags: AdGroupCriterionService.get + +require 'adwords_api' + +def get_keywords(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_criterion_srv = + adwords.service(:AdGroupCriterionService, API_VERSION) + + # Get all keywords for this ad group. + selector = { + :fields => ['Id', 'CriteriaType', 'KeywordText'], + :ordering => [ + {:field => 'Id', :sort_order => 'ASCENDING'} + ], + :predicates => [ + {:field => 'AdGroupId', :operator => 'EQUALS', :values => [ad_group_id]}, + {:field => 'CriteriaType', :operator => 'EQUALS', :values => ['KEYWORD']} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = ad_group_criterion_srv.get(selector) + if page[:entries] + page[:entries].each do |keyword| + puts "Keyword ID %d, type '%s' and text '%s'" % + [keyword[:criterion][:id], + keyword[:criterion][:type], + keyword[:criterion][:text]] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset + + if page.include?(:total_num_entries) + puts "\tAd group ID %d has %d keyword(s)." % + [ad_group_id, page[:total_num_entries]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + # Ad group ID to get keywords for. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + get_keywords(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/get_text_ads.rb b/adwords_api/examples/v201502/basic_operations/get_text_ads.rb new file mode 100755 index 000000000..9826f3ad8 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/get_text_ads.rb @@ -0,0 +1,114 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all text ads for an ad group. To add +# ads to an existing ad group, run add_text_ads.rb. +# +# Tags: AdGroupAdService.get + +require 'adwords_api' + +def get_text_ads(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Get all the ads for this ad group. + selector = { + :fields => ['Id', 'Status', 'AdType'], + :ordering => [{:field => 'Id', :sort_order => 'ASCENDING'}], + # By default, disabled ads aren't returned by the selector. To return them, + # include the DISABLED status in a predicate. + :predicates => [ + {:field => 'AdGroupId', :operator => 'IN', :values => [ad_group_id]}, + {:field => 'Status', + :operator => 'IN', + :values => ['ENABLED', 'PAUSED', 'DISABLED']}, + {:field => 'AdType', + :operator => 'EQUALS', + :values => ['TEXT_AD']} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = ad_group_ad_srv.get(selector) + if page[:entries] + page[:entries].each do |ad| + puts "Ad ID is %d, type is '%s' and status is '%s'" % + [ad[:ad][:id], ad[:ad][:ad_type], ad[:status]] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset + + if page.include?(:total_num_entries) + puts "\tAd group ID %d has %d ad(s)." % + [ad_group_id, page[:total_num_entries]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + # Ad group ID to get text ads for. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + get_text_ads(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/pause_ad.rb b/adwords_api/examples/v201502/basic_operations/pause_ad.rb new file mode 100755 index 000000000..f0a8d15ab --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/pause_ad.rb @@ -0,0 +1,92 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to update an ad, setting its status to 'PAUSED'. +# To create ads, run add_text_ads.rb. +# +# Tags: AdGroupAdService.mutate + +require 'adwords_api' + +def pause_ad(ad_group_id, ad_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Prepare operation for updating ad. + operation = { + :operator => 'SET', + :operand => { + :ad_group_id => ad_group_id, + :status => 'PAUSED', + :ad => {:id => ad_id} + } + } + + # Update ad. + response = ad_group_ad_srv.mutate([operation]) + if response and response[:value] + ad = response[:value].first + puts "Ad ID %d was successfully updated, status set to '%s'." % + [ad[:ad][:id], ad[:status]] + else + puts 'No ads were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # IDs of ad to pause and its ad group. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + ad_id = 'INSERT_AD_ID_HERE'.to_i + pause_ad(ad_group_id, ad_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/remove_ad.rb b/adwords_api/examples/v201502/basic_operations/remove_ad.rb new file mode 100755 index 000000000..93df3353a --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/remove_ad.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example removes an ad using the 'REMOVE' operator. To get ads, run +# get_text_ads.rb. +# +# Tags: AdGroupAdService.mutate + +require 'adwords_api' + +def remove_ad(ad_group_id, ad_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Prepare for deleting ad. + operation = { + :operator => 'REMOVE', + :operand => { + :ad_group_id => ad_group_id, + :ad => { + :xsi_type => 'Ad', + :id => ad_id + } + } + } + + # Remove ad. + response = ad_group_ad_srv.mutate([operation]) + if response and response[:value] + ad = response[:value].first + puts "Ad ID %d was successfully removed." % ad[:ad][:id] + else + puts 'No ads were removed.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # IDs of an ad to remove and its ad group. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + ad_id = 'INSERT_AD_ID_HERE'.to_i + remove_ad(ad_group_id, ad_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/remove_ad_group.rb b/adwords_api/examples/v201502/basic_operations/remove_ad_group.rb new file mode 100755 index 000000000..84266141f --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/remove_ad_group.rb @@ -0,0 +1,89 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example removes an ad group by setting the status to 'REMOVED'. To get ad +# groups, run get_ad_groups.rb. +# +# Tags: AdGroupService.mutate + +require 'adwords_api' + +def remove_ad_group(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_srv = adwords.service(:AdGroupService, API_VERSION) + + # Prepare for deleting ad group. + operation = { + :operator => 'SET', + :operand => { + :id => ad_group_id, + :status => 'REMOVED' + } + } + + # Remove ad group. + response = ad_group_srv.mutate([operation]) + if response and response[:value] + ad_group = response[:value].first + puts "Ad group ID %d was successfully removed." % [ad_group[:id]] + else + puts 'No ad group was updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of an ad group to remove. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + remove_ad_group(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/remove_campaign.rb b/adwords_api/examples/v201502/basic_operations/remove_campaign.rb new file mode 100755 index 000000000..a06d49e94 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/remove_campaign.rb @@ -0,0 +1,91 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example removes a campaign by setting the status to 'REMOVED'. To get +# campaigns, run get_campaigns.rb. +# +# Tags: CampaignService.mutate + +require 'adwords_api' + +def remove_campaign(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + # Prepare for deleting campaign. + operation = { + :operator => 'SET', + :operand => { + :id => campaign_id, + :status => 'REMOVED' + } + } + + # Remove campaign. + response = campaign_srv.mutate([operation]) + + if response and response[:value] + campaign = response[:value].first + puts "Campaign ID %d was removed." % + [campaign[:id]] + else + puts 'No campaign was updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of a campaign to remove. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + remove_campaign(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/remove_keyword.rb b/adwords_api/examples/v201502/basic_operations/remove_keyword.rb new file mode 100755 index 000000000..93dd69b8e --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/remove_keyword.rb @@ -0,0 +1,98 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example removes a keyword using the 'REMOVE' operator. To get list of +# keywords, run get_keywords.rb. +# +# Tags: AdGroupCriterionService.mutate + +require 'adwords_api' + +def remove_keyword(ad_group_id, criterion_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_criterion_srv = + adwords.service(:AdGroupCriterionService, API_VERSION) + + # Prepare for deleting keyword. + operation = { + :operator => 'REMOVE', + :operand => { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => { + :id => criterion_id + } + } + } + + # Remove keyword. + response = ad_group_criterion_srv.mutate([operation]) + ad_group_criterion = response[:value].first + if ad_group_criterion + puts "Keyword ID %d was successfully removed." % + ad_group_criterion[:criterion][:id] + else + puts 'No keywords were removed.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # IDs of criterion to remove and its ad group. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + criterion_id = 'INSERT_CRITERION_ID_HERE'.to_i + remove_keyword(ad_group_id, criterion_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/update_ad_group.rb b/adwords_api/examples/v201502/basic_operations/update_ad_group.rb new file mode 100755 index 000000000..d84cedfe1 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/update_ad_group.rb @@ -0,0 +1,89 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to update an ad group, setting its status to +# 'PAUSED'. To create an ad group, run add_ad_group.rb. +# +# Tags: AdGroupService.mutate + +require 'adwords_api' + +def update_ad_group(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_srv = adwords.service(:AdGroupService, API_VERSION) + + # Prepare for updating ad group. + operation = { + :operator => 'SET', + :operand => { + :status => 'PAUSED', + :id => ad_group_id + } + } + + # Update ad group. + response = ad_group_srv.mutate([operation]) + if response and response[:value] + ad_group = response[:value].first + puts 'Ad group id %d was successfully updated.' % ad_group[:id] + else + puts 'No ad groups were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of an ad group to update. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + update_ad_group(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/update_campaign.rb b/adwords_api/examples/v201502/basic_operations/update_campaign.rb new file mode 100755 index 000000000..e19539acd --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/update_campaign.rb @@ -0,0 +1,90 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to update a campaign, setting its status to +# 'PAUSED'. To create a campaign, run add_campaigns.rb. +# +# Tags: CampaignService.mutate + +require 'adwords_api' + +def update_campaign(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + # Prepare for updating campaign. + operation = { + :operator => 'SET', + :operand => { + :id => campaign_id, + :status => 'PAUSED' + } + } + + # Update campaign. + response = campaign_srv.mutate([operation]) + if response and response[:value] + campaign = response[:value].first + puts "Campaign ID %d was successfully updated, status was set to '%s'." % + [campaign[:id], campaign[:status]] + else + puts 'No campaigns were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of a campaign to update. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + update_campaign(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/basic_operations/update_keyword.rb b/adwords_api/examples/v201502/basic_operations/update_keyword.rb new file mode 100755 index 000000000..9f2a8a916 --- /dev/null +++ b/adwords_api/examples/v201502/basic_operations/update_keyword.rb @@ -0,0 +1,110 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example updates the bid of a keyword. To create a keyword, run +# add_keywords.rb. +# +# Tags: AdGroupCriterionService.mutate + +require 'adwords_api' + +def update_keyword(ad_group_id, criterion_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_criterion_srv = + adwords.service(:AdGroupCriterionService, API_VERSION) + + # Prepare for updating a keyword. + operation = { + :operator => 'SET', + :operand => { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => { + :id => criterion_id + }, + :bidding_strategy_configuration => { + :bids => [ + { + :xsi_type => 'CpcBid', + :bid => {:micro_amount => 1000000} + } + ] + } + } + } + + # Update criterion. + response = ad_group_criterion_srv.mutate([operation]) + if response and response[:value] + ad_group_criterion = response[:value].first + puts "Keyword ID %d was successfully updated, current bids are:" % + ad_group_criterion[:criterion][:id] + ad_group_criterion[:bidding_strategy_configuration][:bids].each do |bid| + puts "\tType: '%s', value: %d" % + [bid[:bids_type], bid[:bid][:micro_amount]] + end + else + puts 'No keywords were updated.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # IDs of a criterion to update and its ad group. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + criterion_id = 'INSERT_CRITERION_ID_HERE'.to_i + update_keyword(ad_group_id, criterion_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/add_campaign_labels.rb b/adwords_api/examples/v201502/campaign_management/add_campaign_labels.rb new file mode 100755 index 000000000..25eae01f9 --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/add_campaign_labels.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds a label to multiple campaigns. +# +# Tags: CampaignService.mutateLabel + +require 'adwords_api' + +def add_campaign_labels(campaign_ids, label_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + operations = campaign_ids.map do |campaign_id| + { + :operator => 'ADD', + :operand => {:campaign_id => campaign_id, :label_id => label_id} + } + end + + response = campaign_srv.mutate_label(operations) + if response and response[:value] + response[:value].each do |campaign_label| + puts "Campaign label for campaign ID %d and label ID %d was added.\n" % + [campaign_label[:campaign_id], campaign_label[:label_id]] + end + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + campaign_id_1 = 'INSERT_CAMPAIGN_ID_1_HERE'.to_i + campaign_id_2 = 'INSERT_CAMPAIGN_ID_2_HERE'.to_i + label_id = 'INSERT_LABEL_ID_HERE'.to_i + add_campaign_labels([campaign_id_1, campaign_id_2], label_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/add_experiment.rb b/adwords_api/examples/v201502/campaign_management/add_experiment.rb new file mode 100755 index 000000000..2ed887928 --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/add_experiment.rb @@ -0,0 +1,166 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example creates an experiment using a query percentage of 10, which +# defines what fraction of auctions should go to the control split (90%) vs. +# the experiment split (10%), then adds experimental bid changes for criteria +# and ad groups. To get campaigns, run get_campaigns.rb. To get ad groups, +# run get_ad_groups.rb. To get keywords, run get_keywords.rb. +# +# Tags: ExperimentService.mutate + +require 'adwords_api' +require 'date' + +def add_experiment(campaign_id, ad_group_id, criterion_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + experiment_srv = adwords.service(:ExperimentService, API_VERSION) + ad_group_srv = adwords.service(:AdGroupService, API_VERSION) + ad_group_criterion_srv = + adwords.service(:AdGroupCriterionService, API_VERSION) + + # Prepare for adding experiment. + operation = { + :operator => 'ADD', + :operand => { + :campaign_id => campaign_id, + :name => "Interplanetary Experiment #%d" % (Time.new.to_f * 1000).to_i, + :query_percentage => 10, + :start_date_time => Time.now.strftime('%Y%m%d %H%M%S'), + # Optional fields: + :status => 'ENABLED', + :end_date_time => + DateTime.parse((Date.today + 30).to_s).strftime('%Y%m%d %H%M%S') + } + } + + # Add experiment. + response = experiment_srv.mutate([operation]) + experiment = response[:value].first + puts "Experiment with name '%s' and ID %d was added." % + [experiment[:name], experiment[:id]] + + experiment_id = experiment[:id] + + # Setup ad group for the experiment. + ad_group = { + :id => ad_group_id, + # Set experiment data for the ad group. + :experiment_data => { + :experiment_id => experiment_id, + :experiment_delta_status => 'MODIFIED', + # Bid multiplier rule that will modify ad group bid for the experiment. + :experiment_bid_multipliers => { + :xsi_type => 'ManualCPCAdGroupExperimentBidMultipliers', + :max_cpc_multiplier => { + :multiplier => 1.5 + } + } + } + } + + # Prepare for updating ad group. + operation = { + :operator => 'SET', + :operand => ad_group + } + + # Update ad group. + response = ad_group_srv.mutate([operation]) + ad_group = response[:value].first + puts "Ad group ID %d was updated for the experiment." % ad_group[:id] + + # Setup ad group criterion for the experiment. + ad_group_criterion = { + :xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => { + :id => criterion_id + }, + # Set experiment data for the criterion. + :experiment_data => { + :xsi_type => 'BiddableAdGroupCriterionExperimentData', + :experiment_id => experiment_id, + :experiment_delta_status => 'MODIFIED', + # Bid multiplier rule that will modify criterion bid for the experiment. + :experiment_bid_multiplier => { + :xsi_type => 'ManualCPCAdGroupCriterionExperimentBidMultiplier', + :max_cpc_multiplier => { + :multiplier => 1.5 + } + } + } + } + + # Prepare for updating ad group criterion. + operation = { + :operator => 'SET', + :operand => ad_group_criterion + } + + # Update criterion. + response = ad_group_criterion_srv.mutate([operation]) + criterion = response[:value].first + puts "Criterion ID %d was successfully updated for the experiment." % + [criterion[:criterion][:id]] + +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # IDs of the required objects. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + criterion_id = 'INSERT_CRITERION_ID_HERE'.to_i + add_experiment(campaign_id, ad_group_id, criterion_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/add_keywords_in_bulk.rb b/adwords_api/examples/v201502/campaign_management/add_keywords_in_bulk.rb new file mode 100755 index 000000000..eec7a0ecd --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/add_keywords_in_bulk.rb @@ -0,0 +1,158 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This code sample illustrates how to add many keywords using asynchronous +# requests and MutateJobService. +# +# Tags: MutateJobService.mutate, MutateJobService.get +# Tags: MutateJobService.getResult + +require 'adwords_api' + +def add_keywords_in_bulk() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + mutate_job_srv = adwords.service(:MutateJobService, API_VERSION) + + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + + # Create AdGroupCriterionOperations to add keywords. + operations = (1..KEYWORD_NUMBER).map do |index| + {:xsi_type => 'AdGroupCriterionOperation', + :operator => 'ADD', + :operand => { + :xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => { + :xsi_type => 'Keyword', + :match_type => 'BROAD', + :text => "mars%d" % index}}} + end + + # You can specify up to 3 job IDs that must successfully complete before + # this job can be processed. + policy = {:prerequisite_job_ids => []} + + # Call mutate to create a new job. + response = mutate_job_srv.mutate(operations, policy) + + raise StandardError, 'Failed to submit a job; aborting.' unless response + + job_id = response[:id] + puts "Job ID %d was successfully created." % job_id + + # Creating selector to retrive hob status and wait for it to complete. + selector = { + :xsi_type => 'BulkMutateJobSelector', + :job_ids => [job_id] + } + + status = nil + + # Poll for job status until it's finished. + puts 'Retrieving job status...' + RETRIES_COUNT.times do |retry_attempt| + job_status_response = mutate_job_srv.get(selector) + if job_status_response + status = job_status_response.first[:status] + case status + when 'FAILED' + raise StandardError, "Job failed with reason: '%s'" % + job_status_response.first[:failure_reason] + when 'COMPLETED' + puts "[%d] Job finished with status '%s'" % [retry_attempt, status] + break + else + puts "[%d] Current status is '%s', waiting %d seconds to retry..." % + [retry_attempt, status, RETRY_INTERVAL] + sleep(RETRY_INTERVAL) + end + else + raise StandardError, 'Error retrieving job status; aborting.' + end + end + + if status == 'COMPLETED' + # Get the job result. Here we re-use the same selector. + result_response = mutate_job_srv.get_result(selector) + + if result_response and result_response[:simple_mutate_result] + results = result_response[:simple_mutate_result][:results] + if results + results.each_with_index do |result, index| + result_message = result.include?(:place_holder) ? + 'FAILED' : 'SUCCEEDED' + puts "Operation [%d] - %s" % [index, result_message] + end + end + errors = result_response[:simple_mutate_result][:errors] + if errors + errors.each do |error| + puts "Error, reason: '%s', trigger: '%s', field path: '%s'" % + [error[:reason], error[:trigger], error[:field_path]] + end + end + else + raise StandardError, 'Error retrieving job results; aborting.' + end + else + puts "Job failed to complete after %d retries." % RETRY_COUNT + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + RETRY_INTERVAL = 30 + RETRIES_COUNT = 30 + KEYWORD_NUMBER = 100 + + begin + add_keywords_in_bulk() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/add_location_extension.rb b/adwords_api/examples/v201502/campaign_management/add_location_extension.rb new file mode 100755 index 000000000..b7d25ad3c --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/add_location_extension.rb @@ -0,0 +1,125 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to create a location ad extension for an existing +# campaign. To create a campaign, run add_campaign.rb. +# +# Tags: GeoLocationService.get, CampaignAdExtensionService.mutate + +require 'adwords_api' + +def add_location_extension(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_ad_ext_srv = + adwords.service(:CampaignAdExtensionService, API_VERSION) + geo_location_srv = adwords.service(:GeoLocationService, API_VERSION) + + selector = { + :addresses => [ + { + :street_address => '1600 Amphitheatre Parkway', + :city_name => 'Mountain View', + :province_code => 'CA', + :postal_code => '94043', + :country_code => 'US' + }, + { + :street_address => "38 Avenue de l'Opéra", + :city_name => 'Paris', + :postal_code => '75002', + :country_code => 'FR' + } + ] + } + + # Get the geo location info for the various addresses and build a list of + # operations with that information. + locations = geo_location_srv.get(selector) + raise StandardError, 'Unable to retrieve geo locations.' if locations.nil? + + operations = locations.map do |location| + {:operator => 'ADD', + :operand => { + :campaign_id => campaign_id, + :status => 'ENABLED', + :ad_extension => { + # The 'xsi_type' field allows you to specify the xsi:type of the + # object being created. It's only necessary when you must provide an + # explicit type that the client library can't infer. + :xsi_type => 'LocationExtension', + :address => location[:address], + :geo_point => location[:geo_point], + :encoded_location => location[:encoded_location], + :source => 'ADWORDS_FRONTEND', + # Optional fields: + #:company_name => 'ACME Inc.', + #:phone_number => '+1-650-253-0000' + } + } + } + end + + # Add location ad extensions. + response = campaign_ad_ext_srv.mutate(operations) + response[:value].each do |extension| + puts "Location extension ID %d and status '%s' successfully added." % + [extension[:ad_extension][:id], extension[:status]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of campaign to add location extension to. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + add_location_extension(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/get_all_disapproved_ads.rb b/adwords_api/examples/v201502/campaign_management/get_all_disapproved_ads.rb new file mode 100755 index 000000000..1b236d509 --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/get_all_disapproved_ads.rb @@ -0,0 +1,101 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all the disapproved ads in a given +# ad group. To add ads, run add_text_ads.rb. +# +# Tags: AdGroupAdService.get + +require 'adwords_api' + +def get_all_disapproved_ads(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Get all the disapproved ads for this campaign. + selector = { + :fields => ['Id', 'AdGroupAdDisapprovalReasons'], + :ordering => [{:field => 'Id', :sort_order => 'ASCENDING'}], + :predicates => [ + {:field => 'AdGroupId', :operator => 'IN', :values => [ad_group_id]}, + { + :field => 'AdGroupCreativeApprovalStatus', + :operator => 'IN', + :values => ['DISAPPROVED'] + } + ] + } + response = ad_group_ad_srv.get(selector) + if response and response[:entries] + puts 'Ad group %d has %d disapproved ad(s).' % + [ad_group_id, response[:total_num_entries]] + response[:entries].each do |ad_group_ad| + puts ("\tAd with ID %d and type '%s' was disapproved for the following " + + 'reasons:') % [ad_group_ad[:ad][:id], ad_group_ad[:ad][:xsi_type]] + if ad_group_ad.include?(:disapproval_reasons) + ad_group_ad[:disapproval_reasons].each {|reason| puts "\t\t%s" % reason} + else + puts "\t\tReason not provided." + end + end + else + puts 'No disapproved ads found for ad group %d.' % ad_group_id + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of an ad group to get disapproved ads for. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + get_all_disapproved_ads(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/get_all_disapproved_ads_with_awql.rb b/adwords_api/examples/v201502/campaign_management/get_all_disapproved_ads_with_awql.rb new file mode 100755 index 000000000..9a9b62ab9 --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/get_all_disapproved_ads_with_awql.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2012, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all the disapproved ads in a given +# ad group with AWQL. To add ads, run add_text_ads.rb. +# +# Tags: AdGroupAdService.query + +require 'adwords_api' + +def get_all_disapproved_ads_with_awql(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Get all the disapproved ads for this campaign. + query = ('SELECT Id, AdGroupAdDisapprovalReasons ' + + 'WHERE AdGroupId = %d AND AdGroupCreativeApprovalStatus = DISAPPROVED ' + + 'ORDER BY Id') % ad_group_id + + response = ad_group_ad_srv.query(query) + if response and response[:entries] + puts 'Ad group ID %d has %d disapproved ad(s).' % + [ad_group_id, response[:total_num_entries]] + response[:entries].each do |ad_group_ad| + puts ("\tAd with ID %d and type '%s' was disapproved for the following " + + 'reasons:') % [ad_group_ad[:ad][:id], ad_group_ad[:ad][:xsi_type]] + if ad_group_ad.include?(:disapproval_reasons) + ad_group_ad[:disapproval_reasons].each {|reason| puts "\t\t%s" % reason} + else + puts "\t\tReason not provided." + end + end + else + puts 'No disapproved ads found for ad group ID %d.' % ad_group_id + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of an ad group to get disapproved ads for. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + get_all_disapproved_ads_with_awql(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts 'HTTP Error: %s' % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts 'Message: %s' % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/get_campaigns_by_label.rb b/adwords_api/examples/v201502/campaign_management/get_campaigns_by_label.rb new file mode 100755 index 000000000..5dbaf12fd --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/get_campaigns_by_label.rb @@ -0,0 +1,112 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets all campaigns with a specific label. To add a label +# to campaigns, run add_campaign_labels.rb. +# +# Tags: CampaignService.get + +require 'adwords_api' + +def get_campaigns_by_label(label_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + # Get all the ad groups for this campaign. + selector = { + :fields => ['Id', 'Name', 'Labels'], + :ordering => [{:field => 'Name', :sort_order => 'ASCENDING'}], + :predicates => [ + { + :field => 'Labels', + # Labels filtering is performed by ID. You can use CONTAINS_ANY to + # select campaigns with any of the label IDs, CONTAINS_ALL to select + # campaigns with all of the label IDs, or CONTAINS_NONE to select + # campaigns with none of the label IDs. + :operator => 'CONTAINS_ANY', + :values => [label_id] + } + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = campaign_srv.get(selector) + if page[:entries] + page[:entries].each do |campaign| + label_string = campaign[:labels].map do |label| + '%d/"%s"' % [label[:id], label[:name]] + end.join(', ') + puts 'Campaign found with name "%s" and ID %d and labels: %s.' % + [campaign[:name], campaign[:id], label_string] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + # Label ID to get campaigns for. + label_id = 'INSERT_LABEL_ID_HERE'.to_i + get_campaigns_by_label(label_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/promote_experiment.rb b/adwords_api/examples/v201502/campaign_management/promote_experiment.rb new file mode 100755 index 000000000..4bcc75cdf --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/promote_experiment.rb @@ -0,0 +1,85 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example promotes an experiment, which permanently applies all the +# experiment changes made to its related ad groups, criteria and ads. +# +# Tags: ExperimentService.mutate + +require 'adwords_api' + +def promote_experiment(experiment_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + experiment_srv = adwords.service(:ExperimentService, API_VERSION) + + # Prepare for updating experiment. + operation = { + :operator => 'SET', + :operand => { + :id => experiment_id, + :status => 'PROMOTED', + } + } + + # Update experiment. + response = experiment_srv.mutate([operation]) + experiment = response[:value].first + puts "Experiment with name '%s' and ID %d was promoted." % + [experiment[:name], experiment[:id]] +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + experiment_id = 'INSERT_EXPERIMENT_ID_HERE'.to_i + promote_experiment(experiment_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/set_ad_parameters.rb b/adwords_api/examples/v201502/campaign_management/set_ad_parameters.rb new file mode 100755 index 000000000..69c594e74 --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/set_ad_parameters.rb @@ -0,0 +1,122 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to create a text ad with ad parameters. To add an +# ad group, run add_ad_group.rb. To add a keyword, run add_keywords.rb. +# +# Tags: AdGroupAdService.mutate, AdParamService.mutate + +require 'adwords_api' + +def set_ad_parameters(ad_group_id, criterion_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + ad_param_srv = adwords.service(:AdParamService, API_VERSION) + + # Prepare for adding ad. + ad_operation = { + :operator => 'ADD', + :operand => { + :ad_group_id => ad_group_id, + :ad => { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'TextAd', + :headline => 'Luxury Mars Cruises', + :description1 => 'Low-gravity fun for {param1:cheap}.', + :description2 => 'Only {param2:a few} seats left!', + :final_urls => ['http://www.example.com'], + :display_url => 'www.example.com' + } + } + } + + # Add ad. + response = ad_group_ad_srv.mutate([ad_operation]) + ad = response[:value].first[:ad] + puts "Text ad ID %d was successfully added." % ad[:id] + + # Prepare for setting ad parameters. + price_operation = { + :operator => 'SET', + :operand => { + :ad_group_id => ad_group_id, + :criterion_id => criterion_id, + :param_index => 1, + :insertion_text => '$100' + } + } + + seat_operation = { + :operator => 'SET', + :operand => { + :ad_group_id => ad_group_id, + :criterion_id => criterion_id, + :param_index => 2, + :insertion_text => '50' + } + } + + # Set ad parameters. + response = ad_param_srv.mutate([price_operation, seat_operation]) + puts 'Parameters were successfully updated.' +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # IDs of ad group and criterion to set ad parameter for. + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + criterion_id = 'INSERT_CRITERION_ID_HERE'.to_i + set_ad_parameters(ad_group_id, criterion_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/set_criterion_bid_modifier.rb b/adwords_api/examples/v201502/campaign_management/set_criterion_bid_modifier.rb new file mode 100755 index 000000000..82cb11276 --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/set_criterion_bid_modifier.rb @@ -0,0 +1,108 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example sets a bid modifier for the mobile platform on given campaign. +# To get campaigns, run get_campaigns.rb. +# +# Tags: CampaignCriterionService.mutate + +require 'adwords_api' + +def set_criterion_bid_modifier(campaign_id, bid_modifier) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_criterion_srv = + adwords.service(:CampaignCriterionService, API_VERSION) + + # Create campaign criterion with modified bid. + campaign_criterion = { + :campaign_id => campaign_id, + # Mobile platform. The ID can be found in the documentation. + # https://developers.google.com/adwords/api/docs/appendix/platforms + :criterion => { + :xsi_type => 'Platform', + :id => 30001 + }, + :bid_modifier => bid_modifier + } + + # Create operation. + operation = { + :operator => 'SET', + :operand => campaign_criterion + } + + response = campaign_criterion_srv.mutate([operation]) + + if response and response[:value] + criteria = response[:value] + criteria.each do |campaign_criterion| + criterion = campaign_criterion[:criterion] + puts ("Campaign criterion with campaign ID %d, criterion ID %d was " + + "updated with bid modifier %f.") % [campaign_criterion[:campaign_id], + criterion[:id], campaign_criterion[:bid_modifier]] + end + else + puts 'No criteria were returned.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # ID of a campaign to use mobile bid modifier for. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + + # Bid modifier to set. + bid_modifier = 1.5 + + set_criterion_bid_modifier(campaign_id, bid_modifier) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/campaign_management/validate_text_ad.rb b/adwords_api/examples/v201502/campaign_management/validate_text_ad.rb new file mode 100755 index 000000000..da92ce94b --- /dev/null +++ b/adwords_api/examples/v201502/campaign_management/validate_text_ad.rb @@ -0,0 +1,114 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example shows how to use the 'validate only' header. No objects will be +# created, but exceptions will still be thrown. +# +# Tags: CampaignService.mutate + +require 'adwords_api' + +def validate_text_ad(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Enable 'validate only' option. + adwords.validate_only = true + + # Prepare for adding text ad. + operation = { + :operator => 'ADD', + :operand => { + :ad_group_id => ad_group_id, + :ad => { + :xsi_type => 'TextAd', + :headline => 'Luxury Cruise to Mars', + :description1 => 'Visit the Red Planet in style.', + :description2 => 'Low-gravity fun for everyone!', + :final_urls => ['http://www.example.com'], + :display_url => 'www.example.com' + } + } + } + + # Validate text ad add operation. + response = ad_group_ad_srv.mutate([operation]) + if response and response[:value] + ad = response[:value].first + puts "Unexpected ad creation! Name '%s', ID %d and status '%s'." % + [campaign[:name], campaign[:id], campaign[:status]] + else + puts 'Text ad validated, no error thrown and no ad created.' + end + + # Now let's check an invalid ad using extra punctuation to trigger an error. + operation[:operand][:ad][:headline] = 'Luxury Cruise to Mars!!!!!' + + # Validate text ad add operation. + begin + response = ad_group_ad_srv.mutate([operation]) + if response and response[:value] + ad = response[:value].first + raise StandardError, ("Unexpected ad creation! Name '%s', ID %d and " + + "status '%s'.") % [campaign[:name], campaign[:id], campaign[:status]] + end + rescue AdwordsApi::Errors::ApiException => e + puts "Validation correctly failed with an exception: %s" % e.class + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + validate_text_ad(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/error_handling/handle_captcha_challenge.rb b/adwords_api/examples/v201502/error_handling/handle_captcha_challenge.rb new file mode 100755 index 000000000..319f8aa00 --- /dev/null +++ b/adwords_api/examples/v201502/error_handling/handle_captcha_challenge.rb @@ -0,0 +1,93 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2012, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to handle 'CAPTCHA required' authorization +# errors. Refer to the best practices guide on how to avoid this error: +# +# http://code.google.com/apis/adwords/docs/guides/bestpractices.html#auth_tokens + +require 'adwords_api' + +def handle_captcha_challenge() + # Initialize token variable. + logintoken = nil + + # This code will repeatedly request authToken from the server until it gets + # a CAPTCHA challenge request. It is here for illustration purposes only + # and should never be used in a real application. + begin + MAX_RETRIES.times do |retry_number| + puts "Running request %d of %d..." % [retry_number + 1, MAX_RETRIES] + # Forcing library to request a new authorization token. + adwords = AdwordsApi::Api.new + auth_token = adwords.authorize() + end + # Still no challenge, make sure ClientLogin authorization is used. + raise StandardError, "Failed to get challenge after %d requests." % + MAX_RETRIES + rescue AdsCommon::Errors::CaptchaRequiredError => e + logintoken = e.captcha_token + end + + puts "CaptchaRequiredError occurred. To recover download the image and type" + + " the CAPTCHA below: %s\n" % e.captcha_url + puts 'Enter code or ENTER to retry: ' + logincaptcha = gets.chomp + + # Initialize variable for extra parameters. + credentials = {} + if logincaptcha and !logincaptcha.empty? + credentials[:logincaptcha] = logincaptcha + credentials[:logintoken] = logintoken + end + + begin + adwords = AdwordsApi::Api.new + auth_token = adwords.authorize(credentials) + puts "Successfully retrieved authToken: " + auth_token + rescue AdsCommon::Errors::CaptchaRequiredError => e + puts 'Invalid CAPTCHA text entered.' + raise e + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + MAX_RETRIES = 500 + + begin + handle_captcha_challenge() + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/error_handling/handle_partial_failures.rb b/adwords_api/examples/v201502/error_handling/handle_partial_failures.rb new file mode 100755 index 000000000..0ff23b6ca --- /dev/null +++ b/adwords_api/examples/v201502/error_handling/handle_partial_failures.rb @@ -0,0 +1,134 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example demonstrates how to handle partial failures. +# +# Tags: AdGroupCriterionService.mutate + +require 'adwords_api' +require 'adwords_api/utils' + +def handle_partial_failures(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_criterion_srv = + adwords.service(:AdGroupCriterionService, API_VERSION) + + # Set partial failures flag. + adwords.partial_failure = true + + # Create keywords. + keyword_text = ['mars cruise', 'inv@lid cruise', 'venus cruise', + 'b(a)d keyword cruise'] + keywords = [] + keyword_text.each do |text| + keyword = { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'Keyword', + :match_type => 'BROAD', + :text => text + } + keywords << keyword + end + + # Create biddable ad group criteria and operations. + operations = [] + keywords.each do |kwd| + operation = { + :operator => 'ADD', + :operand => { + :xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => kwd + } + } + operations << operation + end + + # Add criteria. + response = ad_group_criterion_srv.mutate(operations) + if response and response[:value] + ad_group_criteria = response[:value] + ad_group_criteria.each do |ad_group_criterion| + if ad_group_criterion[:criterion] + puts "Ad group criterion with ad group id " + + "#{ad_group_criterion[:ad_group_id]}, criterion id "+ + "#{ad_group_criterion[:criterion][:id]} and keyword \"" + + "#{ad_group_criterion[:criterion][:text]}\" was added." + end + end + else + puts "No criteria were added." + end + + # Check partial failures. + if response and response[:partial_failure_errors] + response[:partial_failure_errors].each do |error| + operation_index = AdwordsApi::Utils.operation_index_for_error(error) + if operation_index + ad_group_criterion = operations[operation_index][:operand] + puts "Ad group criterion with ad group id " + + "#{ad_group_criterion[:ad_group_id]} and keyword \"" + + "#{ad_group_criterion[:criterion][:text]}\" triggered an error " + + "for the following reason: \"#{error[:error_string]}\"." + end + end + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + handle_partial_failures(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/error_handling/handle_policy_violation_error.rb b/adwords_api/examples/v201502/error_handling/handle_policy_violation_error.rb new file mode 100755 index 000000000..5978148f9 --- /dev/null +++ b/adwords_api/examples/v201502/error_handling/handle_policy_violation_error.rb @@ -0,0 +1,145 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example demonstrates how to handle policy violation errors. To create +# an ad group, run add_ad_group.rb. +# +# Tags: AdGroupAdService.mutate + +require 'adwords_api' +require 'adwords_api/utils' + +def handle_policy_violation_error(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Create text ad. + text_ad_operation = { + :operator => 'ADD', + :operand => { + :ad_group_id => ad_group_id, + :ad => { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'TextAd', + :headline => 'Mars Cruise!!!', + :description1 => 'Visit the Red Planet in style.', + :description2 => 'Low-gravity fun for everyone!', + :final_urls => ['http://www.example.com'], + :display_url => 'www.example.com', + } + } + } + + operations = [text_ad_operation] + + # Validate ad. + begin + # Enable "validate only" for the length of this block + adwords.validate_only do + ad_group_ad_srv.mutate(operations) + end + puts 'Validation successful, no errors returned.' + rescue AdwordsApi::Errors::ApiException => e + e.errors.each do |error| + if error[:xsi_type] == 'PolicyViolationError' + operation_index = AdwordsApi::Utils.operation_index_for_error(error) + operation = operations[operation_index] + puts "Ad with headline '%s' violated %s policy '%s'." % + [operation[:operand][:ad][:headline], + error[:is_exemptable] ? 'exemptable' : 'non-exemptable', + error[:external_policy_name]] + if error[:is_exemptable] + # Add exemption request to the operation. + puts "Adding exemption request for policy name '%s' on text '%s'." % + [error[:key][:policy_name], error[:key][:violating_text]] + unless operation[:exemption_requests] + operation[:exemption_requests] = [] + end + operation[:exemption_requests] << { + :key => error[:key] + } + else + # Remove non-exemptable operation + puts "Removing the operation from the request." + operations.delete(operation) + end + else + # Non-policy error returned, re-throw exception. + raise e + end + end + end + + # Add ads. + if operations.size > 0 + response = ad_group_ad_srv.mutate(operations) + if response and response[:value] + ads = response[:value] + puts "Added #{ads.length} ad(s) to ad group #{ad_group_id}." + ads.each do |ad| + puts " Ad id is #{ad[:ad][:id]}, type is #{ad[:ad][:xsi_type]} and " + + "status is \"#{ad[:status]}\"." + end + else + puts "No ads were added." + end + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + handle_policy_violation_error(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/error_handling/handle_two_factor_authorization_error.rb b/adwords_api/examples/v201502/error_handling/handle_two_factor_authorization_error.rb new file mode 100755 index 000000000..3a3db5dfa --- /dev/null +++ b/adwords_api/examples/v201502/error_handling/handle_two_factor_authorization_error.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to handle 'two factor' authorization error. + +require 'adwords_api' + +def handle_two_factor_authorization_error() + # Set up credentials with an account that has 2Factor enabled. + config = { + :authentication => { + :method => 'ClientLogin', + :email => '2steptester@gmail.com', + :password => 'testaccount', + :user_agent => 'Ruby 2 Factor Sample', + :developer_token => 'qwerty' + }, + :service => { + :environment => 'PRODUCTION' + } + } + adwords = AdwordsApi::Api.new(config) + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + begin + # Forcing library to request authorization token. + auth_token = adwords.authorize() + puts 'Successfully retrieved the token.' + + # Second factor error is one of AuthErrors. + rescue AdsCommon::Errors::AuthError => e + puts "Authorization failed with message:" + puts "\t%s" % e.message + # Checking 'Info' field for particular auth error type. + if e.info and e.info.casecmp('InvalidSecondFactor') == 0 + puts "The user has enabled two factor authentication in this account." + + " Please use OAuth authentication method or have the user generate an" + + " application-specific password to make calls against the AdWords" + + " API. See \n" + + " http://adwordsapi.blogspot.com/2011/02/authentication-changes-with" + + "-2-step.html\n" + + "for more details." + end + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + handle_two_factor_authorization_error() + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/extensions/add_google_my_business_location_extensions.rb b/adwords_api/examples/v201502/extensions/add_google_my_business_location_extensions.rb new file mode 100755 index 000000000..3eb5ad15a --- /dev/null +++ b/adwords_api/examples/v201502/extensions/add_google_my_business_location_extensions.rb @@ -0,0 +1,183 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds a feed that syncs feed items from a Google My Business (GMB) +# account and associates the feed with a customer. +# +# Tags: CustomerFeedService.mutate, FeedService.mutate + +require 'adwords_api' +require 'date' + +def add_gmb_location_extensions(gmb_email_address, gmb_access_token, + business_account_identifier) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + feed_srv = adwords.service(:FeedService, API_VERSION) + customer_feed_srv = adwords.service(:CustomerFeedService, API_VERSION) + + # Create a feed that will sync to the Google My Business account specified + # by gmb_email_address. Do not add FeedAttributes to this object, as AdWords + # will add them automatically because this will be a system generated feed. + gmb_feed = { + :name => "GMB feed #%d" % (Time.new.to_f * 1000).to_i, + :system_feed_generation_data => { + :xsi_type => 'PlacesLocationFeedData', + :o_auth_info => { + :http_method => 'GET', + :http_request_url => 'https://www.googleapis.com/auth/adwords', + :http_authorization_header => "Bearer %s" % gmb_access_token + }, + :email_address => gmb_email_address + }, + # Since this feed's feed items will be managed by AdWords, you must set + # its origin to ADWORDS. + :origin => 'ADWORDS' + } + # Only include the business_account_identifier if it's specified. + # A nil value will cause an invalid request. + unless business_account_identifier.nil? + gmb_feed[:system_feed_generation_data][:business_account_identifier] = + business_account_identifier + end + + gmb_operation = { + :operator => 'ADD', + :operand => gmb_feed + } + + result = feed_srv.mutate([gmb_operation]) + added_feed = result[:value].first + puts "Added GMB feed with ID %d" % added_feed[:id] + + # Add a CustomerFeed that associates the feed with this customer for the + # LOCATION placeholder type. + customer_feed = { + :feed_id => added_feed[:id], + :placeholder_types => PLACEHOLDER_TYPE_LOCATION, + :matching_function => { + :operator => 'IDENTITY', + :lhsOperand => { + :xsi_type => 'ConstantOperand', + :type => 'BOOLEAN', + :boolean_value => true + } + } + } + + customer_feed_operation = { + :xsi_type => 'CustomerFeedOperation', + :operator => 'ADD', + :operand => customer_feed + } + + added_customer_feed = nil + number_of_attempts = 0 + while i < MAX_CUSTOMER_FEED_ADD_ATTEMPTS && !added_customer_feed + number_of_attempts += 1 + begin + result = customer_feed_srv.mutate([customer_feed_operation]) + added_customer_feed = result[:value].first + puts "Attempt #%d to add the CustomerFeed was successful" % + number_of_attempts + rescue + sleep_seconds = 5 * (2 ** number_of_attempts) + puts ("Attempt #%d to add the CustomerFeed was not succeessful. " + + "Waiting %d seconds before trying again.") % + [number_of_attempts, sleep_seconds] + sleep(sleep_seconds) + end + end + + unless added_customer_feed + raise StandardError, ("Could not create the CustomerFeed after %d " + + "attempts. Please retry the CustomerFeed ADD operation later.") % + MAX_CUSTOMER_FEED_ADD_ATTEMPTS + end + + puts "Added CustomerFeed for feed ID %d and placeholder type %d" % + [added_customer_feed[:id], added_customer_feed[:placeholder_types].first] + + # OPTIONAL: Create a CampaignFeed to specify which FeedItems to use at the + # Campaign level. This will be similar to the CampaignFeed in the + # add_site_links example, except you can filter based on the business name + # and category of each FeedItem by using a FeedAttributeOperand in your + # matching function. + + # OPTIONAL: Create an AdGroupFeed for even more fine grained control over + # which feed items are used at the AdGroup level. +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PLACEHOLDER_TYPE_LOCATION = 7 + MAX_CUSTOMER_FEED_ADD_ATTEMPTS = 10 + + begin + # The email address of either an owner or a manager of the GMB account. + gmb_email_address = 'INSERT_GMB_EMAIL_ADDRESS_HERE' + + # To obtain an access token for your GMB account, generate a refresh token + # as you did for AdWords, but make sure you are logged in as the same user + # as gmb_email_address above when you follow the link, then capture + # the generated access token + gmb_access_token = 'INSERT_GMB_OAUTH_ACCESS_TOKEN_HERE' + + # If the gmb_email_address above is for a GMB manager instead of + # the GMB account owner, then set business_account_identifier to the + # +Page ID of a location for which the manager has access. See the + # location extensions guide at + # https://developers.google.com/adwords/api/docs/guides/feed-services-locations + # for details. + business_account_identifier = nil + + add_gmb_location_extensions(gmb_email_address, gmb_access_token, + business_account_identifier) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/extensions/add_site_links.rb b/adwords_api/examples/v201502/extensions/add_site_links.rb new file mode 100755 index 000000000..ca7dc9a10 --- /dev/null +++ b/adwords_api/examples/v201502/extensions/add_site_links.rb @@ -0,0 +1,167 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds a sitelinks feed and associates it with a campaign. +# +# Tags: CampaignExtensionSettingService.mutate + +require 'adwords_api' +require 'date' + +def add_site_links(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + customer_srv = adwords.service(:CustomerService, API_VERSION) + customer = customer_srv.get() + customer_time_zone = customer[:date_time_zone] + + campaign_extension_setting_srv = + adwords.service(:CampaignExtensionSettingService, API_VERSION) + + sitelink_1 = { + :xsi_type => "SitelinkFeedItem", + :sitelink_text => "Store Hours", + :sitelink_url => "http://www.example.com/storehours" + } + + sitelink_2 = { + :xsi_type => "SitelinkFeedItem", + :sitelink_text => "Thanksgiving Specials", + :sitelink_url => "http://www.example.com/thanksgiving", + :start_time => DateTime.new(Date.today.year, 11, 20, 0, 0, 0). + strftime("%Y%m%d %H%M%S ") + customer_time_zone, + :end_time => DateTime.new(Date.today.year, 11, 27, 23, 59, 59). + strftime("%Y%m%d %H%M%S ") + customer_time_zone + } + + sitelink_3 = { + :xsi_type => "SitelinkFeedItem", + :sitelink_text => "Wifi available", + :sitelink_url => "http://www.example.com/mobile/wifi", + :device_preference => {:device_preference => 30001} + } + + sitelink_4 = { + :xsi_type => "SitelinkFeedItem", + :sitelink_text => "Happy hours", + :sitelink_url => "http://www.example.com/happyhours", + :scheduling => { + :feed_item_schedules => [ + { + :day_of_week => 'MONDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + }, + { + :day_of_week => 'TUESDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + }, + { + :day_of_week => 'WEDNESDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + }, + { + :day_of_week => 'THURSDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + }, + { + :day_of_week => 'FRIDAY', + :start_hour => 18, + :start_minute => 'ZERO', + :end_hour => 21, + :end_minute => 'ZERO' + } + ] + } + } + + campaign_extension_setting = { + :campaign_id => campaign_id, + :extension_type => 'SITELINK', + :extension_setting => { + :extensions => [sitelink_1, sitelink_2, sitelink_3, sitelink_4] + } + } + + operation = { + :operand => campaign_extension_setting, + :operator => 'ADD' + } + + response = campaign_extension_setting_srv.mutate([operation]) + if response and response[:value] + new_extension_setting = response[:value].first + puts "Extension setting wiht type = %s was added to campaign ID %d" % + [new_extension_setting[:extension_type][:value], + new_extension_setting[:campaign_id]] + elsif + puts "No extension settings were created." + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # Campaign ID to add site link to. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + add_site_links(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/extensions/add_site_links_using_feeds.rb b/adwords_api/examples/v201502/extensions/add_site_links_using_feeds.rb new file mode 100755 index 000000000..dd254bcce --- /dev/null +++ b/adwords_api/examples/v201502/extensions/add_site_links_using_feeds.rb @@ -0,0 +1,306 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds a sitelinks feed and associates it with a campaign. +# +# Tags: CampaignFeedService.mutate, FeedItemService.mutate +# Tags: FeedMappingService.mutate, FeedService.mutate + +require 'adwords_api' + +def add_site_links(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + feed_srv = adwords.service(:FeedService, API_VERSION) + feed_item_srv = adwords.service(:FeedItemService, API_VERSION) + feed_mapping_srv = adwords.service(:FeedMappingService, API_VERSION) + campaign_feed_srv = adwords.service(:CampaignFeedService, API_VERSION) + + sitelinks_data = {} + + # Create site links feed first. + site_links_feed = { + :name => 'Feed For Site Links', + :attributes => [ + {:type => 'STRING', :name => 'Link Text'}, + {:type => 'URL', :name => 'Link URL'}, + {:type => 'STRING', :name => 'Line 1 Description'}, + {:type => 'STRING', :name => 'Line 2 Description'} + ] + } + + response = feed_srv.mutate([ + {:operator => 'ADD', :operand => site_links_feed} + ]) + if response and response[:value] + feed = response[:value].first + # Attribute of type STRING. + link_text_feed_attribute_id = feed[:attributes][0][:id] + # Attribute of type URL. + final_url_feed_attribute_id = feed[:attributes][1][:id] + # Attribute of type STRING. + line_1_feed_attribute_id = feed[:attributes][2][:id] + #Attribute of type STRING. + line_2_feed_attribute_id = feed[:attributes][3][:id] + puts "Feed with name '%s' and ID %d was added with" % + [feed[:name], feed[:id]] + puts "\tText attribute ID %d and Final URL attribute ID %d " + + "and Line 1 attribute ID %d and Line 2 attribute ID %d." % [ + link_text_feed_attribute_id, + final_url_feed_attribute_id, + line_1_feed_attribute_id, + line_2_feed_attribute_id + ] + + sitelinks_data[:feed_id] = feed[:id] + sitelinks_data[:link_text_feed_id] = link_text_feed_attribute_id + sitelinks_data[:final_url_feed_id] = final_url_feed_attribute_id + sitelinks_data[:line_1_feed_id] = line_1_feed_attribute_id + sitelinks_data[:line_2_feed_id] = line_2_feed_attribute_id + else + raise new StandardError, 'No feeds were added.' + end + + # Create site links feed items. + items_data = [ + { + :text => 'Home', + :url => 'http://www.example.com', + :line_1 => 'Home line 1', + :line_2 => 'Home line 2' + }, + { + :text => 'Stores', + :url => 'http://www.example.com/stores', + :line_1 => 'Stores line 1', + :line_2 => 'Stores line 2' + }, + { + :text => 'On Sale', + :url => 'http://www.example.com/sale', + :line_1 => 'On Sale line 1', + :line_2 => 'On Sale line 2' + }, + { + :text => 'Support', + :url => 'http://www.example.com/support', + :line_1 => 'Support line 1', + :line_2 => 'Support line 2' + }, + { + :text => 'Products', + :url => 'http://www.example.com/products', + :line_1 => 'Products line 1', + :line_2 => 'Products line 2' + }, + { + :text => 'About', + :url => 'http://www.example.com/about', + :line_1 => 'About line 1', + :line_2 => 'About line 2' + } + ] + + feed_items = items_data.map do |item| + { + :feed_id => sitelinks_data[:feed_id], + :attribute_values => [ + { + :feed_attribute_id => sitelinks_data[:link_text_feed_id], + :string_value => item[:text] + }, + { + :feed_attribute_id => sitelinks_data[:final_url_feed_id], + :string_value => item[:url] + }, + { + :feed_attribute_id => sitelinks_data[:line_1_feed_id], + :string_value => item[:line_1] + }, + { + :feed_attribute_id => sitelinks_data[:line_2_feed_id], + :string_value => item[:line_2] + } + ] + } + end + + feed_items_operations = feed_items.map do |item| + {:operator => 'ADD', :operand => item} + end + + response = feed_item_srv.mutate(feed_items_operations) + if response and response[:value] + sitelinks_data[:feed_item_ids] = [] + response[:value].each do |feed_item| + puts 'Feed item with ID %d was added.' % feed_item[:feed_item_id] + sitelinks_data[:feed_item_ids] << feed_item[:feed_item_id] + end + else + raise new StandardError, 'No feed items were added.' + end + + # Create site links feed mapping. + feed_mapping = { + :placeholder_type => PLACEHOLDER_SITELINKS, + :feed_id => sitelinks_data[:feed_id], + :attribute_field_mappings => [ + { + :feed_attribute_id => sitelinks_data[:link_text_feed_id], + :field_id => PLACEHOLDER_FIELD_SITELINK_LINK_TEXT + }, + { + :feed_attribute_id => sitelinks_data[:final_url_feed_id], + :field_id => PLACEHOLDER_FIELD_SITELINK_FINAL_URL + }, + { + :feed_attribute_id => sitelinks_data[:line_1_feed_id], + :field_id => PLACEHOLDER_FIELD_SITELINK_LINE_1_TEXT + }, + { + :feed_attribute_id => sitelinks_data[:line_2_feed_id], + :field_id => PLACEHOLDER_FIELD_SITELINK_LINE_2_TEXT + } + ] + } + + response = feed_mapping_srv.mutate([ + {:operator => 'ADD', :operand => feed_mapping} + ]) + if response and response[:value] + feed_mapping = response[:value].first + puts ('Feed mapping with ID %d and placeholder type %d was saved for feed' + + ' with ID %d.') % [ + feed_mapping[:feed_mapping_id], + feed_mapping[:placeholder_type], + feed_mapping[:feed_id] + ] + else + raise new StandardError, 'No feed mappings were added.' + end + + # Create site links campaign feed. + operands = sitelinks_data[:feed_item_ids].map do |feed_item_id| + { + :xsi_type => 'ConstantOperand', + :type => 'LONG', + :long_value => feed_item_id + } + end + + feed_item_function = { + :operator => 'IN', + :lhs_operand => [ + {:xsi_type => 'RequestContextOperand', :context_type => 'FEED_ITEM_ID'} + ], + :rhs_operand => operands + } + + # Optional: to target to a platform, define a function and 'AND' it with the + # feed item ID link: + platform_function = { + :operator => 'EQUALS', + :lhs_operand => [ + {:xsi_type => 'RequestContextOperand', :context_type => 'DEVICE_PLATFORM'} + ], + :rhs_operand => [ + { + :xsi_type => 'ConstantOperand', + :type => 'STRING', + :string_value => 'Mobile' + } + ] + } + combined_function = { + :operator => 'AND', + :lhs_operand => [ + {:xsi_type => 'FunctionOperand', :value => feed_item_function}, + {:xsi_type => 'FunctionOperand', :value => platform_function} + ] + } + + campaign_feed = { + :feed_id => sitelinks_data[:feed_id], + :campaign_id => campaign_id, + :matching_function => combined_function, + # Specifying placeholder types on the CampaignFeed allows the same feed + # to be used for different placeholders in different Campaigns. + :placeholder_types => [PLACEHOLDER_SITELINKS] + } + + response = campaign_feed_srv.mutate([ + {:operator => 'ADD', :operand => campaign_feed} + ]) + if response and response[:value] + campaign_feed = response[:value].first + puts 'Campaign with ID %d was associated with feed with ID %d.' % + [campaign_feed[:campaign_id], campaign_feed[:feed_id]] + else + raise new StandardError, 'No campaign feeds were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + # See the Placeholder reference page for a list of all the placeholder types + # and fields, see: + # https://developers.google.com/adwords/api/docs/appendix/placeholders + PLACEHOLDER_SITELINKS = 1 + PLACEHOLDER_FIELD_SITELINK_LINK_TEXT = 1 + PLACEHOLDER_FIELD_SITELINK_FINAL_URL = 5 + PLACEHOLDER_FIELD_SITELINK_LINE_1_TEXT = 3 + PLACEHOLDER_FIELD_SITELINK_LINE_2_TEXT = 4 + + begin + # Campaign ID to add site link to. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + add_site_links(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/migration/migrate_to_extension_settings.rb b/adwords_api/examples/v201502/migration/migrate_to_extension_settings.rb new file mode 100755 index 000000000..e41a37010 --- /dev/null +++ b/adwords_api/examples/v201502/migration/migrate_to_extension_settings.rb @@ -0,0 +1,365 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example migrates your feed based sitelinks at campaign level to use +# extension settings. To learn more about extensionsettings, see +# https://developers.google.com/adwords/api/docs/guides/extension-settings. +# To learn more about migrating Feed based extensions to extension settings, +# see +# https://developers.google.com/adwords/api/docs/guides/migrate-to-extension-settings. +# +# Tags: FeedService.query, FeedMappingService.query, FeedItemService.query +# Tags: CampaignExtensionSettingService.mutate, CampaignFeedService.query +# Tags: CampaignFeedService.mutate + +require 'adwords_api' +require 'set' + +def migrate_to_extension_settings() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + # Get all of the feeds for the current user. + feeds = get_feeds(adwords) + + feeds.each do |feed| + # Retrieve all the sitelinks from the current feed. + feed_items = get_site_links_from_feed(adwords, feed) + + # Get all the instances where a sitelink from this feed has been added + # to a campaign. + campaign_feeds = get_campaign_feeds(adwords, feed, PLACEHOLDER_SITELINKS) + + all_feed_items_to_delete = campaign_feeds.map do |campaign_feed| + # Retrieve the sitelinks that have been associated with this campaign. + feed_item_ids = get_feed_item_ids_for_campaign(campaign_feed) + + if feed_item_ids.empty? + puts("Migration skipped for campaign feed with campaign ID %d " + + "and feed ID %d because no mapped feed item IDs were found in " + + "the campaign feed's matching function.") % + [campaign_feed[:campaign_id], campaign_feed[:feed_id]] + next + end + + # Delete the campaign feed that associates the sitelinks from the + # feed to the campaign. + delete_campaign_feed(adwords, campaign_feed) + + # Create extension settings instead of sitelinks. + create_extension_setting(adwords, feed_items, campaign_feed, + feed_item_ids) + + # Mark the sitelinks from the feed for deletion. + feed_item_ids + end.flatten.to_set + + # Delete all the sitelinks from the feed. + delete_old_feed_items(adwords, all_feed_items_to_delete, feed) + end +end + +def get_site_links_from_feed(adwords, feed) + # Retrieve the feed's attribute mapping. + feed_mappings = get_feed_mapping(adwords, feed, PLACEHOLDER_SITELINKS) + + feed_items = {} + + get_feed_items(adwords, feed).each do |feed_item| + site_link_from_feed = {} + + feed_item[:attribute_values].each do |attribute_value| + # Skip this attribute if it hasn't been mapped to a field. + next unless feed_mappings.has_key?( + attribute_value[:feed_attribute_id]) + + feed_mappings[attribute_value[:feed_attribute_id]].each do |field_id| + case field_id + when PLACEHOLDER_FIELD_SITELINK_LINK_TEXT + site_link_from_feed[:text] = attribute_value[:string_value] + when PLACEHOLDER_FIELD_SITELINK_URL + site_link_from_feed[:url] = attribute_value[:string_value] + when PLACEHOLDER_FIELD_FINAL_URLS + site_link_from_feed[:final_urls] = attribute_value[:string_values] + when PLACEHOLDER_FIELD_FINAL_MOBILE_URLS + site_link_from_feed[:final_mobile_urls] = + attribute_value[:string_values] + when PLACEHOLDER_FIELD_TRACKING_URL_TEMPLATE + site_link_from_feed[:tracking_url_template] = + attribute_value[:string_value] + when PLACEHOLDER_FIELD_LINE_2_TEXT + site_link_from_feed[:line2] = attribute_value[:string_value] + when PLACEHOLDER_FIELD_LINE_3_TEXT + site_link_from_feed[:line3] = attribute_value[:string_value] + end + end + end + site_link_from_feed[:scheduling] = feed_item[:scheduling] + + feed_items[feed_item[:feed_item_id]] = site_link_from_feed + end + return feed_items +end + +def get_feed_mapping(adwords, feed, placeholder_type) + feed_mapping_srv = adwords.service(:FeedMappingService, API_VERSION) + query = ("SELECT FeedMappingId, AttributeFieldMappings " + + "WHERE FeedId = %d AND PlaceholderType = %d AND Status = 'ENABLED'") % + [feed[:id], placeholder_type] + + attribute_mappings = {} + offset = 0 + + begin + page_query = (query + " LIMIT %d, %d") % [offset, PAGE_SIZE] + page = feed_mapping_srv.query(page_query) + + unless page[:entries].nil? + # Normally, a feed attribute is mapped only to one field. However, you + # may map it to more than one field if needed. + page[:entries].each do |feed_mapping| + feed_mapping[:attribute_field_mappings].each do |attribute_mapping| + # Since attribute_mappings can have multiple values for each key, + # we set up an array to store the values. + if attribute_mappings.has_key?(attribute_mapping[:feed_attribute_id]) + attribute_mappings[attribute_mapping[:feed_attribute_id]] << + attribute_mapping[:field_id] + else + attribute_mappings[attribute_mapping[:feed_attribute_id]] = + [attribute_mapping[:field_id]] + end + end + end + end + offset += PAGE_SIZE + end while page[:total_num_entries] > offset + + return attribute_mappings +end + +def get_feeds(adwords) + feed_srv = adwords.service(:FeedService, API_VERSION) + query = "SELECT Id, Name, Attributes " + + "WHERE Origin = 'USER' AND FeedStatus = 'ENABLED'" + + feeds = [] + offset = 0 + + begin + page_query = (query + " LIMIT %d, %d") % [offset, PAGE_SIZE] + page = feed_srv.query(page_query) + + unless page[:entries].nil? + feeds += page[:entries] + end + offset += PAGE_SIZE + end while page[:total_num_entries] > offset + + return feeds +end + +def get_feed_items(adwords, feed) + feed_item_srv = adwords.service(:FeedItemService, API_VERSION) + query = ("SELECT FeedItemId, AttributeValues, Scheduling " + + "WHERE Status = 'ENABLED' AND FeedId = %d") % feed[:id] + + feed_items = [] + offset = 0 + + begin + page_query = (query + " LIMIT %d, %d") % [offset, PAGE_SIZE] + page = feed_item_srv.query(page_query) + + unless page[:entries].nil? + feed_items += page[:entries] + end + offset += PAGE_SIZE + end while page[:total_num_entries] > offset + + return feed_items +end + +def delete_old_feed_items(adwords, feed_item_ids, feed) + return if feed_item_ids.empty? + + feed_item_srv = adwords.service(:FeedItemService, API_VERSION) + + operations = feed_item_ids.map do |feed_item_id| + { + :operator => 'REMOVE', + :operand => { + :feed_id => feed[:id], + :feed_item_id => feed_item_id + } + } + end + + feed_item_srv.mutate(operations) +end + +def create_extension_setting(adwords, feed_items, campaign_feed, feed_item_ids) + campaign_extension_setting_srv = adwords.service( + :CampaignExtensionSettingService, API_VERSION) + + extension_feed_items = feed_item_ids.map do |feed_item_id| + site_link_from_feed = feed_items[:feed_item_id] + site_link_feed_item = { + :sitelink_text => site_link_from_feed[:text], + :sitelink_line2 => site_link_from_feed[:line2], + :sitelink_line3 => site_link_from_feed[:line3], + :scheduling => site_link_from_feed[:scheduling] + } + if !site_link_from_feed.final_urls.nil? && + site_link_from_feed[:final_urls].length > 0 + site_link_feed_item[:sitelink_final_urls] = { + :urls => site_link_from_feed[:final_urls] + } + unless site_link_from_feed[:final_mobile_urls].nil? + site_link_feed_item[:sitelink_final_mobile_urls] = { + :urls => site_link_from_feed[:final_mobile_urls] + } + end + site_link_feed_item[:sitelink_tracking_url_template] = + site_link_from_feed[:tracking_url_template] + else + site_link_feed_item[:sitelink_url] = site_link_from_feed[:url] + end + + site_link_feed_item + end + + extension_setting = { + :extensions => extension_feed_items + } + + campaign_extension_setting = { + :campaign_id => campaign_feed[:campaign_id], + :extension_type => 'SITELINK', + :extension_setting => extension_setting + } + + operation = { + :operand => campaign_extension_setting, + :operator => 'ADD' + } + + campaign_extension_setting_srv.mutate([operation]) +end + +def delete_campaign_feed(adwords, campaign_feed) + campaign_feed_srv = adwords.service(:CampaignFeedService, API_VERSION) + + operation = { + :operand => campaign_feed, + :operator => 'REMOVE' + } + + campaign_feed_srv.mutate([operation]) +end + +def get_feed_item_ids_for_campaign(campaign_feed) + feed_item_ids = Set.new + if !campaign_feed[:matching_function][:lhs_operand].empty? && + campaign_feed[:matching_function][:lhs_operand].first[:xsi_type] == + 'RequestContextOperand' + request_context_operand = + campaign_feed[:matching_function][:lhs_operand].first + if request_context_operand[:context_type] == 'FEED_ITEM_ID' && + campaign_feed[:matching_function][:operator] == 'IN' + campaign_feed[:matching_function][:rhs_operand].each do |argument| + if argument[:xsi_type] == 'ConstantOperand' + feed_item_ids.add(argument[:long_value]) + end + end + end + end + return feed_item_ids +end + +def get_campaign_feeds(adwords, feed, placeholder_type) + campaign_feed_srv = adwords.service(:CampaignFeedService, API_VERSION) + query = ("SELECT CampaignId, MatchingFunction, PlaceholderTypes " + + "WHERE Status = 'ENABLED' AND FeedId = %d " + + "AND PlaceholderTypes CONTAINS_ANY [%d]") % [feed[:id], placeholder_type] + + campaign_feeds = [] + offset = 0 + + begin + page_query = (query + " LIMIT %d, %d") % [offset, PAGE_SIZE] + page = campaign_feed_srv.query(page_query) + + unless page[:entries].nil? + campaign_feeds += page[:entries] + end + offset += PAGE_SIZE + end while page[:total_num_entries] > offset + + return campaign_feeds +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + # See the Placeholder reference page for a liste of all placeholder types + # and fields. + # https://developers.google.com/adwords/api/docs/appendix/placeholders + PLACEHOLDER_SITELINKS = 1 + PLACEHOLDER_FIELD_SITELINK_LINK_TEXT = 1 + PLACEHOLDER_FIELD_SITELINK_URL = 2 + PLACEHOLDER_FIELD_LINE_2_TEXT = 3 + PLACEHOLDER_FIELD_LINE_3_TEXT = 4 + PLACEHOLDER_FIELD_FINAL_URLS = 5 + PLACEHOLDER_FIELD_FINAL_MOBILE_URLS = 6 + PLACEHOLDER_FIELD_TRACKING_URL_TEMPLATE = 7 + + begin + migrate_to_extension_settings() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/migration/upgrade_ad_url.rb b/adwords_api/examples/v201502/migration/upgrade_ad_url.rb new file mode 100755 index 000000000..1837c21a0 --- /dev/null +++ b/adwords_api/examples/v201502/migration/upgrade_ad_url.rb @@ -0,0 +1,97 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This code example upgrades an ad to use upgraded URLs. +# +# Tags: AdGroupAdService.get, AdGroupAdService.upgradeUrl + +require 'adwords_api' + +def upgrade_ad_url(ad_group_id, ad_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + selector = { + :fields => ['Id', 'Url'], + :predicates => [ + {:field => 'AdGroupId', :operator => 'EQUALS', :values => [ad_group_id]}, + {:field => 'Id', :operator => 'EQUALS', :values => [ad_id]} + ] + } + + page = ad_group_ad_srv.get(selector) + ad_group_ad = page[:entries][0] if page[:entries] + + raise StandardError, "Ad not found." if ad_group_ad.nil? + + ad_url_upgrade = { + :ad_id => ad_group_ad[:ad][:id], + :final_url => ad_group_ad[:ad][:url] + } + + response = ad_group_ad_srv.upgrade_url([ad_url_upgrade]) + if response + ad_group_ad = response.first + puts "Ad with ID %d and destination url '%s' was upgraded." % + [ad_group_ad[:id], ad_group_ad[:final_urls].first] + else + raise StandardError, 'failed to upgrade ads.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + ad_id = 'INSERT_AD_ID_HERE'.to_i + upgrade_ad_url(ad_group_id, ad_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/misc/create_ad_words_session_without_properties_file.rb b/adwords_api/examples/v201502/misc/create_ad_words_session_without_properties_file.rb new file mode 100755 index 000000000..89ddbf004 --- /dev/null +++ b/adwords_api/examples/v201502/misc/create_ad_words_session_without_properties_file.rb @@ -0,0 +1,94 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example demonstrates how to make AdWords queries without using the +# adwords_api.yml file. + +require 'adwords_api' +require 'date' + +def create_ad_words_session(client_id, client_secret, refresh_token, + developer_token, client_customer_id, user_agent) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new({ + :authentication => { + :method => 'OAuth2', + :oauth2_client_id => client_id, + :oauth2_client_secret => client_secret, + :developer_token => developer_token, + :client_customer_id => client_customer_id + :user_agent => user_agent, + :oauth2_token => { + :refresh_token => refresh_token + } + }, + :service => { + :environment => 'PRODUCTION' + } + }) + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the hash above or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + customer_srv = adwords.service(:CustomerService, API_VERSION) + customer = customer_srv.get() + puts "You are logged in as customer: %d" % customer[:id] +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + client_id = 'INSERT_CLIENT_ID_HERE' + client_secret = 'INSERT_CLIENT_SECRET_HERE' + refresh_token = 'INSERT_REFRESH_TOKEN_HERE' + developer_token = 'INSERT_DEVELOPER_TOKEN_HERE' + client_customer_id = 'INSERT_CLIENT_CUSTOMER_ID_HERE' + user_agent = 'INSERT_USER_AGENT_HERE' + + create_ad_words_session(client_id, client_secret, refresh_token, + developer_token, client_customer_id, user_agent) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/misc/get_all_images_and_videos.rb b/adwords_api/examples/v201502/misc/get_all_images_and_videos.rb new file mode 100755 index 000000000..4350068b9 --- /dev/null +++ b/adwords_api/examples/v201502/misc/get_all_images_and_videos.rb @@ -0,0 +1,108 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all images and videos. To upload an +# image, run upload_image.rb. To upload video, see: +# http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=39454. +# +# Tags: MediaService.get + +require 'adwords_api' + +def get_all_images_and_videos() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + media_srv = adwords.service(:MediaService, API_VERSION) + + # Get all the images and videos. + selector = { + :fields => ['MediaId', 'Height', 'Width', 'MimeType', 'Urls'], + :ordering => [ + {:field => 'MediaId', :sort_order => 'ASCENDING'} + ], + :predicates => [ + {:field => 'Type', :operator => 'IN', :values => ['IMAGE', 'VIDEO']} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = media_srv.get(selector) + if page[:entries] + page[:entries].each do |entry| + full_dimensions = entry[:dimensions]['FULL'] + puts "Entry ID %d with dimensions %dx%d and MIME type is '%s'" % + [entry[:media_id], full_dimensions[:height], + full_dimensions[:width], entry[:mime_type]] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset + + if page.include?(:total_num_entries) + puts "\tFound %d entries." % page[:total_num_entries] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + get_all_images_and_videos() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/misc/setup_oauth2.rb b/adwords_api/examples/v201502/misc/setup_oauth2.rb new file mode 100755 index 000000000..45f5da380 --- /dev/null +++ b/adwords_api/examples/v201502/misc/setup_oauth2.rb @@ -0,0 +1,88 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2013, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to set up OAuth2.0 authentication credentials. +# +# Tags: CampaignService.get + +require 'adwords_api' + +def setup_oauth2() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + # You can call authorize explicitly to obtain the access token. Otherwise, it + # will be invoked automatically on the first API call. + # There are two ways to provide verification code, first one is via the block: + token = adwords.authorize() do |auth_url| + puts "Hit Auth error, please navigate to URL:\n\t%s" % auth_url + print 'log in and type the verification code: ' + verification_code = gets.chomp + verification_code + end + if token + print "\nWould you like to update your adwords_api.yml to save " + + "OAuth2 credentials? (y/N): " + response = gets.chomp + if ('y'.casecmp(response) == 0) or ('yes'.casecmp(response) == 0) + adwords.save_oauth2_token(token) + puts 'OAuth2 token is now saved to ~/adwords_api.yml and will be ' + + 'automatically used by the library.' + end + end + + # Alternatively, you can provide one within the parameters: + # token = adwords.authorize({:oauth2_verification_code => verification_code}) + + # Note, 'token' is a Hash. Its value is not used in this example. If you need + # to be able to access the API in offline mode, with no user present, you + # should persist it to be used in subsequent invocations like this: + # adwords.authorize({:oauth2_token => token}) + + # No exception thrown - we are good to make a request. +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + setup_oauth2() + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/misc/upload_image.rb b/adwords_api/examples/v201502/misc/upload_image.rb new file mode 100755 index 000000000..a52f032b8 --- /dev/null +++ b/adwords_api/examples/v201502/misc/upload_image.rb @@ -0,0 +1,97 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example uploads an image. To get images, run get_all_images.rb. +# +# Tags: MediaService.upload + +require 'adwords_api' +require 'base64' + +def upload_image() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + media_srv = adwords.service(:MediaService, API_VERSION) + + # Create image. + image_url = + 'http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg' + # This utility method retrieves the contents of a URL using all of the config + # options provided to the Api object. + image_data = AdsCommon::Http.get(image_url, adwords.config) + base64_image_data = Base64.encode64(image_data) + image = { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'Image', + :data => base64_image_data, + :type => 'IMAGE' + } + + # Upload image. + response = media_srv.upload([image]) + if response and !response.empty? + ret_image = response.first + full_dimensions = ret_image[:dimensions]['FULL'] + puts ("Image with ID %d, dimensions %dx%d and MIME type '%s' uploaded " + + "successfully.") % [ret_image[:media_id], full_dimensions[:height], + full_dimensions[:width], ret_image[:mime_type]] + else + puts 'No images uploaded.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + upload_image() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/misc/use_oauth2_jwt.rb b/adwords_api/examples/v201502/misc/use_oauth2_jwt.rb new file mode 100755 index 000000000..b6a46a2f1 --- /dev/null +++ b/adwords_api/examples/v201502/misc/use_oauth2_jwt.rb @@ -0,0 +1,97 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2012, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to use OAuth2.0 authentication method with +# Service Account (JWT). For this example to work, your Service Account must be +# a Google Apps for Business Account. +# +# See https://developers.google.com/adwords/api/docs/guides/service-accounts +# for more information. +# +# Tags: CampaignService.get + +require 'adwords_api' + +def use_oauth2_jwt() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + # Option 1: provide key filename as authentication -> oauth2_keyfile in the + # configuration file. No additional code is necessary. + # To provide a file name at runtime, use authorize: + # adwords.authorize({:oauth2_keyfile => key_filename}) + + # Option 2: retrieve key manually and create OpenSSL::PKCS12 object. + # key_filename = 'INSERT_FILENAME_HERE' + # key_secret = 'INSERT_SECRET_HERE' + # key_file_data = File.read(key_filename) + # key = OpenSSL::PKCS12.new(key_file_data, key_secret).key + # adwords.authorize({:oauth2_key => key}) + + # Now you can make API calls. + campaign_srv = adwords.service(:CampaignService, API_VERSION) + + # Get all the campaigns for this account; empty selector. + selector = { + :fields => ['Id', 'Name', 'Status'], + :ordering => [ + {:field => 'Name', :sort_order => 'ASCENDING'} + ] + } + + response = campaign_srv.get(selector) + if response and response[:entries] + campaigns = response[:entries] + campaigns.each do |campaign| + puts "Campaign ID %d, name '%s' and status '%s'" % + [campaign[:id], campaign[:name], campaign[:status]] + end + else + puts 'No campaigns were found.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + use_oauth2_jwt() + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/optimization/estimate_keyword_traffic.rb b/adwords_api/examples/v201502/optimization/estimate_keyword_traffic.rb new file mode 100755 index 000000000..1106f3140 --- /dev/null +++ b/adwords_api/examples/v201502/optimization/estimate_keyword_traffic.rb @@ -0,0 +1,155 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets keyword traffic estimates. +# +# Tags: TrafficEstimatorService.get + +require 'adwords_api' + +def estimate_keyword_traffic() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + traffic_estimator_srv = adwords.service(:TrafficEstimatorService, API_VERSION) + + # Create keywords. Up to 2000 keywords can be passed in a single request. + keywords = [ + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + {:xsi_type => 'Keyword', :text => 'mars cruise', :match_type => 'BROAD'}, + {:xsi_type => 'Keyword', :text => 'cheap cruise', :match_type => 'PHRASE'}, + {:xsi_type => 'Keyword', :text => 'cruise', :match_type => 'EXACT'}, + {:xsi_type => 'Keyword', :text => 'moon walk', :match_type => 'BROAD'} + ] + + # Create a keyword estimate request for each keyword. + keyword_requests = keywords.map {|keyword| {:keyword => keyword}} + + # Negative keywords don't return estimates, but adjust the estimates of the + # other keywords in the hypothetical ad group. To specify a negative keyword + # set the is_negative field to true. + keyword_requests[3][:is_negative] = true + + # Create ad group estimate requests. + ad_group_request = { + :keyword_estimate_requests => keyword_requests, + :max_cpc => { + :micro_amount => 1000000 + } + } + + # Create campaign estimate requests. + campaign_request = { + :ad_group_estimate_requests => [ad_group_request], + # Set targeting criteria. Only locations and languages are supported. + :criteria => [ + {:xsi_type => 'Location', :id => 2840}, # United States + {:xsi_type => 'Language', :id => 1000} # English + ] + } + + # Create selector and retrieve reults. + selector = {:campaign_estimate_requests => [campaign_request]} + response = traffic_estimator_srv.get(selector) + + if response and response[:campaign_estimates] + campaign_estimates = response[:campaign_estimates] + keyword_estimates = + campaign_estimates.first[:ad_group_estimates].first[:keyword_estimates] + keyword_estimates.each_with_index do |estimate, index| + keyword = keyword_requests[index][:keyword] + + # Find the mean of the min and max values. + mean_avg_cpc = calculate_mean( + estimate[:min][:average_cpc][:micro_amount], + estimate[:max][:average_cpc][:micro_amount] + ) + mean_avg_position = calculate_mean( + estimate[:min][:average_position], + estimate[:max][:average_position]) + ) + mean_clicks = calculate_mean( + estimate[:min][:clicks_per_day], + estimate[:max][:clicks_per_day] + ) + mean_total_cost = calculate_mean( + estimate[:min][:total_cost][:micro_amount], + estimate[:max][:total_cost][:micro_amount] + ) + + puts "Results for the keyword with text '%s' and match type %s:" % + [keyword[:text], keyword[:match_type]] + puts "\tEstimated average CPC: %s" % format_mean(mean_avg_cpc) + puts "\tEstimated ad position: %s" % format_mean(mean_avg_position) + puts "\tEstimated daily clicks: %s" % format_mean(mean_clicks) + puts "\tEstimated daily cost: %s" % format_mean(mean_total_cost) + end + else + puts 'No traffic estimates were returned.' + end +end + +def format_mean(mean) + return "nil" if mean.nil? + return "%.2f" % mean +end + +def calculate_mean(min_money, max_money) + return nil if min_money.nil? || max_money.nil? + return (min_money.to_f + max_money.to_f) / 2.0 +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + estimate_keyword_traffic() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/optimization/get_keyword_bid_simulations.rb b/adwords_api/examples/v201502/optimization/get_keyword_bid_simulations.rb new file mode 100755 index 000000000..50619e9a6 --- /dev/null +++ b/adwords_api/examples/v201502/optimization/get_keyword_bid_simulations.rb @@ -0,0 +1,99 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets bid landscapes for a keyword. To get keywords, run +# get_keywords.rb. +# +# Tags: DataService.getCriterionBidLandscape + +require 'adwords_api' + +def get_criterion_bid_landscapes(ad_group_id, keyword_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + data_srv = adwords.service(:DataService, API_VERSION) + + # Get keyword bid landscape. + selector = { + :fields => ['AdGroupId', 'CriterionId', 'StartDate', 'EndDate', 'Bid', + 'LocalClicks', 'LocalCost', 'MarginalCpc', 'LocalImpressions'], + :predicates => [ + {:field => 'AdGroupId', :operator => 'IN', :values => [ad_group_id]}, + {:field => 'CriterionId', :operator => 'IN', :values => [keyword_id]}, + ] + } + page = data_srv.get_criterion_bid_landscape(selector) + if page and page[:entries] + puts "Bid landscape(s) retrieved: %d." % [page[:entries].length] + page[:entries].each do |bid_landscape| + puts ("Retrieved keyword bid landscape with ad group ID %d" + + ", keyword ID %d, start date '%s', end date '%s'" + + ", with landscape points:") % + [bid_landscape[:ad_group_id], bid_landscape[:criterion_id], + bid_landscape[:start_date], bid_landscape[:end_date]] + bid_landscape[:landscape_points].each do |point| + puts "\t%d => clicks: %d, cost: %d, impressions: %d" % + [point[:bid][:micro_amount], point.clicks, + point[:cost][:micro_amount], point[:impressions]] + end + end + else + puts 'No bid landscapes retrieved.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + ad_group_id = 'INSERT_ADGROUP_ID_HERE'.to_i + keyword_id = 'INSERT_KEYWORD_ID_HERE'.to_i + get_criterion_bid_landscapes(ad_group_id, keyword_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/optimization/get_keyword_ideas.rb b/adwords_api/examples/v201502/optimization/get_keyword_ideas.rb new file mode 100755 index 000000000..fe72df230 --- /dev/null +++ b/adwords_api/examples/v201502/optimization/get_keyword_ideas.rb @@ -0,0 +1,130 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example retrieves keywords that are related to a given keyword. +# +# Tags: TargetingIdeaService.get + +require 'adwords_api' + +def get_keyword_ideas(keyword_text) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + targeting_idea_srv = adwords.service(:TargetingIdeaService, API_VERSION) + + # Construct selector object. + selector = { + :idea_type => 'KEYWORD', + :request_type => 'IDEAS', + :requested_attribute_types => + ['KEYWORD_TEXT', 'SEARCH_VOLUME', 'CATEGORY_PRODUCTS_AND_SERVICES'], + :search_parameters => [ + { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'RelatedToQuerySearchParameter', + :queries => [keyword_text] + }, + { + # Language setting (optional). + # The ID can be found in the documentation: + # https://developers.google.com/adwords/api/docs/appendix/languagecodes + # Only one LanguageSearchParameter is allowed per request. + :xsi_type => 'LanguageSearchParameter', + :languages => [{:id => 1000}] + } + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Define initial values. + offset = 0 + results = [] + + begin + # Perform request. + page = targeting_idea_srv.get(selector) + results += page[:entries] if page and page[:entries] + + # Prepare next page request. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end while offset < page[:total_num_entries] + + # Display results. + results.each do |result| + data = result[:data] + keyword = data['KEYWORD_TEXT'][:value] + puts "Found keyword with text '%s'" % keyword + products_and_services = data['CATEGORY_PRODUCTS_AND_SERVICES'][:value] + if products_and_services + puts "\tWith Products and Services categories: [%s]" % + products_and_services.join(', ') + end + average_monthly_searches = data['SEARCH_VOLUME'][:value] + if average_monthly_searches + puts "\tand average monthly search volume: %d" % average_monthly_searches + end + end + puts "Total keywords related to '%s': %d." % [keyword_text, results.length] +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 100 + + begin + keyword_text = 'INSERT_KEYWORD_TEXT_HERE' + get_keyword_ideas(keyword_text) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/remarketing/add_audience.rb b/adwords_api/examples/v201502/remarketing/add_audience.rb new file mode 100755 index 000000000..32de620e1 --- /dev/null +++ b/adwords_api/examples/v201502/remarketing/add_audience.rb @@ -0,0 +1,122 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to create a user list (a.k.a. Audience) and shows +# its associated conversion tracker code snippet. +# +# Tags: UserListService.mutate, ConversionTrackerService.get + +require 'adwords_api' + +def add_audience() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + user_list_srv = adwords.service(:AdwordsUserListService, API_VERSION) + conv_tracker_srv = adwords.service(:ConversionTrackerService, API_VERSION) + + # Prepare for adding remarketing user list. + name = "Mars cruise customers #%d" % (Time.new.to_f * 1000).to_i + operation = { + :operator => 'ADD', + :operand => { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'BasicUserList', + :name => name, + :description => 'A list of mars cruise customers in the last year', + :membership_life_span => 365, + :conversion_types => [{:name => name}], + # Optional field. + :status => 'OPEN' + } + } + + # Add user list. + response = user_list_srv.mutate([operation]) + if response and response[:value] + user_list = response[:value].first + + # Get conversion snippets. + if user_list and user_list[:conversion_types] + conversion_ids = user_list[:conversion_types].map {|type| type[:id]} + selector = { + # We're actually interested in the 'Snippet' field, which is returned + # automatically. + :fields => ['Id'], + :predicates => [ + {:field => 'Id', :operator => 'IN', :values => conversion_ids} + ] + } + conv_tracker_response = conv_tracker_srv.get(selector) + if conv_tracker_response and conv_tracker_response[:entries] + conversions = conv_tracker_response[:entries] + end + end + puts "User list with name '%s' and ID %d was added." % + [user_list[:name], user_list[:id]] + # Display user list associated conversion code snippets. + if conversions + conversions.each do |conversion| + puts "Conversion type code snipped associated to the list:\n\t\t%s\n" % + conversion[:snippet] + end + end + else + puts 'No user lists were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + add_audience() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/remarketing/add_conversion_tracker.rb b/adwords_api/examples/v201502/remarketing/add_conversion_tracker.rb new file mode 100755 index 000000000..86de2815d --- /dev/null +++ b/adwords_api/examples/v201502/remarketing/add_conversion_tracker.rb @@ -0,0 +1,105 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to add an AdWords conversion tracker. +# +# Tags: ConversionTrackerService.mutate + +require 'adwords_api' + +def add_conversion_tracker() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + conv_tracker_srv = adwords.service(:ConversionTrackerService, API_VERSION) + + # Prepare for adding conversion. + operation = { + :operator => 'ADD', + :operand => { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'AdWordsConversionTracker', + :name => "Earth to Mars Cruises Conversion #%d" % + (Time.new.to_f * 1000).to_i, + :category => 'DEFAULT', + :markup_language => 'HTML', + :text_format => 'HIDDEN', + # Optional fields: + :status => 'ENABLED', + :viewthrough_lookback_window => 15, + :viewthrough_conversion_de_dup_search => true, + :is_product_ads_chargeable => true, + :product_ads_chargeable_conversion_window => 15, + :conversion_page_language => 'en', + :background_color => '#0000FF', + :default_revenue_value => 23.41, + :always_use_default_revenue_value = true + } + } + + # Add conversion. + response = conv_tracker_srv.mutate([operation]) + if response and response[:value] + conversion = response[:value].first + puts ("Conversion with ID %d, name '%s', status '%s' and category '%s'" + + " was added.") % [conversion[:id], conversion[:name], + conversion[:status], conversion[:category]] + else + puts 'No conversions were added.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + add_conversion_tracker() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/remarketing/add_rule_based_user_lists.rb b/adwords_api/examples/v201502/remarketing/add_rule_based_user_lists.rb new file mode 100755 index 000000000..f8f56ee94 --- /dev/null +++ b/adwords_api/examples/v201502/remarketing/add_rule_based_user_lists.rb @@ -0,0 +1,171 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds two rule-based remarketing user lists: one with no site +# visit data restrictions, and another that will only include users who visit +# your site in the next six months. +# +# Tags: AdwordsUserListService.mutate + +require 'adwords_api' + +def add_rule_based_user_lists() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + user_list_srv = adwords.service(:AdwordsUserListService, API_VERSION) + + # First rule item group - users who visited the checkout page and had more + # than one item in their shopping cart. + cart_rule_item = { + :xsi_type => 'StringRuleItem', + :key => { + :name => 'ecomm_pagetype' + }, + :op => 'EQUALS', + :value => 'checkout' + } + + cart_size_rule_item = { + :xsi_type => 'NumberRuleItem', + :key => { + :name => 'cartsize' + }, + :op => 'GREATER_THAN', + :value => 1.0 + } + + # Combine the two rule items into a RuleItemGroup so AdWords will AND + # their rules together. + checkout_multiple_item_group = { + :items => [cart_rule_item, cart_size_rule_item] + } + + # Second rule item group - users who checked out after October 31st + # and before January 1st. + start_date_rule_item = { + :xsi_type => 'DateRuleItem', + :key => { + :name => 'checkoutdate' + }, + :op => 'AFTER', + :value => '20141031' + } + + end_date_rule_item = { + :xsi_type => 'DateRuleItem', + :key => { + :name => 'checkoutdate' + }, + :op => 'BEFORE', + :value => '20150101' + } + + # Combine the date rule items into a RuleItemGroup. + checked_out_nov_dec_item_group = { + :items => [start_date_rule_item, end_date_rule_item] + } + + # Combine the rule item groups into a Rule so AdWords will OR the + # groups together. + rule = { + :groups => [checkout_multiple_item_group, checked_out_nov_dec_item_group] + } + + # Create the user list with no restrictions on site visit date. + expression_user_list = { + :xsi_type => 'ExpressionRuleUserList', + :name => 'Users who checked out in November or December OR ' + + 'visited the checkout page with more than one item in their cart', + :description => 'Expression based user list', + :rule => rule + } + + # Create the user list restricted to users who visit your site within the + # specified timeframe. + date_user_list = { + :xsi_type => 'DateSpecificRuleUserList', + :name => 'Date rule user list created at ' + Time.now.to_s, + :description => 'Users who visited the site between 20141031 and ' + + '20150331 and checked out in November or December OR visited the ' + + 'checkout page with more than one item in their cart', + # We re-use the rule here. To avoid side effects, we need a deep copy. + :rule => Marshal.load(Marshal.dump(rule)), + # Set the start and end dates of the user list. + :start_date => '20141031', + :end_date => '20150331' + } + + # Create operations to add the user lists. + operations = [expression_user_list, date_user_list].map do |user_list| + { + :operand => user_list, + :operator => 'ADD' + } + end + + # Submit the operations. + response = user_list_srv.mutate(operations) + + # Display the results. + response[:value].each do |user_list| + puts ("User list added with ID %d, name '%s', status '%s', " + + "list type '%s', accountUserListStatus '%s', description '%s'.") % + [user_list[:id], user_list[:name], user_list[:status], + user_list[:list_type], user_list[:account_user_list_status], + user_list[:description]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + add_rule_based_user_lists() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/reporting/download_criteria_report.rb b/adwords_api/examples/v201502/reporting/download_criteria_report.rb new file mode 100755 index 000000000..b0bbadff6 --- /dev/null +++ b/adwords_api/examples/v201502/reporting/download_criteria_report.rb @@ -0,0 +1,87 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets and downloads an Ad Hoc report from a XML report definition. + +require 'adwords_api' + +def download_criteria_report(file_name) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + # Get report utilities for the version. + report_utils = adwords.report_utils(API_VERSION) + + # Define report definition. You can also pass your own XML text as a string. + report_definition = { + :selector => { + :fields => ['CampaignId', 'AdGroupId', 'Id', 'Criteria', 'CriteriaType', + 'FinalUrls', 'Impressions', 'Clicks', 'Cost'], + # Predicates are optional. + :predicates => { + :field => 'Status', + :operator => 'IN', + :values => ['ENABLED', 'PAUSED'] + } + }, + :report_name => 'Last 7 days CRITERIA_PERFORMANCE_REPORT', + :report_type => 'CRITERIA_PERFORMANCE_REPORT', + :download_format => 'CSV', + :date_range_type => 'LAST_7_DAYS', + # Enable to get rows with zero impressions. + :include_zero_impressions => false + } + + # Download report, using "download_report_as_file" utility method. + # To retrieve the report as return value, use "download_report" method. + report_utils.download_report_as_file(report_definition, file_name) + puts "Report was downloaded to '%s'." % file_name +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # File name to write report to. + file_name = 'INSERT_OUTPUT_FILE_NAME_HERE' + download_criteria_report(file_name) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ReportError => e + puts "Reporting Error: %s" % e.message + end +end diff --git a/adwords_api/examples/v201502/reporting/download_criteria_report_with_awql.rb b/adwords_api/examples/v201502/reporting/download_criteria_report_with_awql.rb new file mode 100755 index 000000000..984ccb2c0 --- /dev/null +++ b/adwords_api/examples/v201502/reporting/download_criteria_report_with_awql.rb @@ -0,0 +1,86 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2012, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets an Ad Hoc report using AdWords Query Language. +# See AWQL guide for more details: +# https://developers.google.com/adwords/api/docs/guides/awql + +require 'date' + +require 'adwords_api' + +def download_criteria_report_with_awql(file_name, report_format) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + # Get report utilities for the version. + report_utils = adwords.report_utils(API_VERSION) + + # Prepare a date range for the last week. Instead you can use 'LAST_7_DAYS'. + date_range = '%s,%s' % [ + DateTime.parse((Date.today - 7).to_s).strftime('%Y%m%d'), + DateTime.parse((Date.today - 1).to_s).strftime('%Y%m%d') + ] + + # Define report definition. You can also pass your own XML text as a string. + report_query = 'SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, ' + + 'Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT ' + + 'WHERE Status IN [ENABLED, PAUSED] ' + + 'DURING %s' % date_range + + # Download report, using "download_report_as_file_with_awql" utility method. + # To retrieve the report as return value, use "download_report_with_awql" + # method. + report_utils.download_report_as_file_with_awql(report_query, report_format, + file_name) + puts "Report was downloaded to '%s'." % file_name +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + # File name to write report to. + file_name = 'INSERT_OUTPUT_FILE_NAME_HERE' + report_format = 'CSV' + download_criteria_report_with_awql(file_name, report_format) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts 'HTTP Error: %s' % e + + # API errors. + rescue AdwordsApi::Errors::ReportError => e + puts 'Reporting Error: %s' % e.message + end +end diff --git a/adwords_api/examples/v201502/reporting/get_report_fields.rb b/adwords_api/examples/v201502/reporting/get_report_fields.rb new file mode 100755 index 000000000..052c3626b --- /dev/null +++ b/adwords_api/examples/v201502/reporting/get_report_fields.rb @@ -0,0 +1,79 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.sgomes@gmail.com (Sérgio Gomes) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets the list of possible report fields for a report type. +# +# Tags: ReportDefinitionService.getReportFields + +require 'adwords_api' + +def get_report_fields(report_type) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + report_def_srv = adwords.service(:ReportDefinitionService, API_VERSION) + + # Get report fields. + fields = report_def_srv.get_report_fields(report_type) + if fields + puts "Report type '%s' contains the following fields:" % report_type + fields.each do |field| + puts ' - %s (%s)' % [field[:field_name], field[:field_type]] + puts ' := [%s]' % field[:enum_values].join(', ') if field[:enum_values] + end + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + report_type = 'INSERT_REPORT_TYPE_HERE' + get_report_fields(report_type) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/reporting/parallel_report_download.rb b/adwords_api/examples/v201502/reporting/parallel_report_download.rb new file mode 100755 index 000000000..a57d3b0c2 --- /dev/null +++ b/adwords_api/examples/v201502/reporting/parallel_report_download.rb @@ -0,0 +1,168 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets and downloads an Ad Hoc report from a XML report definition +# for all accounts in hierarchy in multiple parallel threads. This example +# needs to be run against an MCC account. + +require 'thread' + +require 'adwords_api' +require 'adwords_api/utils' + +def parallel_report_download() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + # Determine list of customer IDs to retrieve report for. For this example we + # will use ManagedCustomerService to get all IDs in hierarchy. + + managed_customer_srv = adwords.service(:ManagedCustomerService, API_VERSION) + + # Get the account hierarchy for this account. + selector = {:fields => ['CustomerId']} + + graph = managed_customer_srv.get(selector) + + # Using queue to balance load between threads. + queue = Queue.new() + + if graph and graph[:entries] and !graph[:entries].empty? + graph[:entries].each {|account| queue << account[:customer_id]} + else + raise StandardError, 'Can not retrieve any customer ID' + end + + # Get report utilities for the version. + report_utils = adwords.report_utils(API_VERSION) + + # Define report definition. You can also pass your own XML text as a string. + report_definition = { + :selector => { + :fields => ['CampaignId', 'AdGroupId', 'Impressions', 'Clicks', 'Cost'], + # Predicates are optional. + :predicates => { + :field => 'AdGroupStatus', + :operator => 'IN', + :values => ['ENABLED', 'PAUSED'] + } + }, + :report_name => 'Custom ADGROUP_PERFORMANCE_REPORT', + :report_type => 'ADGROUP_PERFORMANCE_REPORT', + :download_format => 'CSV', + :date_range_type => 'LAST_7_DAYS', + # Enable to get rows with zero impressions. + :include_zero_impressions => false + } + + puts 'Retrieving %d reports with %d threads:' % [queue.size, THREADS] + + reports_succeeded = Queue.new() + reports_failed = Queue.new() + + # Creating a mutex to control access to the queue. + queue_mutex = Mutex.new + + # Start all the threads. + threads = (1..THREADS).map do |thread_id| + Thread.new(report_definition) do |local_def| + cid = nil + begin + cid = queue_mutex.synchronize {(queue.empty?) ? nil : queue.pop(true)} + if cid + retry_count = 0 + file_name = 'adgroup_%010d.csv' % cid + puts "[%2d/%d] Loading report for customer ID %s into '%s'..." % + [thread_id, retry_count, + AdwordsApi::Utils.format_id(cid), file_name] + begin + report_utils.download_report_as_file(local_def, file_name, cid) + reports_succeeded << {:cid => cid, :file_name => file_name} + rescue AdwordsApi::Errors::ReportError => e + if e.http_code == 500 && retry_count < MAX_RETRIES + retry_count += 1 + sleep(retry_count * BACKOFF_FACTOR) + retry + else + puts(('Report failed for customer ID %s with code %d after %d ' + + 'retries.') % [cid, e.http_code, retry_count + 1]) + reports_failed << + {:cid => cid, :http_code => e.http_code, :message => e.message} + end + end + end + end while (cid != nil) + end + end + + # Wait for all threads to finish. + threads.each { |aThread| aThread.join } + + puts 'Download completed, results:' + puts 'Successful reports:' + while !reports_succeeded.empty? do + result = reports_succeeded.pop() + puts "\tClient ID %s => '%s'" % + [AdwordsApi::Utils.format_id(result[:cid]), result[:file_name]] + end + puts 'Failed reports:' + while !reports_failed.empty? do + result = reports_failed.pop() + puts "\tClient ID %s => Code: %d, Message: '%s'" % + [AdwordsApi::Utils.format_id(result[:cid]), + result[:http_code], result[:message]] + end + puts 'End of results.' +end + +if __FILE__ == $0 + API_VERSION = :v201502 + # Number of parallel threads to spawn. + THREADS = 10 + # Maximum number of retries for 500 errors. + MAX_RETRIES = 5 + # Timeout between retries in seconds. + BACKOFF_FACTOR = 5 + + begin + parallel_report_download() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts 'HTTP Error: %s' % e + + # API errors. + rescue AdwordsApi::Errors::ReportError => e + puts 'Reporting Error: %s' % e.message + end +end diff --git a/adwords_api/examples/v201502/shopping_campaigns/add_product_partition_tree.rb b/adwords_api/examples/v201502/shopping_campaigns/add_product_partition_tree.rb new file mode 100755 index 000000000..5ebdd116c --- /dev/null +++ b/adwords_api/examples/v201502/shopping_campaigns/add_product_partition_tree.rb @@ -0,0 +1,269 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example creates a ProductPartition tree. + +require 'adwords_api' + +class ProductPartitionHelper + attr_reader :operations + + def initialize(ad_group_id) + # The next temporary criterion ID to be used. + # + # When creating our tree we need to specify the parent-child relationships + # between nodes. However, until a criterion has been created on the server + # we do not have a criterionId with which to refer to it. + # + # Instead we can specify temporary IDs that are specific to a single mutate + # request. Once the criteria have been created they are assigned an ID as + # normal and the temporary ID will no longer refer to it. + # + # A valid temporary ID is any negative integer. + @next_id = -1 + + # The set of mutate operations needed to create the current tree. + @operations = [] + + # The ID of the AdGroup that we wish to attach the partition tree to. + @ad_group_id = ad_group_id + end + + def create_subdivision(parent = nil, value = nil) + division = { + :xsi_type => 'ProductPartition', + :partition_type => 'SUBDIVISION', + :id => @next_id + } + + @next_id -= 1 + + unless parent.nil? || value.nil? + division[:parent_criterion_id] = parent[:id] + division[:case_value] = value + end + + ad_group_criterion = { + :xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => @ad_group_id, + :criterion => division + } + + create_add_operation(ad_group_criterion) + + return division + end + + def create_unit(parent = nil, value = nil, bid_amount = nil) + unit = { + :xsi_type => 'ProductPartition', + :partition_type => 'UNIT' + } + + unless parent.nil? || value.nil? + unit[:parent_criterion_id] = parent[:id] + unit[:case_value] = value + end + + ad_group_criterion = {} + if bid_amount && bid_amount > 0 + bidding_strategy_configuration = { + :bids => [{ + :xsi_type => 'CpcBid', + :bid => { + :xsi_type => 'Money', + :micro_amount => bid_amount + } + }] + } + ad_group_criterion[:xsi_type] = 'BiddableAdGroupCriterion' + ad_group_criterion[:bidding_strategy_configuration] = + bidding_strategy_configuration + else + ad_group_criterion[:xsi_type] = 'NegativeAdGroupCriterion' + end + ad_group_criterion[:ad_group_id] = @ad_group_id + ad_group_criterion[:criterion] = unit + + create_add_operation(ad_group_criterion) + + return unit + end + + private + + def create_add_operation(ad_group_criterion) + operation = { + :operator => 'ADD', + :operand => ad_group_criterion + } + + @operations << operation + end +end + +def display_tree(node, children, level = 0) + value = '' + type = '' + + if node[:case_value] + type = node[:case_value][:product_dimension_type] + + value = case type + when 'ProductCanonicalCondition' + node[:case_value][:condition] + when 'ProductBiddingCategory' + "%s(%s)" % [node[:case_value][:type], node[:case_value][:value]] + else + node[:case_value][:value] + end + end + + puts "%sid: %s, type: %s, value: %s" % + [' ' * level, node[:id], type, value] + + children[node[:id]].each do |child_node| + display_tree(child_node, children, level + 1) + end +end + +def add_product_partition_tree(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_criterion_srv = + adwords.service(:AdGroupCriterionService, API_VERSION) + + helper = ProductPartitionHelper.new(ad_group_id) + + root = helper.create_subdivision() + + new_product_canonical_condition = { + :xsi_type => 'ProductCanonicalCondition', + :condition => 'NEW' + } + + used_product_canonical_condition = { + :xsi_type => 'ProductCanonicalCondition', + :condition => 'USED' + } + + other_product_canonical_condition = { + :xsi_type => 'ProductCanonicalCondition' + } + + helper.create_unit(root, new_product_canonical_condition, 200000) + helper.create_unit(root, used_product_canonical_condition, 100000) + other_condition = + helper.create_subdivision(root, other_product_canonical_condition) + + cool_product_brand = { + :xsi_type => 'ProductBrand', + :value => 'CoolBrand' + } + + cheap_product_brand = { + :xsi_type => 'ProductBrand', + :value => 'CheapBrand' + } + + other_product_brand = { + :xsi_type => 'ProductBrand' + } + + helper.create_unit(other_condition, cool_product_brand, 900000) + helper.create_unit(other_condition, cheap_product_brand, 10000) + other_brand = helper.create_subdivision(other_condition, other_product_brand) + + # The value for the bidding category is a fixed ID for the 'Luggage & Bags' + # category. You can retrieve IDs for categories from the ConstantDataService. + # See the get_product_taxonomy example for more details. + luggage_category = { + :xsi_type => 'ProductBiddingCategory', + :type => 'BIDDING_CATEGORY_L1', + :value => '-5914235892932915235' + } + + generic_category = { + :xsi_type => 'ProductBiddingCategory', + :type => 'BIDDING_CATEGORY_L1' + } + + helper.create_unit(other_brand, luggage_category, 750000) + helper.create_unit(other_brand, generic_category, 110000) + + # Make the mutate request. + result = ad_group_criterion_srv.mutate(helper.operations) + + children = {} + root_node = nil + # For each criterion, make an array containing each of its children. + # We always create the parent before the child, so we can rely on that here. + result[:value].each do |criterion| + children[criterion[:criterion][:id]] = [] + + if criterion[:criterion][:parent_criterion_id] + children[criterion[:criterion][:parent_criterion_id]] << + criterion[:criterion] + else + root_node = criterion[:criterion] + end + end + + display_tree(root_node, children) +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i + + add_product_partition_tree(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/shopping_campaigns/add_product_scope.rb b/adwords_api/examples/v201502/shopping_campaigns/add_product_scope.rb new file mode 100755 index 000000000..85ea41fe3 --- /dev/null +++ b/adwords_api/examples/v201502/shopping_campaigns/add_product_scope.rb @@ -0,0 +1,133 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example restricts the products that will be included in the campaign by +# setting a ProductScope. +# +# Tags: CampaignCriterionService.mutate + +require 'adwords_api' + +def add_product_scope(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_criterion_srv = adwords.service(:CampaignCriterionService, + API_VERSION) + + product_scope = { + # This set of dimensions is for demonstration purposes only. It is + # extremely unlikely that you want to include so many dimensions in your + # product scope. + :dimensions => [ + { + :xsi_type => 'ProductBrand', + :value => 'Nexus' + }, + { + :xsi_type => 'ProductCanonicalCondition', + :value => 'NEW' + }, + { + :xsi_type => 'ProductCustomAttribute', + :type => 'CUSTOM_ATTRIBUTE_0', + :value => 'my attribute value' + }, + { + :xsi_type => 'ProductOfferId', + :value => 'book1' + }, + { + :xsi_type => 'ProductType', + :type => 'PRODUCT_TYPE_L1', + :value => 'Media' + }, + { + :xsi_type => 'ProductType', + :type => 'PRODUCT_TYPE_L2', + :value => 'Books' + }, + # The value for the bidding category is a fixed ID for the + # 'Luggage & Bags' category. You can retrieve IDs for categories from + # the ConstantDataService. See the 'get_product_category_taxonomy' + # example for more details. + { + :xsi_type => 'ProductBiddingCategory', + :type => 'BIDDING_CATEGORY_L1', + :value => '-5914235892932915235', + } + ] + } + + campaign_criterion = { + :campaign_id => campaign_id, + :product_scope => product_scope + } + + campaign_criterion_operation = { + :operator => 'ADD', + :operand => campaign_criterion + } + + # Make the mutate request. + result = campaign_criterion_srv.mutate([campaign_criterion_operation]) + + campaign_criterion = result[:value].first + puts "Created a ProductScope criterion with ID %d." % + [campaign_criterion[:criterion][:id]] +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + + add_product_scope(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/shopping_campaigns/add_shopping_campaign.rb b/adwords_api/examples/v201502/shopping_campaigns/add_shopping_campaign.rb new file mode 100755 index 000000000..64103293d --- /dev/null +++ b/adwords_api/examples/v201502/shopping_campaigns/add_shopping_campaign.rb @@ -0,0 +1,133 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds a Shopping campaign. +# +# Tags: CampaignService.mutate, AdGroupService.mutate, AdGroupAdService.mutate + +require 'adwords_api' +require 'date' + +def add_shopping_campaign(budget_id, merchant_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_srv = adwords.service(:CampaignService, API_VERSION) + ad_group_srv = adwords.service(:AdGroupService, API_VERSION) + ad_group_ad_srv = adwords.service(:AdGroupAdService, API_VERSION) + + # Create campaign. + campaign = { + :name => "Shopping campaign #%d" % (Time.new.to_f * 1000).to_i, + # The advertising_channel_type is what makes this a Shopping campaign. + :advertising_channel_type => 'SHOPPING', + :budget => {:budget_id => budget_id}, + :bidding_strategy_configuration => { + :bidding_strategy_type => 'MANUAL_CPC' + }, + :settings => [ + { + :xsi_type => 'ShoppingSetting', + :sales_country => 'US', + :campaign_priority => 0, + :merchant_id => merchant_id, + # Set to "true" to enable Local Inventory Ads in your campaign. + :enable_local => true + } + ] + } + campaign_operation = {:operator => 'ADD', :operand => campaign} + + # Make the mutate request. + result = campaign_srv.mutate([campaign_operation]) + + # Print the result. + campaign = result[:value].first + puts "Campaign with name '%s' and ID %d was added." % + [campaign[:name], campaign[:id]] + + # Create ad group. + ad_group = { + :campaign_id => campaign[:id], + :name => 'Ad Group #%d' % (Time.new.to_f * 1000).to_i + } + ad_group_operation = {:operator => 'ADD', :operand => ad_group} + + # Make the mutate request. + result = ad_group_srv.mutate([ad_group_operation]) + + # Print the result. + ad_group = result[:value].first + puts "Ad group with name '%s' and ID %d was added." % + [ad_group[:name], ad_group[:id]] + + # Create product ad. + ad_group_ad = { + :ad_group_id => ad_group[:id], + :ad => {:xsi_type => 'ProductAd'} + } + ad_group_operation = {:operator => 'ADD', :operand => ad_group_ad} + + # Make the mutate request. + result = ad_group_ad_srv.mutate([ad_group_operation]) + + # Print the result. + ad_group_ad = result[:value].first + puts "Product ad with ID %d was added." % [ad_group_ad[:id]] +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + budget_id = 'INSERT_BUDGET_ID_HERE'.to_i + merchant_id = 'INSERT_MERCHANT_ID_HERE'.to_i + + add_shopping_campaign(budget_id, merchant_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/shopping_campaigns/get_product_category_taxonomy.rb b/adwords_api/examples/v201502/shopping_campaigns/get_product_category_taxonomy.rb new file mode 100755 index 000000000..1617009dc --- /dev/null +++ b/adwords_api/examples/v201502/shopping_campaigns/get_product_category_taxonomy.rb @@ -0,0 +1,117 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.mcloonan@gmail.com (Michael Cloonan) +# +# Copyright:: Copyright 2014, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example fetches the set of valid ProductBiddingCategories. +# +# Tags: ConstantDataService.getProductBiddingCategoryData + +require 'adwords_api' + +def display_categories(categories, prefix='') + categories.each do |category| + puts "%s%s [%s]" % [prefix, category[:name], category[:id]] + if category[:children] + display_categories(category[:children], + "%s%s > " % [prefix, category[:name]]) + end + end +end + +def get_product_category_taxonomy() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + constant_data_srv = adwords.service(:ConstantDataService, API_VERSION) + + selector = { + :predicates => {:field => 'Country', :operator => 'IN', :values => ['US']} + } + + results = constant_data_srv.get_product_bidding_category_data(selector) + + bidding_categories = {} + root_categories = [] + + result[:value].each do |product_bidding_category| + id = product_bidding_category[:dimension_value][:value] + parent_id = nil + name = product_bidding_category[:display_value].first[:value] + + if product_bidding_category[:parent_dimension_value] + parent_id = product_bidding_category[:parent_dimension_value][:value] + end + + bidding_categories[id] ||= {} + + category = bidding_categories[id] + + if parent_id + bidding_categories[parent_id] ||= {} + + parent = bidding_categories[parent_id] + + parent[:children] ||= [] + parent[:children] << category + else + root_categories << category + end + + category[:id] = id + category[:name] = name + end + + display_categories(root_categories) +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + get_product_category_taxonomy() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/targeting/add_campaign_targeting_criteria.rb b/adwords_api/examples/v201502/targeting/add_campaign_targeting_criteria.rb new file mode 100755 index 000000000..db4790ff3 --- /dev/null +++ b/adwords_api/examples/v201502/targeting/add_campaign_targeting_criteria.rb @@ -0,0 +1,173 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds various types of targeting criteria to a campaign. To get +# campaigns list, run get_campaigns.rb. +# +# Tags: CampaignCriterionService.mutate + +require 'adwords_api' + +def add_campaign_targeting_criteria(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_criterion_srv = + adwords.service(:CampaignCriterionService, API_VERSION) + + # Create campaign criteria. + campaign_criteria = [ + # Location criteria. The IDs can be found in the documentation or retrieved + # with the LocationCriterionService. + {:xsi_type => 'Location', :id => 21137}, # California, USA + {:xsi_type => 'Location', :id => 2484}, # Mexico + # Language criteria. The IDs can be found in the documentation or retrieved + # with the ConstantDataService. + {:xsi_type => 'Language', :id => 1000}, # English + {:xsi_type => 'Language', :id => 1003}, # Spanish + # Location Groups criteria. These represent targeting by household income + # or places of interest. The IDs can be found in the documentation or + # retrieved with the LocationCriterionService. + { + :xsi_type => 'LocationGroups', + :matching_function => { + :operator => 'AND', + :lhs_operand => [{ + :xsi_type => 'IncomeOperand', + # Tiers are numbered 1-10, and represent 10% segments of earners. + # For example, TIER_1 is the top 10%, TIER_2 is the 80-90%, etc. + # Tiers 6 through 10 are grouped into TIER_6_TO_10. + :tier => 'TIER_3' + }], + :rhs_operand => [{ + :xsi_type => 'GeoTargetOperand', + :locations => [1015116] # Miami, FL + }] + } + }, + { + :xsi_type => 'LocationGroups', + :matching_function => { + :operator => 'AND', + :lhs_operand => [{ + :xsi_type => 'PlacesOfInterestOperand', + :category => 'DOWNTOWN' # Other valid options: AIRPORT, UNIVERSITY. + }], + :rhs_operand => [{ + :xsi_type => 'GeoTargetOperand', + :locations => [1015116] # Miami, FL + }] + } + }, + # Distance targeting. Area of 10 miles around targets above. + { + :xsi_type => 'LocationGroups', + :matching_function => { + :operator => 'IDENTITY', + :lhs_operand => [{ + :xsi_type => 'LocationExtensionOperand', + :radius => { + :xsi_type => 'ConstantOperand', + :type => 'DOUBLE', + :unit => 'MILES', + :double_value => 10 + } + }] + } + } + ] + + # Create operations. + operations = campaign_criteria.map do |criterion| + {:operator => 'ADD', + :operand => { + :campaign_id => campaign_id, + :criterion => criterion} + } + end + + # Add negative campaign criterion. + operations << { + :operator => 'ADD', + :operand => { + # The 'xsi_type' field allows you to specify the xsi:type of the object + # being created. It's only necessary when you must provide an explicit + # type that the client library can't infer. + :xsi_type => 'NegativeCampaignCriterion', + :campaign_id => campaign_id, + :criterion => { + :xsi_type => 'Keyword', + :text => 'jupiter cruise', + :match_type => 'BROAD' + } + } + } + + response = campaign_criterion_srv.mutate(operations) + + if response and response[:value] + criteria = response[:value] + criteria.each do |campaign_criterion| + criterion = campaign_criterion[:criterion] + puts ("Campaign criterion with campaign ID %d, criterion ID %d and " + + "type '%s' was added.") % [campaign_criterion[:campaign_id], + criterion[:id], criterion[:criterion_type]] + end + else + puts 'No criteria were returned.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + campaign_id = 'INSERT_CAMPAIGN_ID_HERE' + add_campaign_targeting_criteria(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/targeting/add_demographic_targeting_criteria.rb b/adwords_api/examples/v201502/targeting/add_demographic_targeting_criteria.rb new file mode 100755 index 000000000..f409eb884 --- /dev/null +++ b/adwords_api/examples/v201502/targeting/add_demographic_targeting_criteria.rb @@ -0,0 +1,116 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2012, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example adds demographic criteria to an ad group. To get ad groups list, +# run get_ad_groups.rb. +# +# Tags: AdGroupCriterionService.mutate + +require 'adwords_api' + +def add_demographic_targeting_criteria(ad_group_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + ad_group_criterion_srv = + adwords.service(:AdGroupCriterionService, API_VERSION) + + # Create ad group criteria. + ad_group_criteria = [ + # Targeting criterion. + { + :xsi_type => 'BiddableAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => { + :xsi_type => 'Gender', + # See system codes section for IDs: + # https://developers.google.com/adwords/api/docs/appendix/genders + :id => 11 + } + }, + # Exclusion criterion. + { + :xsi_type => 'NegativeAdGroupCriterion', + :ad_group_id => ad_group_id, + :criterion => { + :xsi_type => 'AgeRange', + # See system codes section for IDs: + # https://developers.google.com/adwords/api/docs/appendix/ages + :id => 503999 + } + } + ] + + # Create operations. + operations = ad_group_criteria.map do |criterion| + {:operator => 'ADD', :operand => criterion} + end + + response = ad_group_criterion_srv.mutate(operations) + + if response and response[:value] + criteria = response[:value] + criteria.each do |ad_group_criterion| + criterion = ad_group_criterion[:criterion] + puts ("Ad group criterion with ad group ID %d, criterion ID %d and " + + "type '%s' was added.") % [ad_group_criterion[:ad_group_id], + criterion[:id], criterion[:criterion_type]] + end + else + puts 'No criteria were returned.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + ad_group_id = 'INSERT_AD_GROUP_ID_HERE' + add_demographic_targeting_criteria(ad_group_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/targeting/get_campaign_targeting_criteria.rb b/adwords_api/examples/v201502/targeting/get_campaign_targeting_criteria.rb new file mode 100755 index 000000000..0fa08d5e4 --- /dev/null +++ b/adwords_api/examples/v201502/targeting/get_campaign_targeting_criteria.rb @@ -0,0 +1,110 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all the campaign targets. To set +# campaign targets, run add_campaign_targeting_criteria.rb. +# +# Tags: CampaignCriterionService.get + +require 'adwords_api' + +def get_campaign_targeting_criteria(campaign_id) + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + campaign_criterion_srv = + adwords.service(:CampaignCriterionService, API_VERSION) + + # Selector to get all the targeting for this campaign. + selector = { + :fields => ['Id', 'CriteriaType', 'KeywordText'], + :predicates => [ + {:field => 'CampaignId', :operator => 'EQUALS', :values => [campaign_id]} + ], + :paging => { + :start_index => 0, + :number_results => PAGE_SIZE + } + } + + # Set initial values. + offset, page = 0, {} + + begin + page = campaign_criterion_srv.get(selector) + if page[:entries] + page[:entries].each do |typed_criterion| + negative = typed_criterion[:xsi_type] == 'NegativeCampaignCriterion' ? + ' (negative)' : '' + criterion = typed_criterion[:criterion] + puts ("Campaign criterion%s with ID %d, type '%s' and text '%s'" + + " was found.") % + [negative, criterion[:id], criterion[:type], criterion[:text]] + end + # Increment values to request the next page. + offset += PAGE_SIZE + selector[:paging][:start_index] = offset + end + end while page[:total_num_entries] > offset + + if page.include?(:total_num_entries) + puts "\tCampaign ID %d has %d criteria." % + [campaign_id, page[:total_num_entries]] + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + PAGE_SIZE = 500 + + begin + # Specify campaign ID to get targeting for. + campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i + get_campaign_targeting_criteria(campaign_id) + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/targeting/get_targetable_languages_and_carriers.rb b/adwords_api/examples/v201502/targeting/get_targetable_languages_and_carriers.rb new file mode 100755 index 000000000..b4ec92775 --- /dev/null +++ b/adwords_api/examples/v201502/targeting/get_targetable_languages_and_carriers.rb @@ -0,0 +1,94 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example illustrates how to retrieve all languages and carriers available +# for targeting. +# +# Tags: ConstantDataService.getLanguageCriterion +# Tags: ConstantDataService.getCarrierCriterion + +require 'adwords_api' + +def get_targetable_languages_and_carriers() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + constant_data_srv = adwords.service(:ConstantDataService, API_VERSION) + + # Get all languages from ConstantDataService. + languages = constant_data_srv.get_language_criterion() + + if languages + languages.each do |language| + puts "Language name is '%s', ID is %d and code is '%s'." % + [language[:name], language[:id], language[:code]] + end + else + puts 'No languages were found.' + end + + # Get all carriers from ConstantDataService. + carriers = constant_data_srv.get_carrier_criterion() + + if carriers + carriers.each do |carrier| + puts "Carrier name is '%s', ID is %d and country code is '%s'." % + [carrier[:name], carrier[:id], carrier[:country_code]] + end + else + puts 'No carriers were retrieved.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + get_targetable_languages_and_carriers() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/examples/v201502/targeting/lookup_location.rb b/adwords_api/examples/v201502/targeting/lookup_location.rb new file mode 100755 index 000000000..da12fe653 --- /dev/null +++ b/adwords_api/examples/v201502/targeting/lookup_location.rb @@ -0,0 +1,112 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Author:: api.dklimkin@gmail.com (Danial Klimkin) +# +# Copyright:: Copyright 2011, Google Inc. All Rights Reserved. +# +# License:: Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This example gets location criteria by name. +# +# Tags: LocationCriterionService.get + +require 'adwords_api' + +def lookup_location() + # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml + # when called without parameters. + adwords = AdwordsApi::Api.new + + # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in + # the configuration file or provide your own logger: + # adwords.logger = Logger.new('adwords_xml.log') + + location_criterion_srv = + adwords.service(:LocationCriterionService, API_VERSION) + + # List of locations to look up. + location_names = ['Paris', 'Quebec', 'Spain', 'Deutschland'] + # Locale to retrieve names in. + locale = 'en' + + # Get the criteria by names. + selector = { + :fields => ['Id', 'LocationName', 'CanonicalName', 'DisplayType', + 'ParentLocations', 'Reach', 'TargetingStatus'], + :predicates => [ + # Location names must match exactly, only EQUALS and IN are supported. + {:field => 'LocationName', + :operator => 'IN', + :values => location_names}, + # Set the locale of the returned location names. + {:field => 'Locale', :operator => 'EQUALS', :values => [locale]} + ] + } + criteria = location_criterion_srv.get(selector) + + if criteria + criteria.each do |criterion| + # Extract all parent location names as one comma-separated string. + parent_location = if criterion[:location][:parent_locations] and + !criterion[:location][:parent_locations].empty? + locations_array = criterion[:location][:parent_locations].map do |loc| + loc[:location_name] + end + locations_array.join(', ') + else + 'N/A' + end + puts ("The search term '%s' returned the location '%s' of type '%s' " + + "with ID %d, parent locations '%s' and reach %d (%s)") % + [criterion[:search_term], criterion[:location][:location_name], + criterion[:location][:criterion_type], criterion[:location][:id], + parent_location, criterion[:reach], + criterion[:location][:targeting_status]] + end + else + puts 'No criteria were returned.' + end +end + +if __FILE__ == $0 + API_VERSION = :v201502 + + begin + lookup_location() + + # Authorization error. + rescue AdsCommon::Errors::OAuth2VerificationRequired => e + puts "Authorization credentials are not valid. Edit adwords_api.yml for " + + "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " + + "to retrieve and store OAuth2 tokens." + puts "See this wiki page for more details:\n\n " + + 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2' + + # HTTP errors. + rescue AdsCommon::Errors::HttpError => e + puts "HTTP Error: %s" % e + + # API errors. + rescue AdwordsApi::Errors::ApiException => e + puts "Message: %s" % e.message + puts 'Errors:' + e.errors.each_with_index do |error, index| + puts "\tError [%d]:" % (index + 1) + error.each do |field, value| + puts "\t\t%s: %s" % [field, value] + end + end + end +end diff --git a/adwords_api/google-adwords-api.gemspec b/adwords_api/google-adwords-api.gemspec index 7b6a3eef0..300c39570 100755 --- a/adwords_api/google-adwords-api.gemspec +++ b/adwords_api/google-adwords-api.gemspec @@ -38,5 +38,5 @@ Gem::Specification.new do |s| s.files = Dir.glob('{lib,test}/**/*') + Dir.glob('examples/v*/**/*') + %w(COPYING README.md ChangeLog adwords_api.yml) s.test_files = ['test/suite_unittests.rb'] - s.add_dependency('google-ads-common', '~> 0.9.6') + s.add_dependency('google-ads-common', '~> 0.9.8') end diff --git a/adwords_api/lib/adwords_api/api_config.rb b/adwords_api/lib/adwords_api/api_config.rb index 4b4c4948a..bfedc50ec 100755 --- a/adwords_api/lib/adwords_api/api_config.rb +++ b/adwords_api/lib/adwords_api/api_config.rb @@ -35,9 +35,9 @@ class << ApiConfig end # Set defaults - DEFAULT_VERSION = :v201409 + DEFAULT_VERSION = :v201502 DEFAULT_ENVIRONMENT = :PRODUCTION - LATEST_VERSION = :v201409 + LATEST_VERSION = :v201502 # Set other constants API_NAME = 'AdwordsApi' @@ -86,9 +86,11 @@ class << ApiConfig :TrafficEstimatorService ], :v201409 => [ + :AdCustomizerFeedService, :AdGroupAdService, :AdGroupBidModifierService, :AdGroupCriterionService, + :AdGroupExtensionSettingService, :AdGroupFeedService, :AdGroupService, :AdParamService, @@ -98,11 +100,56 @@ class << ApiConfig :BudgetService, :CampaignAdExtensionService, :CampaignCriterionService, + :CampaignExtensionSettingService, :CampaignFeedService, :CampaignService, :CampaignSharedSetService, :ConstantDataService, :ConversionTrackerService, + :CustomerExtensionSettingService, + :CustomerFeedService, + :CustomerService, + :CustomerSyncService, + :DataService, + :ExperimentService, + :FeedItemService, + :FeedMappingService, + :FeedService, + :GeoLocationService, + :LabelService, + :LocationCriterionService, + :ManagedCustomerService, + :MediaService, + :MutateJobService, + :OfflineConversionFeedService, + :ReportDefinitionService, + :SharedCriterionService, + :SharedSetService, + :TargetingIdeaService, + :TrafficEstimatorService + ], + :v201502 => [ + :AccountLabelService, + :AdCustomizerFeedService, + :AdGroupAdService, + :AdGroupBidModifierService, + :AdGroupCriterionService, + :AdGroupExtensionSettingService, + :AdGroupFeedService, + :AdGroupService, + :AdParamService, + :AdwordsUserListService, + :BiddingStrategyService, + :BudgetOrderService, + :BudgetService, + :CampaignCriterionService, + :CampaignExtensionSettingService, + :CampaignFeedService, + :CampaignService, + :CampaignSharedSetService, + :ConstantDataService, + :ConversionTrackerService, + :CustomerExtensionSettingService, :CustomerFeedService, :CustomerService, :CustomerSyncService, @@ -132,7 +179,8 @@ class << ApiConfig :oauth_scope => 'https://www.googleapis.com/auth/adwords', :header_ns => 'https://adwords.google.com/api/adwords/cm/', :v201406 => 'https://adwords.google.com/api/adwords/', - :v201409 => 'https://adwords.google.com/api/adwords/' + :v201409 => 'https://adwords.google.com/api/adwords/', + :v201502 => 'https://adwords.google.com/api/adwords/' } } @@ -179,20 +227,24 @@ class << ApiConfig [:v201406, :AdwordsUserListService] => 'rm/', [:v201406, :LabelService] => 'cm/', # v201409 + [:v201409, :AdCustomizerFeedService] => 'cm/', [:v201409, :AdGroupAdService] => 'cm/', [:v201409, :AdGroupBidModifierService] => 'cm/', [:v201409, :AdGroupCriterionService] => 'cm/', + [:v201409, :AdGroupExtensionSettingService] => 'cm/', [:v201409, :AdGroupFeedService] => 'cm/', [:v201409, :AdGroupService] => 'cm/', [:v201409, :AdParamService] => 'cm/', [:v201409, :BudgetOrderService] => 'billing/', [:v201409, :CampaignAdExtensionService] => 'cm/', [:v201409, :CampaignCriterionService] => 'cm/', + [:v201409, :CampaignExtensionSettingService] => 'cm/', [:v201409, :CampaignFeedService] => 'cm/', [:v201409, :CampaignService] => 'cm/', [:v201409, :CampaignSharedSetService] => 'cm/', [:v201409, :ConstantDataService] => 'cm/', [:v201409, :ConversionTrackerService] => 'cm/', + [:v201409, :CustomerExtensionSettingService] => 'cm/', [:v201409, :CustomerSyncService] => 'ch/', [:v201409, :DataService] => 'cm/', [:v201409, :ExperimentService] => 'cm/', @@ -215,7 +267,49 @@ class << ApiConfig [:v201409, :BudgetService] => 'cm/', [:v201409, :BiddingStrategyService] => 'cm/', [:v201409, :AdwordsUserListService] => 'rm/', - [:v201409, :LabelService] => 'cm/' + [:v201409, :LabelService] => 'cm/', + # v201502 + [:v201502, :AccountLabelService] => 'mcm/', + [:v201502, :AdCustomizerFeedService] => 'cm/', + [:v201502, :AdGroupAdService] => 'cm/', + [:v201502, :AdGroupBidModifierService] => 'cm/', + [:v201502, :AdGroupCriterionService] => 'cm/', + [:v201502, :AdGroupExtensionSettingService] => 'cm/', + [:v201502, :AdGroupFeedService] => 'cm/', + [:v201502, :AdGroupService] => 'cm/', + [:v201502, :AdParamService] => 'cm/', + [:v201502, :BudgetOrderService] => 'billing/', + [:v201502, :CampaignCriterionService] => 'cm/', + [:v201502, :CampaignExtensionSettingService] => 'cm/', + [:v201502, :CampaignFeedService] => 'cm/', + [:v201502, :CampaignService] => 'cm/', + [:v201502, :CampaignSharedSetService] => 'cm/', + [:v201502, :ConstantDataService] => 'cm/', + [:v201502, :ConversionTrackerService] => 'cm/', + [:v201502, :CustomerExtensionSettingService] => 'cm/', + [:v201502, :CustomerSyncService] => 'ch/', + [:v201502, :DataService] => 'cm/', + [:v201502, :ExperimentService] => 'cm/', + [:v201502, :FeedItemService] => 'cm/', + [:v201502, :FeedMappingService] => 'cm/', + [:v201502, :FeedService] => 'cm/', + [:v201502, :GeoLocationService] => 'cm/', + [:v201502, :LocationCriterionService] => 'cm/', + [:v201502, :MediaService] => 'cm/', + [:v201502, :MutateJobService] => 'cm/', + [:v201502, :OfflineConversionFeedService] => 'cm/', + [:v201502, :ReportDefinitionService] => 'cm/', + [:v201502, :SharedCriterionService] => 'cm/', + [:v201502, :SharedSetService] => 'cm/', + [:v201502, :TargetingIdeaService] => 'o/', + [:v201502, :TrafficEstimatorService] => 'o/', + [:v201502, :ManagedCustomerService] => 'mcm/', + [:v201502, :CustomerService] => 'mcm/', + [:v201502, :CustomerFeedService] => 'cm/', + [:v201502, :BudgetService] => 'cm/', + [:v201502, :BiddingStrategyService] => 'cm/', + [:v201502, :AdwordsUserListService] => 'rm/', + [:v201502, :LabelService] => 'cm/' } public diff --git a/adwords_api/lib/adwords_api/v201409/ad_customizer_feed_service.rb b/adwords_api/lib/adwords_api/v201409/ad_customizer_feed_service.rb new file mode 100755 index 000000000..1434ae48e --- /dev/null +++ b/adwords_api/lib/adwords_api/v201409/ad_customizer_feed_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:32:52. + +require 'ads_common/savon_service' +require 'adwords_api/v201409/ad_customizer_feed_service_registry' + +module AdwordsApi; module V201409; module AdCustomizerFeedService + class AdCustomizerFeedService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201409' + super(config, endpoint, namespace, :v201409) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return AdCustomizerFeedServiceRegistry + end + + def get_module() + return AdwordsApi::V201409::AdCustomizerFeedService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201409/ad_customizer_feed_service_registry.rb b/adwords_api/lib/adwords_api/v201409/ad_customizer_feed_service_registry.rb new file mode 100755 index 000000000..86059c68a --- /dev/null +++ b/adwords_api/lib/adwords_api/v201409/ad_customizer_feed_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:32:52. + +require 'adwords_api/errors' + +module AdwordsApi; module V201409; module AdCustomizerFeedService + class AdCustomizerFeedServiceRegistry + ADCUSTOMIZERFEEDSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdCustomizerFeedPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdCustomizerFeedOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdCustomizerFeedReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + ADCUSTOMIZERFEEDSERVICE_TYPES = {:AdCustomizerFeedAttribute=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"AdCustomizerFeedAttribute.Type", :min_occurs=>0, :max_occurs=>1}]}, :AdCustomizerFeedError=>{:fields=>[{:name=>:reason, :type=>"AdCustomizerFeedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateRange=>{:fields=>[{:name=>:min, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"Date", :min_occurs=>0, :max_occurs=>1}]}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedError=>{:fields=>[{:name=>:reason, :type=>"FeedError.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"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdCustomizerFeed=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_status, :type=>"Feed.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_attributes, :type=>"AdCustomizerFeedAttribute", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdCustomizerFeedOperation=>{:fields=>[{:name=>:operand, :type=>"AdCustomizerFeed", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdCustomizerFeedPage=>{:fields=>[{:name=>:entries, :type=>"AdCustomizerFeed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :AdCustomizerFeedReturnValue=>{:fields=>[{:name=>:value, :type=>"AdCustomizerFeed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.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}, :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}, :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}, :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}]}, :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}]}, :"AdCustomizerFeedAttribute.Type"=>{:fields=>[]}, :"AdCustomizerFeedError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"Feed.Status"=>{:fields=>[]}, :"FeedError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + ADCUSTOMIZERFEEDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADCUSTOMIZERFEEDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADCUSTOMIZERFEEDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADCUSTOMIZERFEEDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdCustomizerFeedServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201409/ad_group_extension_setting_service.rb b/adwords_api/lib/adwords_api/v201409/ad_group_extension_setting_service.rb new file mode 100755 index 000000000..b534b52e8 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201409/ad_group_extension_setting_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:33:03. + +require 'ads_common/savon_service' +require 'adwords_api/v201409/ad_group_extension_setting_service_registry' + +module AdwordsApi; module V201409; module AdGroupExtensionSettingService + class AdGroupExtensionSettingService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201409' + super(config, endpoint, namespace, :v201409) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return AdGroupExtensionSettingServiceRegistry + end + + def get_module() + return AdwordsApi::V201409::AdGroupExtensionSettingService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201409/ad_group_extension_setting_service_registry.rb b/adwords_api/lib/adwords_api/v201409/ad_group_extension_setting_service_registry.rb new file mode 100755 index 000000000..66d89beb9 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201409/ad_group_extension_setting_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:33:03. + +require 'adwords_api/errors' + +module AdwordsApi; module V201409; module AdGroupExtensionSettingService + class AdGroupExtensionSettingServiceRegistry + ADGROUPEXTENSIONSETTINGSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdGroupExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdGroupExtensionSettingOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdGroupExtensionSettingReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"AdGroupExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}} + ADGROUPEXTENSIONSETTINGSERVICE_TYPES = {:AppFeedItem=>{:fields=>[{:name=>:app_store, :type=>"AppFeedItem.AppStore", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_link_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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"}, :CallConversionType=>{:fields=>[{:name=>:conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CallFeedItem=>{:fields=>[{:name=>:call_phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_tracking, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_conversion_type, :type=>"CallConversionType", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExtensionSettingError=>{:fields=>[{:name=>:reason, :type=>"ExtensionSettingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItemDevicePreference=>{:fields=>[{:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemScheduling=>{:fields=>[{:name=>:feed_item_schedules, :type=>"FeedItemSchedule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ReviewFeedItem=>{:fields=>[{:name=>:review_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_text_exactly_quoted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlList=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SitelinkFeedItem=>{:fields=>[{:name=>:sitelink_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line3, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_mobile_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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}]}, :ExtensionFeedItem=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedItem.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_preference, :type=>"FeedItemDevicePreference", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduling, :type=>"FeedItemScheduling", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_feed_item_type, :original_name=>"ExtensionFeedItem.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ExtensionSetting=>{:fields=>[{:name=>:extensions, :type=>"ExtensionFeedItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:platform_restrictions, :type=>"ExtensionSetting.Platform", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :AdGroupExtensionSetting=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_setting, :type=>"ExtensionSetting", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupExtensionSettingOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupExtensionSetting", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupExtensionSettingPage=>{:fields=>[{:name=>:entries, :type=>"AdGroupExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :AdGroupExtensionSettingReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AppFeedItem.AppStore"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"ExtensionSetting.Platform"=>{:fields=>[]}, :"ExtensionSettingError.Reason"=>{:fields=>[]}, :"FeedItem.Status"=>{:fields=>[]}, :"Feed.Type"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}} + ADGROUPEXTENSIONSETTINGSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADGROUPEXTENSIONSETTINGSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADGROUPEXTENSIONSETTINGSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADGROUPEXTENSIONSETTINGSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdGroupExtensionSettingServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201409/campaign_extension_setting_service.rb b/adwords_api/lib/adwords_api/v201409/campaign_extension_setting_service.rb new file mode 100755 index 000000000..f645053d6 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201409/campaign_extension_setting_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:33:13. + +require 'ads_common/savon_service' +require 'adwords_api/v201409/campaign_extension_setting_service_registry' + +module AdwordsApi; module V201409; module CampaignExtensionSettingService + class CampaignExtensionSettingService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201409' + super(config, endpoint, namespace, :v201409) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return CampaignExtensionSettingServiceRegistry + end + + def get_module() + return AdwordsApi::V201409::CampaignExtensionSettingService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201409/campaign_extension_setting_service_registry.rb b/adwords_api/lib/adwords_api/v201409/campaign_extension_setting_service_registry.rb new file mode 100755 index 000000000..db2e7dd3e --- /dev/null +++ b/adwords_api/lib/adwords_api/v201409/campaign_extension_setting_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:33:13. + +require 'adwords_api/errors' + +module AdwordsApi; module V201409; module CampaignExtensionSettingService + class CampaignExtensionSettingServiceRegistry + CAMPAIGNEXTENSIONSETTINGSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CampaignExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CampaignExtensionSettingOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CampaignExtensionSettingReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"CampaignExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}} + CAMPAIGNEXTENSIONSETTINGSERVICE_TYPES = {:AppFeedItem=>{:fields=>[{:name=>:app_store, :type=>"AppFeedItem.AppStore", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_link_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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"}, :CallConversionType=>{:fields=>[{:name=>:conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CallFeedItem=>{:fields=>[{:name=>:call_phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_tracking, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_conversion_type, :type=>"CallConversionType", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExtensionSettingError=>{:fields=>[{:name=>:reason, :type=>"ExtensionSettingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItemDevicePreference=>{:fields=>[{:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemScheduling=>{:fields=>[{:name=>:feed_item_schedules, :type=>"FeedItemSchedule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ReviewFeedItem=>{:fields=>[{:name=>:review_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_text_exactly_quoted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlList=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SitelinkFeedItem=>{:fields=>[{:name=>:sitelink_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line3, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_mobile_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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}]}, :ExtensionFeedItem=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedItem.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_preference, :type=>"FeedItemDevicePreference", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduling, :type=>"FeedItemScheduling", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_feed_item_type, :original_name=>"ExtensionFeedItem.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ExtensionSetting=>{:fields=>[{:name=>:extensions, :type=>"ExtensionFeedItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:platform_restrictions, :type=>"ExtensionSetting.Platform", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :CampaignExtensionSetting=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_setting, :type=>"ExtensionSetting", :min_occurs=>0, :max_occurs=>1}]}, :CampaignExtensionSettingOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignExtensionSetting", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignExtensionSettingPage=>{:fields=>[{:name=>:entries, :type=>"CampaignExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :CampaignExtensionSettingReturnValue=>{:fields=>[{:name=>:value, :type=>"CampaignExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AppFeedItem.AppStore"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"ExtensionSetting.Platform"=>{:fields=>[]}, :"ExtensionSettingError.Reason"=>{:fields=>[]}, :"FeedItem.Status"=>{:fields=>[]}, :"Feed.Type"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}} + CAMPAIGNEXTENSIONSETTINGSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CAMPAIGNEXTENSIONSETTINGSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CAMPAIGNEXTENSIONSETTINGSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CAMPAIGNEXTENSIONSETTINGSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CampaignExtensionSettingServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201409/customer_extension_setting_service.rb b/adwords_api/lib/adwords_api/v201409/customer_extension_setting_service.rb new file mode 100755 index 000000000..b9d508af4 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201409/customer_extension_setting_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:33:26. + +require 'ads_common/savon_service' +require 'adwords_api/v201409/customer_extension_setting_service_registry' + +module AdwordsApi; module V201409; module CustomerExtensionSettingService + class CustomerExtensionSettingService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201409' + super(config, endpoint, namespace, :v201409) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return CustomerExtensionSettingServiceRegistry + end + + def get_module() + return AdwordsApi::V201409::CustomerExtensionSettingService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201409/customer_extension_setting_service_registry.rb b/adwords_api/lib/adwords_api/v201409/customer_extension_setting_service_registry.rb new file mode 100755 index 000000000..662c62cb4 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201409/customer_extension_setting_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:33:26. + +require 'adwords_api/errors' + +module AdwordsApi; module V201409; module CustomerExtensionSettingService + class CustomerExtensionSettingServiceRegistry + CUSTOMEREXTENSIONSETTINGSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CustomerExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CustomerExtensionSettingOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CustomerExtensionSettingReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"CustomerExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}} + CUSTOMEREXTENSIONSETTINGSERVICE_TYPES = {:AppFeedItem=>{:fields=>[{:name=>:app_store, :type=>"AppFeedItem.AppStore", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_link_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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"}, :CallConversionType=>{:fields=>[{:name=>:conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CallFeedItem=>{:fields=>[{:name=>:call_phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_tracking, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_conversion_type, :type=>"CallConversionType", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExtensionSettingError=>{:fields=>[{:name=>:reason, :type=>"ExtensionSettingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItemDevicePreference=>{:fields=>[{:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemScheduling=>{:fields=>[{:name=>:feed_item_schedules, :type=>"FeedItemSchedule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ReviewFeedItem=>{:fields=>[{:name=>:review_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_text_exactly_quoted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlList=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SitelinkFeedItem=>{:fields=>[{:name=>:sitelink_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line3, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_mobile_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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}]}, :ExtensionFeedItem=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedItem.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_preference, :type=>"FeedItemDevicePreference", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduling, :type=>"FeedItemScheduling", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_feed_item_type, :original_name=>"ExtensionFeedItem.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ExtensionSetting=>{:fields=>[{:name=>:extensions, :type=>"ExtensionFeedItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:platform_restrictions, :type=>"ExtensionSetting.Platform", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :CustomerExtensionSetting=>{:fields=>[{:name=>:extension_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_setting, :type=>"ExtensionSetting", :min_occurs=>0, :max_occurs=>1}]}, :CustomerExtensionSettingOperation=>{:fields=>[{:name=>:operand, :type=>"CustomerExtensionSetting", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CustomerExtensionSettingPage=>{:fields=>[{:name=>:entries, :type=>"CustomerExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :CustomerExtensionSettingReturnValue=>{:fields=>[{:name=>:value, :type=>"CustomerExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AppFeedItem.AppStore"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"ExtensionSetting.Platform"=>{:fields=>[]}, :"ExtensionSettingError.Reason"=>{:fields=>[]}, :"FeedItem.Status"=>{:fields=>[]}, :"Feed.Type"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}} + CUSTOMEREXTENSIONSETTINGSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CUSTOMEREXTENSIONSETTINGSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CUSTOMEREXTENSIONSETTINGSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CUSTOMEREXTENSIONSETTINGSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CustomerExtensionSettingServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/account_label_service.rb b/adwords_api/lib/adwords_api/v201502/account_label_service.rb new file mode 100755 index 000000000..8e8d28f9d --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/account_label_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:49. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/account_label_service_registry' + +module AdwordsApi; module V201502; module AccountLabelService + class AccountLabelService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/mcm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return AccountLabelServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AccountLabelService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/account_label_service_registry.rb b/adwords_api/lib/adwords_api/v201502/account_label_service_registry.rb new file mode 100755 index 000000000..ea9aea5ef --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/account_label_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:49. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AccountLabelService + class AccountLabelServiceRegistry + ACCOUNTLABELSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AccountLabelPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AccountLabelOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AccountLabelReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + ACCOUNTLABELSERVICE_TYPES = {:AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateRange=>{:fields=>[{:name=>:min, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"Date", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OrderBy=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sort_order, :type=>"SortOrder", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :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}], :ns=>0}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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", :ns=>0}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RegionCodeError=>{:fields=>[{:name=>:reason, :type=>"RegionCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SoapHeader=>{:fields=>[{: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}], :ns=>0}, :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}], :ns=>0}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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, :ns=>0}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException", :ns=>0}, :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}], :ns=>0}, :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}], :ns=>0}, :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, :ns=>0}, :"AuthenticationError.Reason"=>{:fields=>[], :ns=>0}, :"AuthorizationError.Reason"=>{:fields=>[], :ns=>0}, :"ClientTermsError.Reason"=>{:fields=>[], :ns=>0}, :"DatabaseError.Reason"=>{:fields=>[], :ns=>0}, :"DateError.Reason"=>{:fields=>[], :ns=>0}, :"DistinctError.Reason"=>{:fields=>[], :ns=>0}, :"IdError.Reason"=>{:fields=>[], :ns=>0}, :"InternalApiError.Reason"=>{:fields=>[], :ns=>0}, :"NotEmptyError.Reason"=>{:fields=>[], :ns=>0}, :"NullError.Reason"=>{:fields=>[], :ns=>0}, :"OperationAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :Operator=>{:fields=>[], :ns=>0}, :"OperatorError.Reason"=>{:fields=>[], :ns=>0}, :"Predicate.Operator"=>{:fields=>[], :ns=>0}, :"QuotaCheckError.Reason"=>{:fields=>[], :ns=>0}, :"RangeError.Reason"=>{:fields=>[], :ns=>0}, :"RateExceededError.Reason"=>{:fields=>[], :ns=>0}, :"ReadOnlyError.Reason"=>{:fields=>[], :ns=>0}, :"RegionCodeError.Reason"=>{:fields=>[], :ns=>0}, :"RejectedError.Reason"=>{:fields=>[], :ns=>0}, :"RequestError.Reason"=>{:fields=>[], :ns=>0}, :"RequiredError.Reason"=>{:fields=>[], :ns=>0}, :"SizeLimitError.Reason"=>{:fields=>[], :ns=>0}, :SortOrder=>{:fields=>[], :ns=>0}, :"StringFormatError.Reason"=>{:fields=>[], :ns=>0}, :"StringLengthError.Reason"=>{:fields=>[], :ns=>0}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CurrencyCodeError=>{:fields=>[{:name=>:reason, :type=>"CurrencyCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LabelServiceError=>{:fields=>[{:name=>:reason, :type=>"LabelServiceError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AccountLabel=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AccountLabelOperation=>{:fields=>[{:name=>:operand, :type=>"AccountLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AccountLabelPage=>{:fields=>[{:name=>:labels, :type=>"AccountLabel", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AccountLabelReturnValue=>{:fields=>[{:name=>:labels, :type=>"AccountLabel", :min_occurs=>0, :max_occurs=>:unbounded}]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CurrencyCodeError.Reason"=>{:fields=>[]}, :"LabelServiceError.Reason"=>{:fields=>[]}} + ACCOUNTLABELSERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201502"] + + def self.get_method_signature(method_name) + return ACCOUNTLABELSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ACCOUNTLABELSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ACCOUNTLABELSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AccountLabelServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_customizer_feed_service.rb b/adwords_api/lib/adwords_api/v201502/ad_customizer_feed_service.rb new file mode 100755 index 000000000..df989c959 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_customizer_feed_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:32:41. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/ad_customizer_feed_service_registry' + +module AdwordsApi; module V201502; module AdCustomizerFeedService + class AdCustomizerFeedService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return AdCustomizerFeedServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdCustomizerFeedService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_customizer_feed_service_registry.rb b/adwords_api/lib/adwords_api/v201502/ad_customizer_feed_service_registry.rb new file mode 100755 index 000000000..43ed1ec49 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_customizer_feed_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:32:41. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdCustomizerFeedService + class AdCustomizerFeedServiceRegistry + ADCUSTOMIZERFEEDSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdCustomizerFeedPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdCustomizerFeedOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdCustomizerFeedReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + ADCUSTOMIZERFEEDSERVICE_TYPES = {:AdCustomizerFeedAttribute=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"AdCustomizerFeedAttribute.Type", :min_occurs=>0, :max_occurs=>1}]}, :AdCustomizerFeedError=>{:fields=>[{:name=>:reason, :type=>"AdCustomizerFeedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateRange=>{:fields=>[{:name=>:min, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"Date", :min_occurs=>0, :max_occurs=>1}]}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedError=>{:fields=>[{:name=>:reason, :type=>"FeedError.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"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdCustomizerFeed=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_status, :type=>"Feed.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_attributes, :type=>"AdCustomizerFeedAttribute", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdCustomizerFeedOperation=>{:fields=>[{:name=>:operand, :type=>"AdCustomizerFeed", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdCustomizerFeedPage=>{:fields=>[{:name=>:entries, :type=>"AdCustomizerFeed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :AdCustomizerFeedReturnValue=>{:fields=>[{:name=>:value, :type=>"AdCustomizerFeed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.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}, :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}, :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}, :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}]}, :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}]}, :"AdCustomizerFeedAttribute.Type"=>{:fields=>[]}, :"AdCustomizerFeedError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"Feed.Status"=>{:fields=>[]}, :"FeedError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + ADCUSTOMIZERFEEDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADCUSTOMIZERFEEDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADCUSTOMIZERFEEDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADCUSTOMIZERFEEDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdCustomizerFeedServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_ad_service.rb b/adwords_api/lib/adwords_api/v201502/ad_group_ad_service.rb new file mode 100755 index 000000000..dd93e7ae9 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_ad_service.rb @@ -0,0 +1,50 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:50. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/ad_group_ad_service_registry' + +module AdwordsApi; module V201502; module AdGroupAdService + class AdGroupAdService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def mutate_label(*args, &block) + return execute_action('mutate_label', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + def upgrade_url(*args, &block) + return execute_action('upgrade_url', args, &block) + end + + private + + def get_service_registry() + return AdGroupAdServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdGroupAdService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_ad_service_registry.rb b/adwords_api/lib/adwords_api/v201502/ad_group_ad_service_registry.rb new file mode 100755 index 000000000..7b71cc2a5 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_ad_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:50. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdGroupAdService + class AdGroupAdServiceRegistry + ADGROUPADSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdGroupAdPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdGroupAdOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdGroupAdReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :mutate_label=>{:input=>[{:name=>:operations, :type=>"AdGroupAdLabelOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_label_response", :fields=>[{:name=>:rval, :type=>"AdGroupAdLabelReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"AdGroupAdPage", :min_occurs=>0, :max_occurs=>1}]}}, :upgrade_url=>{:input=>[{:name=>:operations, :type=>"AdUrlUpgrade", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"upgrade_url_response", :fields=>[{:name=>:rval, :type=>"Ad", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + ADGROUPADSERVICE_TYPES = {:Ad=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:final_mobile_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:final_app_urls, :type=>"AppUrl", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_type, :original_name=>"Ad.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdCustomizerError=>{:fields=>[{:name=>:reason, :type=>"AdCustomizerError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:function_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:operator_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:operand_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:operand_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdError=>{:fields=>[{:name=>:reason, :type=>"AdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdGroupAd=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad, :type=>"Ad", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data, :type=>"AdGroupAdExperimentData", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"AdGroupAd.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"AdGroupAd.ApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:trademarks, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:disapproval_reasons, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trademark_disapproved, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdGroupAdCountLimitExceeded=>{:fields=>[], :base=>"EntityCountLimitExceeded"}, :AdGroupAdError=>{:fields=>[{:name=>:reason, :type=>"AdGroupAdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdGroupAdExperimentData=>{:fields=>[{:name=>:experiment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_delta_status, :type=>"ExperimentDeltaStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data_status, :type=>"ExperimentDataStatus", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupAdLabel=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupAdLabelOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupAdLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupAdLabelReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupAdLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :AdGroupAdOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupAd", :min_occurs=>0, :max_occurs=>1}, {:name=>:exemption_requests, :type=>"ExemptionRequest", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Operation"}, :AdGroupAdPage=>{:fields=>[{:name=>:entries, :type=>"AdGroupAd", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :AdGroupAdReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupAd", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :AdUnionId=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_union_id_type, :original_name=>"AdUnionId.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdUrlUpgrade=>{:fields=>[{:name=>:ad_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_mobile_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :AppUrl=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_type, :type=>"AppUrl.OsType", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :Audio=>{:fields=>[{:name=>:duration_millis, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:streaming_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ready_to_play_on_the_web, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :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"}, :CallOnlyAd=>{:fields=>[{:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:business_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description1, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_tracked, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:disable_call_conversion, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:phone_number_verification_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :TextLabel=>{:fields=>[], :base=>"Label"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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}]}, :DeprecatedAd=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"DeprecatedAd.Type", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :Dimensions=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExemptionRequest=>{:fields=>[{:name=>:key, :type=>"PolicyViolationKey", :min_occurs=>0, :max_occurs=>1}]}, :ExperimentError=>{:fields=>[{:name=>:reason, :type=>"ExperimentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedAttributeReferenceError=>{:fields=>[{:name=>:reason, :type=>"FeedAttributeReferenceError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_attribute_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForwardCompatibilityError=>{:fields=>[{:name=>:reason, :type=>"ForwardCompatibilityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FunctionError=>{:fields=>[{:name=>:reason, :type=>"FunctionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FunctionParsingError=>{:fields=>[{:name=>:reason, :type=>"FunctionParsingError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:offending_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:offending_text_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Image=>{:fields=>[{:name=>:data, :type=>"base64Binary", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :ImageAd=>{:fields=>[{:name=>:image, :type=>"Image", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_to_copy_image_from, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Label=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Label.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_type, :original_name=>"Label.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Media=>{:fields=>[{:name=>:media_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Media.MediaType", :min_occurs=>0, :max_occurs=>1}, {:name=>:reference_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:dimensions, :type=>"Media_Size_DimensionsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:urls, :type=>"Media_Size_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mime_type, :type=>"Media.MimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:media_type, :original_name=>"Media.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MediaError=>{:fields=>[{:name=>:reason, :type=>"MediaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Media_Size_DimensionsMapEntry=>{:fields=>[{:name=>:key, :type=>"Media.Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Dimensions", :min_occurs=>0, :max_occurs=>1}]}, :Media_Size_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"Media.Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileAd=>{:fields=>[{:name=>:headline, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:markup_languages, :type=>"MarkupLanguageType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mobile_carriers, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:business_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :MobileImageAd=>{:fields=>[{:name=>:markup_languages, :type=>"MarkupLanguageType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mobile_carriers, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:image, :type=>"Image", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.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}]}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PolicyViolationError=>{:fields=>[{:name=>:key, :type=>"PolicyViolationKey", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_exemptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_parts, :type=>"PolicyViolationError.Part", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApiError"}, :"PolicyViolationError.Part"=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:length, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PolicyViolationKey=>{:fields=>[{:name=>:policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_text, :type=>"string", :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}]}, :ProductAd=>{:fields=>[{:name=>:promotion_line, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RichMediaAd=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:dimensions, :type=>"Dimensions", :min_occurs=>0, :max_occurs=>1}, {:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:impression_beacon_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:certified_vendor_format_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:rich_media_ad_type, :type=>"RichMediaAd.RichMediaAdType", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_attributes, :type=>"RichMediaAd.AdAttribute", :min_occurs=>0, :max_occurs=>:unbounded}], :abstract=>true, :base=>"Ad"}, :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=>: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}]}, :StatsQueryError=>{:fields=>[{:name=>:reason, :type=>"StatsQueryError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TempAdUnionId=>{:fields=>[], :base=>"AdUnionId"}, :TemplateAd=>{:fields=>[{:name=>:template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_union_id, :type=>"AdUnionId", :min_occurs=>0, :max_occurs=>1}, {:name=>:template_elements, :type=>"TemplateElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_as_image, :type=>"Image", :min_occurs=>0, :max_occurs=>1}, {:name=>:dimensions, :type=>"Dimensions", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:origin_ad_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :TemplateElement=>{:fields=>[{:name=>:unique_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fields, :type=>"TemplateElementField", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TemplateElementField=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"TemplateElementField.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_media, :type=>"Media", :min_occurs=>0, :max_occurs=>1}]}, :TextAd=>{:fields=>[{:name=>:headline, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description1, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description2, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :ThirdPartyRedirectAd=>{:fields=>[{:name=>:is_cookie_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_user_interest_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_tagged, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_types, :type=>"VideoType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expanding_directions, :type=>"ThirdPartyRedirectAd.ExpandingDirection", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"RichMediaAd"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Video=>{:fields=>[{:name=>:duration_millis, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:streaming_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ready_to_play_on_the_web, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:industry_standard_commercial_identifier, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertising_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:you_tube_video_id_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :DynamicSearchAd=>{:fields=>[{:name=>:description1, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description2, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :"AdCustomizerError.Reason"=>{:fields=>[]}, :"AdError.Reason"=>{:fields=>[]}, :"AdGroupAd.ApprovalStatus"=>{:fields=>[]}, :"AdGroupAd.Status"=>{:fields=>[]}, :"AdGroupAdError.Reason"=>{:fields=>[]}, :"AdxError.Reason"=>{:fields=>[]}, :"AppUrl.OsType"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DeprecatedAd.Type"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :ExperimentDataStatus=>{:fields=>[]}, :ExperimentDeltaStatus=>{:fields=>[]}, :"ExperimentError.Reason"=>{:fields=>[]}, :"FeedAttributeReferenceError.Reason"=>{:fields=>[]}, :"ForwardCompatibilityError.Reason"=>{:fields=>[]}, :"FunctionError.Reason"=>{:fields=>[]}, :"FunctionParsingError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"Label.Status"=>{:fields=>[]}, :MarkupLanguageType=>{:fields=>[]}, :"Media.MediaType"=>{:fields=>[]}, :"Media.MimeType"=>{:fields=>[]}, :"Media.Size"=>{:fields=>[]}, :"MediaError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RichMediaAd.AdAttribute"=>{:fields=>[]}, :"RichMediaAd.RichMediaAdType"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StatsQueryError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TemplateElementField.Type"=>{:fields=>[]}, :"ThirdPartyRedirectAd.ExpandingDirection"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}, :VideoType=>{:fields=>[]}} + ADGROUPADSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADGROUPADSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADGROUPADSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADGROUPADSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdGroupAdServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_bid_modifier_service.rb b/adwords_api/lib/adwords_api/v201502/ad_group_bid_modifier_service.rb new file mode 100755 index 000000000..7dd5d16ec --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_bid_modifier_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:54. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/ad_group_bid_modifier_service_registry' + +module AdwordsApi; module V201502; module AdGroupBidModifierService + class AdGroupBidModifierService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return AdGroupBidModifierServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdGroupBidModifierService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_bid_modifier_service_registry.rb b/adwords_api/lib/adwords_api/v201502/ad_group_bid_modifier_service_registry.rb new file mode 100755 index 000000000..129381740 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_bid_modifier_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:54. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdGroupBidModifierService + class AdGroupBidModifierServiceRegistry + ADGROUPBIDMODIFIERSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdGroupBidModifierPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdGroupBidModifierOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdGroupBidModifierReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"AdGroupBidModifierPage", :min_occurs=>0, :max_occurs=>1}]}}} + ADGROUPBIDMODIFIERSERVICE_TYPES = {: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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CriterionError=>{:fields=>[{:name=>:reason, :type=>"CriterionError.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"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Platform=>{:fields=>[{:name=>:platform_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupBidModifier=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion, :type=>"Criterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier_source, :type=>"BidModifierSource", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupBidModifierOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupBidModifier", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupBidModifierPage=>{:fields=>[{:name=>:entries, :type=>"AdGroupBidModifier", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :AdGroupBidModifierReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupBidModifier", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :BidModifierSource=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"Criterion.Type"=>{:fields=>[]}, :"CriterionError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + ADGROUPBIDMODIFIERSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADGROUPBIDMODIFIERSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADGROUPBIDMODIFIERSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADGROUPBIDMODIFIERSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdGroupBidModifierServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_criterion_service.rb b/adwords_api/lib/adwords_api/v201502/ad_group_criterion_service.rb new file mode 100755 index 000000000..ebc833d82 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_criterion_service.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:55. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/ad_group_criterion_service_registry' + +module AdwordsApi; module V201502; module AdGroupCriterionService + class AdGroupCriterionService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def mutate_label(*args, &block) + return execute_action('mutate_label', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return AdGroupCriterionServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdGroupCriterionService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_criterion_service_registry.rb b/adwords_api/lib/adwords_api/v201502/ad_group_criterion_service_registry.rb new file mode 100755 index 000000000..85c45a11f --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_criterion_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:55. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdGroupCriterionService + class AdGroupCriterionServiceRegistry + ADGROUPCRITERIONSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdGroupCriterionPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdGroupCriterionOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdGroupCriterionReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :mutate_label=>{:input=>[{:name=>:operations, :type=>"AdGroupCriterionLabelOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_label_response", :fields=>[{:name=>:rval, :type=>"AdGroupCriterionLabelReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"AdGroupCriterionPage", :min_occurs=>0, :max_occurs=>1}]}}} + ADGROUPCRITERIONSERVICE_TYPES = {:AdGroupCriterion=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_use, :type=>"CriterionUse", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion, :type=>"Criterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_group_criterion_type, :original_name=>"AdGroupCriterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupCriterionError=>{:fields=>[{:name=>:reason, :type=>"AdGroupCriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdGroupCriterionExperimentBidMultiplier=>{:fields=>[{:name=>:ad_group_criterion_experiment_bid_multiplier_type, :original_name=>"AdGroupCriterionExperimentBidMultiplier.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :AdGroupCriterionLabel=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupCriterionLabelOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupCriterionLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupCriterionLabelReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupCriterionLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :AdGroupCriterionLimitExceeded=>{:fields=>[{:name=>:limit_type, :type=>"AdGroupCriterionLimitExceeded.CriteriaLimitType", :min_occurs=>0, :max_occurs=>1}], :base=>"EntityCountLimitExceeded"}, :AdGroupCriterionOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupCriterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:exemption_requests, :type=>"ExemptionRequest", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Operation"}, :AdGroupCriterionPage=>{:fields=>[{:name=>:entries, :type=>"AdGroupCriterion", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :AdGroupCriterionReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupCriterion", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AgeRange=>{:fields=>[{:name=>:age_range_type, :type=>"AgeRange.AgeRangeType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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"}, :AppPaymentModel=>{:fields=>[{:name=>:app_payment_model_type, :type=>"AppPaymentModel.AppPaymentModelType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :AppUrl=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_type, :type=>"AppUrl.OsType", :min_occurs=>0, :max_occurs=>1}]}, :AppUrlList=>{:fields=>[{:name=>:app_urls, :type=>"AppUrl", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :Bid=>{:fields=>[{:name=>:amount, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :BidMultiplier=>{:fields=>[{:name=>:multiplier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:multiplied_bid, :type=>"Bid", :min_occurs=>0, :max_occurs=>1}]}, :BiddableAdGroupCriterion=>{:fields=>[{:name=>:user_status, :type=>"UserStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:system_serving_status, :type=>"SystemServingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"ApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:disapproval_reasons, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:destination_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data, :type=>"BiddableAdGroupCriterionExperimentData", :min_occurs=>0, :max_occurs=>1}, {:name=>:first_page_cpc, :type=>"Bid", :min_occurs=>0, :max_occurs=>1}, {:name=>:top_of_page_cpc, :type=>"Bid", :min_occurs=>0, :max_occurs=>1}, {:name=>:quality_info, :type=>"QualityInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_configuration, :type=>"BiddingStrategyConfiguration", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_mobile_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_app_urls, :type=>"AppUrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}], :base=>"AdGroupCriterion"}, :BiddableAdGroupCriterionExperimentData=>{:fields=>[{:name=>:experiment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_delta_status, :type=>"ExperimentDeltaStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data_status, :type=>"ExperimentDataStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_bid_multiplier, :type=>"AdGroupCriterionExperimentBidMultiplier", :min_occurs=>0, :max_occurs=>1}]}, :BiddingError=>{:fields=>[{:name=>:reason, :type=>"BiddingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BiddingErrors=>{:fields=>[{:name=>:reason, :type=>"BiddingErrors.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BiddingScheme=>{:fields=>[{:name=>:bidding_scheme_type, :original_name=>"BiddingScheme.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BiddingStrategyConfiguration=>{:fields=>[{:name=>:bidding_strategy_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_type, :type=>"BiddingStrategyType", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_source, :type=>"BiddingStrategySource", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_scheme, :type=>"BiddingScheme", :min_occurs=>0, :max_occurs=>1}, {:name=>:bids, :type=>"Bids", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Bids=>{:fields=>[{:name=>:bids_type, :original_name=>"Bids.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BudgetOptimizerBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TextLabel=>{:fields=>[], :base=>"Label"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ConversionOptimizerBiddingScheme=>{:fields=>[{:name=>:pricing_mode, :type=>"ConversionOptimizerBiddingScheme.PricingMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_type, :type=>"ConversionOptimizerBiddingScheme.BidType", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :CpaBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CpcBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cpc_bid_source, :type=>"BidSource", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CpmBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cpm_bid_source, :type=>"BidSource", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CriterionError=>{:fields=>[{:name=>:reason, :type=>"CriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CriterionParameter=>{:fields=>[{:name=>:criterion_parameter_type, :original_name=>"CriterionParameter.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :CriterionPolicyError=>{:fields=>[], :base=>"PolicyViolationError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :EnhancedCpcBiddingScheme=>{:fields=>[], :base=>"BiddingScheme"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExemptionRequest=>{:fields=>[{:name=>:key, :type=>"PolicyViolationKey", :min_occurs=>0, :max_occurs=>1}]}, :ExperimentError=>{:fields=>[{:name=>:reason, :type=>"ExperimentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForwardCompatibilityError=>{:fields=>[{:name=>:reason, :type=>"ForwardCompatibilityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Gender=>{:fields=>[{:name=>:gender_type, :type=>"Gender.GenderType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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"}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Label=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Label.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_type, :original_name=>"Label.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :ManualCPCAdGroupCriterionExperimentBidMultiplier=>{:fields=>[{:name=>:max_cpc_multiplier, :type=>"BidMultiplier", :min_occurs=>0, :max_occurs=>1}, {:name=>:multiplier_source, :type=>"MultiplierSource", :min_occurs=>0, :max_occurs=>1}], :base=>"AdGroupCriterionExperimentBidMultiplier"}, :ManualCpcBiddingScheme=>{:fields=>[{:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :ManualCpmBiddingScheme=>{:fields=>[{:name=>:active_view_cpm_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue"}, :MultiplierError=>{:fields=>[{:name=>:reason, :type=>"MultiplierError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NegativeAdGroupCriterion=>{:fields=>[], :base=>"AdGroupCriterion"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue"}, :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}, :PageOnePromotedBiddingScheme=>{:fields=>[{:name=>:strategy_goal, :type=>"PageOnePromotedBiddingScheme.StrategyGoal", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_budget_constrained, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :PolicyViolationError=>{:fields=>[{:name=>:key, :type=>"PolicyViolationKey", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_exemptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_parts, :type=>"PolicyViolationError.Part", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApiError"}, :"PolicyViolationError.Part"=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:length, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PolicyViolationKey=>{:fields=>[{:name=>:policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_text, :type=>"string", :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}]}, :ProductAdwordsGrouping=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductAdwordsLabels=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductBiddingCategory=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductBrand=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductCanonicalCondition=>{:fields=>[{:name=>:condition, :type=>"ProductCanonicalCondition.Condition", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductChannel=>{:fields=>[{:name=>:channel, :type=>"ShoppingProductChannel", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductChannelExclusivity=>{:fields=>[{:name=>:channel_exclusivity, :type=>"ShoppingProductChannelExclusivity", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductLegacyCondition=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductCustomAttribute=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductDimension=>{:fields=>[{:name=>:product_dimension_type, :original_name=>"ProductDimension.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ProductOfferId=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductPartition=>{:fields=>[{:name=>:partition_type, :type=>"ProductPartitionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:case_value, :type=>"ProductDimension", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :ProductType=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductTypeFull=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :QualityInfo=>{:fields=>[{:name=>:is_keyword_ad_relevance_acceptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_landing_page_quality_acceptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:quality_score, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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=>: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}]}, :StatsQueryError=>{:fields=>[{:name=>:reason, :type=>"StatsQueryError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TargetCpaBiddingScheme=>{:fields=>[{:name=>:target_cpa, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetOutrankShareBiddingScheme=>{:fields=>[{:name=>:target_outrank_share, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:competitor_domain, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetRoasBiddingScheme=>{:fields=>[{:name=>:target_roas, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetSpendBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:spend_target, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlList=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :Webpage=>{:fields=>[{:name=>:parameter, :type=>"WebpageParameter", :min_occurs=>0, :max_occurs=>1}, {:name=>:criteria_coverage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:criteria_samples, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :WebpageCondition=>{:fields=>[{:name=>:operand, :type=>"WebpageConditionOperand", :min_occurs=>0, :max_occurs=>1}, {:name=>:argument, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :WebpageParameter=>{:fields=>[{:name=>:criterion_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:conditions, :type=>"WebpageCondition", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CriterionParameter"}, :YouTubeChannel=>{:fields=>[{:name=>:channel_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:channel_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :YouTubeVideo=>{:fields=>[{:name=>:video_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :"AdGroupCriterionError.Reason"=>{:fields=>[]}, :"AdGroupCriterionLimitExceeded.CriteriaLimitType"=>{:fields=>[]}, :"AdxError.Reason"=>{:fields=>[]}, :"AgeRange.AgeRangeType"=>{:fields=>[]}, :"AppPaymentModel.AppPaymentModelType"=>{:fields=>[]}, :"AppUrl.OsType"=>{:fields=>[]}, :ApprovalStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :BidSource=>{:fields=>[]}, :"BiddingError.Reason"=>{:fields=>[]}, :"BiddingErrors.Reason"=>{:fields=>[]}, :BiddingStrategySource=>{:fields=>[]}, :BiddingStrategyType=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.BidType"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.PricingMode"=>{:fields=>[]}, :"Criterion.Type"=>{:fields=>[]}, :"CriterionError.Reason"=>{:fields=>[]}, :CriterionUse=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :ExperimentDataStatus=>{:fields=>[]}, :ExperimentDeltaStatus=>{:fields=>[]}, :"ExperimentError.Reason"=>{:fields=>[]}, :"ForwardCompatibilityError.Reason"=>{:fields=>[]}, :"Gender.GenderType"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :KeywordMatchType=>{:fields=>[]}, :"Label.Status"=>{:fields=>[]}, :"MultiplierError.Reason"=>{:fields=>[]}, :MultiplierSource=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"PageOnePromotedBiddingScheme.StrategyGoal"=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"ProductCanonicalCondition.Condition"=>{:fields=>[]}, :ProductDimensionType=>{:fields=>[]}, :ProductPartitionType=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :ShoppingProductChannel=>{:fields=>[]}, :ShoppingProductChannelExclusivity=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StatsQueryError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :SystemServingStatus=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}, :"CriterionUserList.MembershipStatus"=>{:fields=>[]}, :UserStatus=>{:fields=>[]}, :WebpageConditionOperand=>{:fields=>[]}} + ADGROUPCRITERIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADGROUPCRITERIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADGROUPCRITERIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADGROUPCRITERIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdGroupCriterionServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_extension_setting_service.rb b/adwords_api/lib/adwords_api/v201502/ad_group_extension_setting_service.rb new file mode 100755 index 000000000..bb1993b85 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_extension_setting_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:58. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/ad_group_extension_setting_service_registry' + +module AdwordsApi; module V201502; module AdGroupExtensionSettingService + class AdGroupExtensionSettingService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return AdGroupExtensionSettingServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdGroupExtensionSettingService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_extension_setting_service_registry.rb b/adwords_api/lib/adwords_api/v201502/ad_group_extension_setting_service_registry.rb new file mode 100755 index 000000000..9b82a9396 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_extension_setting_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:58. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdGroupExtensionSettingService + class AdGroupExtensionSettingServiceRegistry + ADGROUPEXTENSIONSETTINGSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdGroupExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdGroupExtensionSettingOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdGroupExtensionSettingReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"AdGroupExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}} + ADGROUPEXTENSIONSETTINGSERVICE_TYPES = {:AppFeedItem=>{:fields=>[{:name=>:app_store, :type=>"AppFeedItem.AppStore", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_link_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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"}, :CallConversionType=>{:fields=>[{:name=>:conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CallFeedItem=>{:fields=>[{:name=>:call_phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_tracking, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_conversion_type, :type=>"CallConversionType", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :CalloutFeedItem=>{:fields=>[{:name=>:callout_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExtensionSettingError=>{:fields=>[{:name=>:reason, :type=>"ExtensionSettingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItemDevicePreference=>{:fields=>[{:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemScheduling=>{:fields=>[{:name=>:feed_item_schedules, :type=>"FeedItemSchedule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ReviewFeedItem=>{:fields=>[{:name=>:review_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_text_exactly_quoted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlList=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SitelinkFeedItem=>{:fields=>[{:name=>:sitelink_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line3, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_mobile_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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}]}, :ExtensionFeedItem=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedItem.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_preference, :type=>"FeedItemDevicePreference", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduling, :type=>"FeedItemScheduling", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_feed_item_type, :original_name=>"ExtensionFeedItem.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ExtensionSetting=>{:fields=>[{:name=>:extensions, :type=>"ExtensionFeedItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:platform_restrictions, :type=>"ExtensionSetting.Platform", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :AdGroupExtensionSetting=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_setting, :type=>"ExtensionSetting", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupExtensionSettingOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupExtensionSetting", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupExtensionSettingPage=>{:fields=>[{:name=>:entries, :type=>"AdGroupExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :AdGroupExtensionSettingReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AppFeedItem.AppStore"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"ExtensionSetting.Platform"=>{:fields=>[]}, :"ExtensionSettingError.Reason"=>{:fields=>[]}, :"FeedItem.Status"=>{:fields=>[]}, :"Feed.Type"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}} + ADGROUPEXTENSIONSETTINGSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADGROUPEXTENSIONSETTINGSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADGROUPEXTENSIONSETTINGSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADGROUPEXTENSIONSETTINGSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdGroupExtensionSettingServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_feed_service.rb b/adwords_api/lib/adwords_api/v201502/ad_group_feed_service.rb new file mode 100755 index 000000000..0f3a89c08 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_feed_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:59. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/ad_group_feed_service_registry' + +module AdwordsApi; module V201502; module AdGroupFeedService + class AdGroupFeedService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return AdGroupFeedServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdGroupFeedService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_feed_service_registry.rb b/adwords_api/lib/adwords_api/v201502/ad_group_feed_service_registry.rb new file mode 100755 index 000000000..d03cb36cc --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_feed_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:30:59. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdGroupFeedService + class AdGroupFeedServiceRegistry + ADGROUPFEEDSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdGroupFeedPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdGroupFeedOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdGroupFeedReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"AdGroupFeedPage", :min_occurs=>0, :max_occurs=>1}]}}} + ADGROUPFEEDSERVICE_TYPES = {:AdGroupFeed=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matching_function, :type=>"Function", :min_occurs=>0, :max_occurs=>1}, {:name=>:placeholder_types, :type=>"int", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:status, :type=>"AdGroupFeed.Status", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupFeedError=>{:fields=>[{:name=>:reason, :type=>"AdGroupFeedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdGroupFeedOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupFeed", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupFeedPage=>{:fields=>[{:name=>:entries, :type=>"AdGroupFeed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :AdGroupFeedReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupFeed", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConstantOperand=>{:fields=>[{:name=>:type, :type=>"ConstantOperand.ConstantType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit, :type=>"ConstantOperand.Unit", :min_occurs=>0, :max_occurs=>1}, {:name=>:long_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:boolean_value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:double_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:string_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :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"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedAttributeOperand=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_attribute_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :Function=>{:fields=>[{:name=>:operator, :type=>"Function.Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:lhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:rhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:function_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :FunctionError=>{:fields=>[{:name=>:reason, :type=>"FunctionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FunctionOperand=>{:fields=>[{:name=>:value, :type=>"Function", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :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}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :FunctionArgumentOperand=>{:fields=>[{:name=>:function_argument_operand_type, :original_name=>"FunctionArgumentOperand.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequestContextOperand=>{:fields=>[{:name=>:context_type, :type=>"RequestContextOperand.ContextType", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"AdGroupFeed.Status"=>{:fields=>[]}, :"AdGroupFeedError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"ConstantOperand.ConstantType"=>{:fields=>[]}, :"ConstantOperand.Unit"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"Function.Operator"=>{:fields=>[]}, :"FunctionError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestContextOperand.ContextType"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + ADGROUPFEEDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADGROUPFEEDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADGROUPFEEDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADGROUPFEEDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdGroupFeedServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_service.rb b/adwords_api/lib/adwords_api/v201502/ad_group_service.rb new file mode 100755 index 000000000..a7782d374 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_service.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:00. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/ad_group_service_registry' + +module AdwordsApi; module V201502; module AdGroupService + class AdGroupService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def mutate_label(*args, &block) + return execute_action('mutate_label', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return AdGroupServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdGroupService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_group_service_registry.rb b/adwords_api/lib/adwords_api/v201502/ad_group_service_registry.rb new file mode 100755 index 000000000..f0f514913 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_group_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:00. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdGroupService + class AdGroupServiceRegistry + ADGROUPSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdGroupPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdGroupOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdGroupReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :mutate_label=>{:input=>[{:name=>:operations, :type=>"AdGroupLabelOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_label_response", :fields=>[{:name=>:rval, :type=>"AdGroupLabelReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"AdGroupPage", :min_occurs=>0, :max_occurs=>1}]}}} + ADGROUPSERVICE_TYPES = {:AdGroupLabel=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupLabelOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupServiceError=>{:fields=>[{:name=>:reason, :type=>"AdGroupServiceError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :BiddingError=>{:fields=>[{:name=>:reason, :type=>"BiddingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BiddingErrors=>{:fields=>[{:name=>:reason, :type=>"BiddingErrors.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TextLabel=>{:fields=>[], :base=>"Label"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConversionOptimizerBiddingScheme=>{:fields=>[{:name=>:pricing_mode, :type=>"ConversionOptimizerBiddingScheme.PricingMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_type, :type=>"ConversionOptimizerBiddingScheme.BidType", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :EnhancedCpcBiddingScheme=>{:fields=>[], :base=>"BiddingScheme"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExperimentError=>{:fields=>[{:name=>:reason, :type=>"ExperimentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExplorerAutoOptimizerSetting=>{:fields=>[{:name=>:opt_in, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :ForwardCompatibilityError=>{:fields=>[{:name=>:reason, :type=>"ForwardCompatibilityError.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"}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :ManualCpcBiddingScheme=>{:fields=>[{:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :ManualCpmBiddingScheme=>{:fields=>[{:name=>:active_view_cpm_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue"}, :MultiplierError=>{:fields=>[{:name=>:reason, :type=>"MultiplierError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :SelectorError=>{:fields=>[{:name=>:reason, :type=>"SelectorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SettingError=>{:fields=>[{:name=>:reason, :type=>"SettingError.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=>: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}]}, :StatsQueryError=>{:fields=>[{:name=>:reason, :type=>"StatsQueryError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TargetingSettingDetail=>{:fields=>[{:name=>:criterion_type_group, :type=>"CriterionTypeGroup", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_all, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :TargetingSetting=>{:fields=>[{:name=>:details, :type=>"TargetingSettingDetail", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Setting"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :CpaBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CpcBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cpc_bid_source, :type=>"BidSource", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CpmBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cpm_bid_source, :type=>"BidSource", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PageOnePromotedBiddingScheme=>{:fields=>[{:name=>:strategy_goal, :type=>"PageOnePromotedBiddingScheme.StrategyGoal", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_budget_constrained, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :Setting=>{:fields=>[{:name=>:setting_type, :original_name=>"Setting.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :TargetCpaBiddingScheme=>{:fields=>[{:name=>:target_cpa, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetOutrankShareBiddingScheme=>{:fields=>[{:name=>:target_outrank_share, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:competitor_domain, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetRoasBiddingScheme=>{:fields=>[{:name=>:target_roas, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetSpendBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:spend_target, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :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}]}, :Bid=>{:fields=>[{:name=>:amount, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :BidMultiplier=>{:fields=>[{:name=>:multiplier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:multiplied_bid, :type=>"Bid", :min_occurs=>0, :max_occurs=>1}]}, :Bids=>{:fields=>[{:name=>:bids_type, :original_name=>"Bids.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BudgetOptimizerBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :Label=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Label.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_type, :original_name=>"Label.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ManualCPCAdGroupExperimentBidMultipliers=>{:fields=>[{:name=>:max_cpc_multiplier, :type=>"BidMultiplier", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_content_cpc_multiplier, :type=>"BidMultiplier", :min_occurs=>0, :max_occurs=>1}], :base=>"AdGroupExperimentBidMultipliers"}, :ManualCPMAdGroupExperimentBidMultipliers=>{:fields=>[{:name=>:max_cpm_multiplier, :type=>"BidMultiplier", :min_occurs=>0, :max_occurs=>1}], :base=>"AdGroupExperimentBidMultipliers"}, :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}]}, :AdGroupExperimentBidMultipliers=>{:fields=>[{:name=>:ad_group_experiment_bid_multipliers_type, :original_name=>"AdGroupExperimentBidMultipliers.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :AdGroupExperimentData=>{:fields=>[{:name=>:experiment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_delta_status, :type=>"ExperimentDeltaStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data_status, :type=>"ExperimentDataStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_bid_multipliers, :type=>"AdGroupExperimentBidMultipliers", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupLabelReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroupLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :BiddingScheme=>{:fields=>[{:name=>:bidding_scheme_type, :original_name=>"BiddingScheme.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BiddingStrategyConfiguration=>{:fields=>[{:name=>:bidding_strategy_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_type, :type=>"BiddingStrategyType", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_source, :type=>"BiddingStrategySource", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_scheme, :type=>"BiddingScheme", :min_occurs=>0, :max_occurs=>1}, {:name=>:bids, :type=>"Bids", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdGroup=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"AdGroup.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:settings, :type=>"Setting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:experiment_data, :type=>"AdGroupExperimentData", :min_occurs=>0, :max_occurs=>1}, {:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:bidding_strategy_configuration, :type=>"BiddingStrategyConfiguration", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_bid_criterion_type_group, :type=>"CriterionTypeGroup", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroup", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupPage=>{:fields=>[{:name=>:entries, :type=>"AdGroup", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :AdGroupReturnValue=>{:fields=>[{:name=>:value, :type=>"AdGroup", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AdGroupServiceError.Reason"=>{:fields=>[]}, :"AdGroup.Status"=>{:fields=>[]}, :"AdxError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :BidSource=>{:fields=>[]}, :"BiddingError.Reason"=>{:fields=>[]}, :"BiddingErrors.Reason"=>{:fields=>[]}, :BiddingStrategySource=>{:fields=>[]}, :BiddingStrategyType=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.BidType"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.PricingMode"=>{:fields=>[]}, :CriterionTypeGroup=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :ExperimentDataStatus=>{:fields=>[]}, :ExperimentDeltaStatus=>{:fields=>[]}, :"ExperimentError.Reason"=>{:fields=>[]}, :"ForwardCompatibilityError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"Label.Status"=>{:fields=>[]}, :"MultiplierError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PageOnePromotedBiddingScheme.StrategyGoal"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SettingError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StatsQueryError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}} + ADGROUPSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADGROUPSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADGROUPSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADGROUPSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdGroupServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_param_service.rb b/adwords_api/lib/adwords_api/v201502/ad_param_service.rb new file mode 100755 index 000000000..159ae1049 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_param_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:02. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/ad_param_service_registry' + +module AdwordsApi; module V201502; module AdParamService + class AdParamService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return AdParamServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdParamService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/ad_param_service_registry.rb b/adwords_api/lib/adwords_api/v201502/ad_param_service_registry.rb new file mode 100755 index 000000000..090d620a3 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/ad_param_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:02. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdParamService + class AdParamServiceRegistry + ADPARAMSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"AdParamPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"AdParamOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"AdParam", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + ADPARAMSERVICE_TYPES = {:AdParam=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:insertion_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:param_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :AdParamError=>{:fields=>[{:name=>:reason, :type=>"AdParamError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdParamOperation=>{:fields=>[{:name=>:operand, :type=>"AdParam", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdParamPage=>{:fields=>[{:name=>:entries, :type=>"AdParam", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:total_num_entries, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :AdParamPolicyError=>{:fields=>[], :base=>"PolicyViolationError"}, :AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.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"}, :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"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.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"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :"PolicyViolationError.Part"=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:length, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PolicyViolationKey=>{:fields=>[{:name=>:policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_text, :type=>"string", :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PolicyViolationError=>{:fields=>[{:name=>:key, :type=>"PolicyViolationKey", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_exemptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_parts, :type=>"PolicyViolationError.Part", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApiError"}, :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}]}, :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}]}, :"AdParamError.Reason"=>{:fields=>[]}, :"AdxError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + ADPARAMSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return ADPARAMSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADPARAMSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADPARAMSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdParamServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/adwords_user_list_service.rb b/adwords_api/lib/adwords_api/v201502/adwords_user_list_service.rb new file mode 100755 index 000000000..24f356b07 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/adwords_user_list_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:03. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/adwords_user_list_service_registry' + +module AdwordsApi; module V201502; module AdwordsUserListService + class AdwordsUserListService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/rm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return AdwordsUserListServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::AdwordsUserListService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/adwords_user_list_service_registry.rb b/adwords_api/lib/adwords_api/v201502/adwords_user_list_service_registry.rb new file mode 100755 index 000000000..aa9d72874 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/adwords_user_list_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:03. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module AdwordsUserListService + class AdwordsUserListServiceRegistry + ADWORDSUSERLISTSERVICE_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}]}}} + ADWORDSUSERLISTSERVICE_TYPES = {:AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateRange=>{:fields=>[{:name=>:min, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NotWhitelistedError=>{:fields=>[{:name=>:reason, :type=>"NotWhitelistedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OrderBy=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sort_order, :type=>"SortOrder", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :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}], :ns=>0}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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", :ns=>0}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SelectorError=>{:fields=>[{:name=>:reason, :type=>"SelectorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SoapHeader=>{:fields=>[{: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}], :ns=>0}, :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}], :ns=>0}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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, :ns=>0}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException", :ns=>0}, :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}], :ns=>0}, :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}], :ns=>0}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :ns=>0}, :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, :ns=>0}, :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, :ns=>0}, :"AuthenticationError.Reason"=>{:fields=>[], :ns=>0}, :"AuthorizationError.Reason"=>{:fields=>[], :ns=>0}, :"DatabaseError.Reason"=>{:fields=>[], :ns=>0}, :"DateError.Reason"=>{:fields=>[], :ns=>0}, :"DistinctError.Reason"=>{:fields=>[], :ns=>0}, :"EntityNotFound.Reason"=>{:fields=>[], :ns=>0}, :"InternalApiError.Reason"=>{:fields=>[], :ns=>0}, :"NotEmptyError.Reason"=>{:fields=>[], :ns=>0}, :"NotWhitelistedError.Reason"=>{:fields=>[], :ns=>0}, :"NullError.Reason"=>{:fields=>[], :ns=>0}, :"OperationAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :Operator=>{:fields=>[], :ns=>0}, :"OperatorError.Reason"=>{:fields=>[], :ns=>0}, :"Predicate.Operator"=>{:fields=>[], :ns=>0}, :"QuotaCheckError.Reason"=>{:fields=>[], :ns=>0}, :"RangeError.Reason"=>{:fields=>[], :ns=>0}, :"RateExceededError.Reason"=>{:fields=>[], :ns=>0}, :"ReadOnlyError.Reason"=>{:fields=>[], :ns=>0}, :"RejectedError.Reason"=>{:fields=>[], :ns=>0}, :"RequiredError.Reason"=>{:fields=>[], :ns=>0}, :"SelectorError.Reason"=>{:fields=>[], :ns=>0}, :"SizeLimitError.Reason"=>{:fields=>[], :ns=>0}, :SortOrder=>{:fields=>[], :ns=>0}, :"StringFormatError.Reason"=>{:fields=>[], :ns=>0}, :"StringLengthError.Reason"=>{:fields=>[], :ns=>0}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.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}]}, :DateKey=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateRuleItem=>{:fields=>[{:name=>:key, :type=>"DateKey", :min_occurs=>0, :max_occurs=>1}, {:name=>:op, :type=>"DateRuleItem.DateOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DateSpecificRuleUserList=>{:fields=>[{:name=>:rule, :type=>"Rule", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"RuleBasedUserList"}, :ExpressionRuleUserList=>{:fields=>[{:name=>:rule, :type=>"Rule", :min_occurs=>0, :max_occurs=>1}], :base=>"RuleBasedUserList"}, :LogicalUserList=>{:fields=>[{:name=>:rules, :type=>"UserListLogicalRule", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"UserList"}, :LogicalUserListOperand=>{:fields=>[], :choices=>[{:name=>:user_list, :original_name=>"UserList", :type=>"UserList", :min_occurs=>1, :max_occurs=>1}]}, :NumberKey=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :NumberRuleItem=>{:fields=>[{:name=>:key, :type=>"NumberKey", :min_occurs=>0, :max_occurs=>1}, {:name=>:op, :type=>"NumberRuleItem.NumberOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"double", :min_occurs=>0, :max_occurs=>1}]}, :BasicUserList=>{:fields=>[{:name=>:conversion_types, :type=>"UserListConversionType", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"UserList"}, :Rule=>{:fields=>[{:name=>:groups, :type=>"RuleItemGroup", :min_occurs=>0, :max_occurs=>:unbounded}]}, :RuleBasedUserList=>{:fields=>[], :base=>"UserList"}, :RuleItem=>{:fields=>[], :choices=>[{:name=>:date_rule_item, :original_name=>"DateRuleItem", :type=>"DateRuleItem", :min_occurs=>1, :max_occurs=>1}, {:name=>:number_rule_item, :original_name=>"NumberRuleItem", :type=>"NumberRuleItem", :min_occurs=>1, :max_occurs=>1}, {:name=>:string_rule_item, :original_name=>"StringRuleItem", :type=>"StringRuleItem", :min_occurs=>1, :max_occurs=>1}]}, :RuleItemGroup=>{:fields=>[{:name=>:items, :type=>"RuleItem", :min_occurs=>0, :max_occurs=>:unbounded}]}, :SimilarUserList=>{:fields=>[{:name=>:seed_user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:seed_user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:seed_user_list_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:seed_user_list_status, :type=>"UserListMembershipStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:seed_list_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"UserList"}, :StringKey=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :StringRuleItem=>{:fields=>[{:name=>:key, :type=>"StringKey", :min_occurs=>0, :max_occurs=>1}, {:name=>:op, :type=>"StringRuleItem.StringOperator", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :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=>:integration_code, :type=>"string", :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=>:size_for_search, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:size_range_for_search, :type=>"SizeRange", :min_occurs=>0, :max_occurs=>1}, {:name=>:list_type, :type=>"UserListType", :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=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"UserListConversionType.Category"=>{:fields=>[]}, :"DateRuleItem.DateOperator"=>{:fields=>[]}, :"NumberRuleItem.NumberOperator"=>{:fields=>[]}, :SizeRange=>{:fields=>[]}, :"StringRuleItem.StringOperator"=>{:fields=>[]}, :"UserListError.Reason"=>{:fields=>[]}, :"UserListLogicalRule.Operator"=>{:fields=>[]}, :UserListMembershipStatus=>{:fields=>[]}, :UserListType=>{:fields=>[]}} + ADWORDSUSERLISTSERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201502"] + + def self.get_method_signature(method_name) + return ADWORDSUSERLISTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return ADWORDSUSERLISTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return ADWORDSUSERLISTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, AdwordsUserListServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/bidding_strategy_service.rb b/adwords_api/lib/adwords_api/v201502/bidding_strategy_service.rb new file mode 100755 index 000000000..a9582102d --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/bidding_strategy_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:04. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/bidding_strategy_service_registry' + +module AdwordsApi; module V201502; module BiddingStrategyService + class BiddingStrategyService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return BiddingStrategyServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::BiddingStrategyService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/bidding_strategy_service_registry.rb b/adwords_api/lib/adwords_api/v201502/bidding_strategy_service_registry.rb new file mode 100755 index 000000000..4cfc1d5fd --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/bidding_strategy_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:04. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module BiddingStrategyService + class BiddingStrategyServiceRegistry + BIDDINGSTRATEGYSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"BiddingStrategyPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"BiddingStrategyOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"BiddingStrategyReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"BiddingStrategyPage", :min_occurs=>0, :max_occurs=>1}]}}} + BIDDINGSTRATEGYSERVICE_TYPES = {:AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :BiddingErrors=>{:fields=>[{:name=>:reason, :type=>"BiddingErrors.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BiddingStrategyError=>{:fields=>[{:name=>:reason, :type=>"BiddingStrategyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConversionOptimizerBiddingScheme=>{:fields=>[{:name=>:pricing_mode, :type=>"ConversionOptimizerBiddingScheme.PricingMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_type, :type=>"ConversionOptimizerBiddingScheme.BidType", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :EnhancedCpcBiddingScheme=>{:fields=>[], :base=>"BiddingScheme"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :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"}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :ManualCpcBiddingScheme=>{:fields=>[{:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :ManualCpmBiddingScheme=>{:fields=>[{:name=>:active_view_cpm_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PageOnePromotedBiddingScheme=>{:fields=>[{:name=>:strategy_goal, :type=>"PageOnePromotedBiddingScheme.StrategyGoal", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_budget_constrained, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetCpaBiddingScheme=>{:fields=>[{:name=>:target_cpa, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetOutrankShareBiddingScheme=>{:fields=>[{:name=>:target_outrank_share, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:competitor_domain, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetRoasBiddingScheme=>{:fields=>[{:name=>:target_roas, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetSpendBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:spend_target, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :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}]}, :BudgetOptimizerBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :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}]}, :BiddingScheme=>{:fields=>[{:name=>:bidding_scheme_type, :original_name=>"BiddingScheme.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :SharedBiddingStrategy=>{:fields=>[{:name=>:bidding_scheme, :type=>"BiddingScheme", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"SharedBiddingStrategy.BiddingStrategyStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"BiddingStrategyType", :min_occurs=>0, :max_occurs=>1}]}, :BiddingStrategyOperation=>{:fields=>[{:name=>:operand, :type=>"SharedBiddingStrategy", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :BiddingStrategyPage=>{:fields=>[{:name=>:entries, :type=>"SharedBiddingStrategy", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :BiddingStrategyReturnValue=>{:fields=>[{:name=>:value, :type=>"SharedBiddingStrategy", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AdxError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"BiddingErrors.Reason"=>{:fields=>[]}, :"SharedBiddingStrategy.BiddingStrategyStatus"=>{:fields=>[]}, :"BiddingStrategyError.Reason"=>{:fields=>[]}, :BiddingStrategyType=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.BidType"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.PricingMode"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"PageOnePromotedBiddingScheme.StrategyGoal"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + BIDDINGSTRATEGYSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return BIDDINGSTRATEGYSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return BIDDINGSTRATEGYSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return BIDDINGSTRATEGYSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, BiddingStrategyServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/budget_order_service.rb b/adwords_api/lib/adwords_api/v201502/budget_order_service.rb new file mode 100755 index 000000000..f5a21ea98 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/budget_order_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:05. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/budget_order_service_registry' + +module AdwordsApi; module V201502; module BudgetOrderService + class BudgetOrderService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/billing/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def get_billing_accounts(*args, &block) + return execute_action('get_billing_accounts', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return BudgetOrderServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::BudgetOrderService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/budget_order_service_registry.rb b/adwords_api/lib/adwords_api/v201502/budget_order_service_registry.rb new file mode 100755 index 000000000..91ba0fdf3 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/budget_order_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:05. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module BudgetOrderService + class BudgetOrderServiceRegistry + BUDGETORDERSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"BudgetOrderPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_billing_accounts=>{:input=>[], :output=>{:name=>"get_billing_accounts_response", :fields=>[{:name=>:rval, :type=>"BillingAccount", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"BudgetOrderOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"BudgetOrderReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + BUDGETORDERSERVICE_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, :ns=>0}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException", :ns=>0}, :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}], :ns=>0}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :ns=>0}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateRange=>{:fields=>[{:name=>:min, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue", :ns=>0}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :ns=>0}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue", :ns=>0}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue", :ns=>0}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NotWhitelistedError=>{:fields=>[{:name=>:reason, :type=>"NotWhitelistedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue", :ns=>0}, :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, :ns=>0}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OrderBy=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sort_order, :type=>"SortOrder", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :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, :ns=>0}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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}], :ns=>0}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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", :ns=>0}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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}], :ns=>0}, :SelectorError=>{:fields=>[{:name=>:reason, :type=>"SelectorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SoapHeader=>{:fields=>[{: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}], :ns=>0}, :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}], :ns=>0}, :StatsQueryError=>{:fields=>[{:name=>:reason, :type=>"StatsQueryError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :"AuthenticationError.Reason"=>{:fields=>[], :ns=>0}, :"AuthorizationError.Reason"=>{:fields=>[], :ns=>0}, :"ClientTermsError.Reason"=>{:fields=>[], :ns=>0}, :"DatabaseError.Reason"=>{:fields=>[], :ns=>0}, :"DateError.Reason"=>{:fields=>[], :ns=>0}, :"DistinctError.Reason"=>{:fields=>[], :ns=>0}, :"EntityNotFound.Reason"=>{:fields=>[], :ns=>0}, :"IdError.Reason"=>{:fields=>[], :ns=>0}, :"InternalApiError.Reason"=>{:fields=>[], :ns=>0}, :"NewEntityCreationError.Reason"=>{:fields=>[], :ns=>0}, :"NotEmptyError.Reason"=>{:fields=>[], :ns=>0}, :"NotWhitelistedError.Reason"=>{:fields=>[], :ns=>0}, :"NullError.Reason"=>{:fields=>[], :ns=>0}, :"OperationAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :Operator=>{:fields=>[], :ns=>0}, :"OperatorError.Reason"=>{:fields=>[], :ns=>0}, :"PagingError.Reason"=>{:fields=>[], :ns=>0}, :"Predicate.Operator"=>{:fields=>[], :ns=>0}, :"QuotaCheckError.Reason"=>{:fields=>[], :ns=>0}, :"RangeError.Reason"=>{:fields=>[], :ns=>0}, :"RateExceededError.Reason"=>{:fields=>[], :ns=>0}, :"ReadOnlyError.Reason"=>{:fields=>[], :ns=>0}, :"RejectedError.Reason"=>{:fields=>[], :ns=>0}, :"RequestError.Reason"=>{:fields=>[], :ns=>0}, :"RequiredError.Reason"=>{:fields=>[], :ns=>0}, :"SelectorError.Reason"=>{:fields=>[], :ns=>0}, :"SizeLimitError.Reason"=>{:fields=>[], :ns=>0}, :SortOrder=>{:fields=>[], :ns=>0}, :"StatsQueryError.Reason"=>{:fields=>[], :ns=>0}, :"StringLengthError.Reason"=>{:fields=>[], :ns=>0}, :BillingAccount=>{:fields=>[{:name=>:id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_billing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_billing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :BudgetOrder=>{:fields=>[{:name=>:billing_account_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_account_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:po_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget_order_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:primary_billing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:secondary_billing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:spending_limit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_request, :type=>"BudgetOrderRequest", :min_occurs=>0, :max_occurs=>1}]}, :BudgetOrderError=>{:fields=>[{:name=>:reason, :type=>"BudgetOrderError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BudgetOrderOperation=>{:fields=>[{:name=>:operand, :type=>"BudgetOrder", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :BudgetOrderPage=>{:fields=>[{:name=>:entries, :type=>"BudgetOrder", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :BudgetOrderRequest=>{:fields=>[{:name=>:status, :type=>"BudgetOrderRequest.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_account_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:po_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget_order_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:spending_limit, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :BudgetOrderReturnValue=>{:fields=>[{:name=>:value, :type=>"BudgetOrder", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :CustomerOrderLineError=>{:fields=>[{:name=>:reason, :type=>"CustomerOrderLineError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"BudgetOrderError.Reason"=>{:fields=>[]}, :"BudgetOrderRequest.Status"=>{:fields=>[]}, :"CustomerOrderLineError.Reason"=>{:fields=>[]}} + BUDGETORDERSERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201502"] + + def self.get_method_signature(method_name) + return BUDGETORDERSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return BUDGETORDERSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return BUDGETORDERSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, BudgetOrderServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/budget_service.rb b/adwords_api/lib/adwords_api/v201502/budget_service.rb new file mode 100755 index 000000000..e2ef0009d --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/budget_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:06. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/budget_service_registry' + +module AdwordsApi; module V201502; module BudgetService + class BudgetService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return BudgetServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::BudgetService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/budget_service_registry.rb b/adwords_api/lib/adwords_api/v201502/budget_service_registry.rb new file mode 100755 index 000000000..5cb569b77 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/budget_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:06. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module BudgetService + class BudgetServiceRegistry + BUDGETSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"BudgetPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"BudgetOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"BudgetReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"BudgetPage", :min_occurs=>0, :max_occurs=>1}]}}} + BUDGETSERVICE_TYPES = {: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"}, :BudgetError=>{:fields=>[{:name=>:reason, :type=>"BudgetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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}]}, :DateRangeError=>{:fields=>[{:name=>:reason, :type=>"DateRangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :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"}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :Budget=>{:fields=>[{:name=>:budget_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:period, :type=>"Budget.BudgetPeriod", :min_occurs=>0, :max_occurs=>1}, {:name=>:amount, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_method, :type=>"Budget.BudgetDeliveryMethod", :min_occurs=>0, :max_occurs=>1}, {:name=>:reference_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_explicitly_shared, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Budget.BudgetStatus", :min_occurs=>0, :max_occurs=>1}]}, :BudgetOperation=>{:fields=>[{:name=>:operand, :type=>"Budget", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :BudgetPage=>{:fields=>[{:name=>:entries, :type=>"Budget", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :BudgetReturnValue=>{:fields=>[{:name=>:value, :type=>"Budget", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"Budget.BudgetDeliveryMethod"=>{:fields=>[]}, :"Budget.BudgetPeriod"=>{:fields=>[]}, :"Budget.BudgetStatus"=>{:fields=>[]}, :"BudgetError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DateRangeError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + BUDGETSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return BUDGETSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return BUDGETSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return BUDGETSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, BudgetServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_criterion_service.rb b/adwords_api/lib/adwords_api/v201502/campaign_criterion_service.rb new file mode 100755 index 000000000..251b5233e --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_criterion_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:07. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/campaign_criterion_service_registry' + +module AdwordsApi; module V201502; module CampaignCriterionService + class CampaignCriterionService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return CampaignCriterionServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CampaignCriterionService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_criterion_service_registry.rb b/adwords_api/lib/adwords_api/v201502/campaign_criterion_service_registry.rb new file mode 100755 index 000000000..f1c388f78 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_criterion_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:07. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CampaignCriterionService + class CampaignCriterionServiceRegistry + CAMPAIGNCRITERIONSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CampaignCriterionPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CampaignCriterionOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CampaignCriterionReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"CampaignCriterionPage", :min_occurs=>0, :max_occurs=>1}]}}} + CAMPAIGNCRITERIONSERVICE_TYPES = {:AdSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Address=>{:fields=>[{:name=>:street_address, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:street_address2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:city_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:province_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:province_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:postal_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AgeRange=>{:fields=>[{:name=>:age_range_type, :type=>"AgeRange.AgeRangeType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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"}, :CampaignCriterion=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negative, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion, :type=>"Criterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:campaign_criterion_type, :original_name=>"CampaignCriterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CampaignCriterionError=>{:fields=>[{:name=>:reason, :type=>"CampaignCriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignCriterionOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignCriterion", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignCriterionPage=>{:fields=>[{:name=>:entries, :type=>"CampaignCriterion", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :CampaignCriterionReturnValue=>{:fields=>[{:name=>:value, :type=>"CampaignCriterion", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :Carrier=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConstantOperand=>{:fields=>[{:name=>:type, :type=>"ConstantOperand.ConstantType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit, :type=>"ConstantOperand.Unit", :min_occurs=>0, :max_occurs=>1}, {:name=>:long_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:boolean_value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:double_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:string_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :ContentLabel=>{:fields=>[{:name=>:content_label_type, :type=>"ContentLabelType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CriterionError=>{:fields=>[{:name=>:reason, :type=>"CriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CriterionParameter=>{:fields=>[{:name=>:criterion_parameter_type, :original_name=>"CriterionParameter.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Function=>{:fields=>[{:name=>:operator, :type=>"Function.Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:lhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:rhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:function_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :FunctionError=>{:fields=>[{:name=>:reason, :type=>"FunctionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Gender=>{:fields=>[{:name=>:gender_type, :type=>"Gender.GenderType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :GeoPoint=>{:fields=>[{:name=>:latitude_in_micro_degrees, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:longitude_in_micro_degrees, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :GeoTargetOperand=>{:fields=>[{:name=>:locations, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"FunctionArgumentOperand"}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :IncomeOperand=>{:fields=>[{:name=>:tier, :type=>"IncomeTier", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :IpBlock=>{:fields=>[{:name=>:ip_address, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Language=>{:fields=>[{:name=>:code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Location=>{:fields=>[{:name=>:location_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_status, :type=>"LocationTargetingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :LocationExtensionOperand=>{:fields=>[{:name=>:radius, :type=>"ConstantOperand", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileDevice=>{:fields=>[{:name=>:device_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:manufacturer_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_type, :type=>"MobileDevice.DeviceType", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :NegativeCampaignCriterion=>{:fields=>[], :base=>"CampaignCriterion"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FunctionArgumentOperand=>{:fields=>[{:name=>:function_argument_operand_type, :original_name=>"FunctionArgumentOperand.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :OperatingSystemVersion=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:operator_type, :type=>"OperatingSystemVersion.OperatorType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :PlacesOfInterestOperand=>{:fields=>[{:name=>:category, :type=>"PlacesOfInterestOperand.Category", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :Platform=>{:fields=>[{:name=>:platform_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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}]}, :ProductAdwordsGrouping=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductAdwordsLabels=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductBiddingCategory=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductBrand=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductCanonicalCondition=>{:fields=>[{:name=>:condition, :type=>"ProductCanonicalCondition.Condition", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductChannel=>{:fields=>[{:name=>:channel, :type=>"ShoppingProductChannel", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductChannelExclusivity=>{:fields=>[{:name=>:channel_exclusivity, :type=>"ShoppingProductChannelExclusivity", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductLegacyCondition=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductCustomAttribute=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductDimension=>{:fields=>[{:name=>:product_dimension_type, :original_name=>"ProductDimension.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ProductOfferId=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductScope=>{:fields=>[{:name=>:dimensions, :type=>"ProductDimension", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :ProductType=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductTypeFull=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :Proximity=>{:fields=>[{:name=>:geo_point, :type=>"GeoPoint", :min_occurs=>0, :max_occurs=>1}, {:name=>:radius_distance_units, :type=>"Proximity.DistanceUnits", :min_occurs=>0, :max_occurs=>1}, {:name=>:radius_in_units, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:address, :type=>"Address", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RegionCodeError=>{:fields=>[{:name=>:reason, :type=>"RegionCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :LocationGroups=>{:fields=>[{:name=>:matching_function, :type=>"Function", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :Webpage=>{:fields=>[{:name=>:parameter, :type=>"WebpageParameter", :min_occurs=>0, :max_occurs=>1}, {:name=>:criteria_coverage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:criteria_samples, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :WebpageCondition=>{:fields=>[{:name=>:operand, :type=>"WebpageConditionOperand", :min_occurs=>0, :max_occurs=>1}, {:name=>:argument, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :WebpageParameter=>{:fields=>[{:name=>:criterion_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:conditions, :type=>"WebpageCondition", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CriterionParameter"}, :YouTubeChannel=>{:fields=>[{:name=>:channel_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:channel_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :YouTubeVideo=>{:fields=>[{:name=>:video_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :"AdxError.Reason"=>{:fields=>[]}, :"AgeRange.AgeRangeType"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"CampaignCriterionError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"ConstantOperand.ConstantType"=>{:fields=>[]}, :"ConstantOperand.Unit"=>{:fields=>[]}, :ContentLabelType=>{:fields=>[]}, :"Criterion.Type"=>{:fields=>[]}, :"CriterionError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"Function.Operator"=>{:fields=>[]}, :"FunctionError.Reason"=>{:fields=>[]}, :"Gender.GenderType"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :IncomeTier=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :KeywordMatchType=>{:fields=>[]}, :LocationTargetingStatus=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"MobileDevice.DeviceType"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperatingSystemVersion.OperatorType"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"PlacesOfInterestOperand.Category"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"ProductCanonicalCondition.Condition"=>{:fields=>[]}, :ProductDimensionType=>{:fields=>[]}, :"Proximity.DistanceUnits"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RegionCodeError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :ShoppingProductChannel=>{:fields=>[]}, :ShoppingProductChannelExclusivity=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"CriterionUserList.MembershipStatus"=>{:fields=>[]}, :WebpageConditionOperand=>{:fields=>[]}} + CAMPAIGNCRITERIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CAMPAIGNCRITERIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CAMPAIGNCRITERIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CAMPAIGNCRITERIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CampaignCriterionServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_extension_setting_service.rb b/adwords_api/lib/adwords_api/v201502/campaign_extension_setting_service.rb new file mode 100755 index 000000000..8658174f2 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_extension_setting_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:09. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/campaign_extension_setting_service_registry' + +module AdwordsApi; module V201502; module CampaignExtensionSettingService + class CampaignExtensionSettingService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return CampaignExtensionSettingServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CampaignExtensionSettingService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_extension_setting_service_registry.rb b/adwords_api/lib/adwords_api/v201502/campaign_extension_setting_service_registry.rb new file mode 100755 index 000000000..fb4df155b --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_extension_setting_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:09. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CampaignExtensionSettingService + class CampaignExtensionSettingServiceRegistry + CAMPAIGNEXTENSIONSETTINGSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CampaignExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CampaignExtensionSettingOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CampaignExtensionSettingReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"CampaignExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}} + CAMPAIGNEXTENSIONSETTINGSERVICE_TYPES = {:AppFeedItem=>{:fields=>[{:name=>:app_store, :type=>"AppFeedItem.AppStore", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_link_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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"}, :CallConversionType=>{:fields=>[{:name=>:conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CallFeedItem=>{:fields=>[{:name=>:call_phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_tracking, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_conversion_type, :type=>"CallConversionType", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :CalloutFeedItem=>{:fields=>[{:name=>:callout_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExtensionSettingError=>{:fields=>[{:name=>:reason, :type=>"ExtensionSettingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItemDevicePreference=>{:fields=>[{:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemScheduling=>{:fields=>[{:name=>:feed_item_schedules, :type=>"FeedItemSchedule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ReviewFeedItem=>{:fields=>[{:name=>:review_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_text_exactly_quoted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlList=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SitelinkFeedItem=>{:fields=>[{:name=>:sitelink_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line3, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_mobile_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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}]}, :ExtensionFeedItem=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedItem.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_preference, :type=>"FeedItemDevicePreference", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduling, :type=>"FeedItemScheduling", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_feed_item_type, :original_name=>"ExtensionFeedItem.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ExtensionSetting=>{:fields=>[{:name=>:extensions, :type=>"ExtensionFeedItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:platform_restrictions, :type=>"ExtensionSetting.Platform", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :CampaignExtensionSetting=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_setting, :type=>"ExtensionSetting", :min_occurs=>0, :max_occurs=>1}]}, :CampaignExtensionSettingOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignExtensionSetting", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignExtensionSettingPage=>{:fields=>[{:name=>:entries, :type=>"CampaignExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :CampaignExtensionSettingReturnValue=>{:fields=>[{:name=>:value, :type=>"CampaignExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AppFeedItem.AppStore"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"ExtensionSetting.Platform"=>{:fields=>[]}, :"ExtensionSettingError.Reason"=>{:fields=>[]}, :"FeedItem.Status"=>{:fields=>[]}, :"Feed.Type"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}} + CAMPAIGNEXTENSIONSETTINGSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CAMPAIGNEXTENSIONSETTINGSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CAMPAIGNEXTENSIONSETTINGSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CAMPAIGNEXTENSIONSETTINGSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CampaignExtensionSettingServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_feed_service.rb b/adwords_api/lib/adwords_api/v201502/campaign_feed_service.rb new file mode 100755 index 000000000..b131e7077 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_feed_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:11. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/campaign_feed_service_registry' + +module AdwordsApi; module V201502; module CampaignFeedService + class CampaignFeedService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return CampaignFeedServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CampaignFeedService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_feed_service_registry.rb b/adwords_api/lib/adwords_api/v201502/campaign_feed_service_registry.rb new file mode 100755 index 000000000..7195a76ca --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_feed_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:11. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CampaignFeedService + class CampaignFeedServiceRegistry + CAMPAIGNFEEDSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CampaignFeedPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CampaignFeedOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CampaignFeedReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"CampaignFeedPage", :min_occurs=>0, :max_occurs=>1}]}}} + CAMPAIGNFEEDSERVICE_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"}, :CampaignFeed=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matching_function, :type=>"Function", :min_occurs=>0, :max_occurs=>1}, {:name=>:placeholder_types, :type=>"int", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:status, :type=>"CampaignFeed.Status", :min_occurs=>0, :max_occurs=>1}]}, :CampaignFeedError=>{:fields=>[{:name=>:reason, :type=>"CampaignFeedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignFeedOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignFeed", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignFeedPage=>{:fields=>[{:name=>:entries, :type=>"CampaignFeed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :CampaignFeedReturnValue=>{:fields=>[{:name=>:value, :type=>"CampaignFeed", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConstantOperand=>{:fields=>[{:name=>:type, :type=>"ConstantOperand.ConstantType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit, :type=>"ConstantOperand.Unit", :min_occurs=>0, :max_occurs=>1}, {:name=>:long_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:boolean_value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:double_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:string_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :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"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedAttributeOperand=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_attribute_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :Function=>{:fields=>[{:name=>:operator, :type=>"Function.Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:lhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:rhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:function_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :FunctionError=>{:fields=>[{:name=>:reason, :type=>"FunctionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FunctionOperand=>{:fields=>[{:name=>:value, :type=>"Function", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :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}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :FunctionArgumentOperand=>{:fields=>[{:name=>:function_argument_operand_type, :original_name=>"FunctionArgumentOperand.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequestContextOperand=>{:fields=>[{:name=>:context_type, :type=>"RequestContextOperand.ContextType", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"CampaignFeed.Status"=>{:fields=>[]}, :"CampaignFeedError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"ConstantOperand.ConstantType"=>{:fields=>[]}, :"ConstantOperand.Unit"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"Function.Operator"=>{:fields=>[]}, :"FunctionError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestContextOperand.ContextType"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CAMPAIGNFEEDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CAMPAIGNFEEDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CAMPAIGNFEEDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CAMPAIGNFEEDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CampaignFeedServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_service.rb b/adwords_api/lib/adwords_api/v201502/campaign_service.rb new file mode 100755 index 000000000..f1af06f61 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_service.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:12. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/campaign_service_registry' + +module AdwordsApi; module V201502; module CampaignService + class CampaignService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def mutate_label(*args, &block) + return execute_action('mutate_label', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return CampaignServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CampaignService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_service_registry.rb b/adwords_api/lib/adwords_api/v201502/campaign_service_registry.rb new file mode 100755 index 000000000..ce8b3e873 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:12. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CampaignService + class CampaignServiceRegistry + CAMPAIGNSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CampaignPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CampaignOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CampaignReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :mutate_label=>{:input=>[{:name=>:operations, :type=>"CampaignLabelOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_label_response", :fields=>[{:name=>:rval, :type=>"CampaignLabelReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"CampaignPage", :min_occurs=>0, :max_occurs=>1}]}}} + CAMPAIGNSERVICE_TYPES = {:AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :BiddingError=>{:fields=>[{:name=>:reason, :type=>"BiddingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BiddingErrors=>{:fields=>[{:name=>:reason, :type=>"BiddingErrors.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BiddingScheme=>{:fields=>[{:name=>:bidding_scheme_type, :original_name=>"BiddingScheme.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BiddingStrategyConfiguration=>{:fields=>[{:name=>:bidding_strategy_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_type, :type=>"BiddingStrategyType", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_source, :type=>"BiddingStrategySource", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_scheme, :type=>"BiddingScheme", :min_occurs=>0, :max_occurs=>1}, {:name=>:bids, :type=>"Bids", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Bids=>{:fields=>[{:name=>:bids_type, :original_name=>"Bids.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Budget=>{:fields=>[{:name=>:budget_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:period, :type=>"Budget.BudgetPeriod", :min_occurs=>0, :max_occurs=>1}, {:name=>:amount, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_method, :type=>"Budget.BudgetDeliveryMethod", :min_occurs=>0, :max_occurs=>1}, {:name=>:reference_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_explicitly_shared, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Budget.BudgetStatus", :min_occurs=>0, :max_occurs=>1}]}, :BudgetError=>{:fields=>[{:name=>:reason, :type=>"BudgetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BudgetOptimizerBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :Campaign=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CampaignStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:serving_status, :type=>"ServingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Budget", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_optimizer_eligibility, :type=>"ConversionOptimizerEligibility", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_serving_optimization_status, :type=>"AdServingOptimizationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_cap, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:settings, :type=>"Setting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:advertising_channel_type, :type=>"AdvertisingChannelType", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertising_channel_sub_type, :type=>"AdvertisingChannelSubType", :min_occurs=>0, :max_occurs=>1}, {:name=>:network_setting, :type=>"NetworkSetting", :min_occurs=>0, :max_occurs=>1}, {:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:bidding_strategy_configuration, :type=>"BiddingStrategyConfiguration", :min_occurs=>0, :max_occurs=>1}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}]}, :CampaignError=>{:fields=>[{:name=>:reason, :type=>"CampaignError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignLabel=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CampaignLabelOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignLabelReturnValue=>{:fields=>[{:name=>:value, :type=>"CampaignLabel", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :TextLabel=>{:fields=>[], :base=>"Label"}, :CampaignOperation=>{:fields=>[{:name=>:operand, :type=>"Campaign", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignPage=>{:fields=>[{:name=>:entries, :type=>"Campaign", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :CampaignReturnValue=>{:fields=>[{:name=>:value, :type=>"Campaign", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ConversionOptimizerBiddingScheme=>{:fields=>[{:name=>:pricing_mode, :type=>"ConversionOptimizerBiddingScheme.PricingMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_type, :type=>"ConversionOptimizerBiddingScheme.BidType", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :ConversionOptimizerEligibility=>{:fields=>[{:name=>:eligible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:rejection_reasons, :type=>"ConversionOptimizerEligibility.RejectionReason", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CpaBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CpcBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cpc_bid_source, :type=>"BidSource", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CpmBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cpm_bid_source, :type=>"BidSource", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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}]}, :DateRangeError=>{:fields=>[{:name=>:reason, :type=>"DateRangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :DynamicSearchAdsSetting=>{:fields=>[{:name=>:domain_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:language_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :EnhancedCpcBiddingScheme=>{:fields=>[], :base=>"BiddingScheme"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ForwardCompatibilityError=>{:fields=>[{:name=>:reason, :type=>"ForwardCompatibilityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:impressions, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}, {:name=>:level, :type=>"Level", :min_occurs=>0, :max_occurs=>1}]}, :GeoTargetTypeSetting=>{:fields=>[{:name=>:positive_geo_target_type, :type=>"GeoTargetTypeSetting.PositiveGeoTargetType", :min_occurs=>0, :max_occurs=>1}, {:name=>:negative_geo_target_type, :type=>"GeoTargetTypeSetting.NegativeGeoTargetType", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :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"}, :Label=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Label.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_type, :original_name=>"Label.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :ManualCpcBiddingScheme=>{:fields=>[{:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :ManualCpmBiddingScheme=>{:fields=>[{:name=>:active_view_cpm_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue"}, :NetworkSetting=>{:fields=>[{:name=>:target_google_search, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_search_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_content_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_partner_search_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue"}, :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"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}, :PageOnePromotedBiddingScheme=>{:fields=>[{:name=>:strategy_goal, :type=>"PageOnePromotedBiddingScheme.StrategyGoal", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_budget_constrained, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RealTimeBiddingSetting=>{:fields=>[{:name=>:opt_in, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :RegionCodeError=>{:fields=>[{:name=>:reason, :type=>"RegionCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :Setting=>{:fields=>[{:name=>:setting_type, :original_name=>"Setting.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :SettingError=>{:fields=>[{:name=>:reason, :type=>"SettingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ShoppingSetting=>{:fields=>[{:name=>:merchant_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:sales_country, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:enable_local, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{: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}]}, :StatsQueryError=>{:fields=>[{:name=>:reason, :type=>"StatsQueryError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TargetCpaBiddingScheme=>{:fields=>[{:name=>:target_cpa, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetError=>{:fields=>[{:name=>:reason, :type=>"TargetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TargetOutrankShareBiddingScheme=>{:fields=>[{:name=>:target_outrank_share, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:competitor_domain, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetRoasBiddingScheme=>{:fields=>[{:name=>:target_roas, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetSpendBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:spend_target, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TrackingSetting=>{:fields=>[{:name=>:tracking_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdServingOptimizationStatus=>{:fields=>[]}, :AdvertisingChannelSubType=>{:fields=>[]}, :AdvertisingChannelType=>{:fields=>[]}, :"AdxError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :BidSource=>{:fields=>[]}, :"BiddingError.Reason"=>{:fields=>[]}, :"BiddingErrors.Reason"=>{:fields=>[]}, :BiddingStrategySource=>{:fields=>[]}, :BiddingStrategyType=>{:fields=>[]}, :"Budget.BudgetDeliveryMethod"=>{:fields=>[]}, :"Budget.BudgetPeriod"=>{:fields=>[]}, :"Budget.BudgetStatus"=>{:fields=>[]}, :"BudgetError.Reason"=>{:fields=>[]}, :"CampaignError.Reason"=>{:fields=>[]}, :CampaignStatus=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.BidType"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.PricingMode"=>{:fields=>[]}, :"ConversionOptimizerEligibility.RejectionReason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DateRangeError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"ForwardCompatibilityError.Reason"=>{:fields=>[]}, :"GeoTargetTypeSetting.NegativeGeoTargetType"=>{:fields=>[]}, :"GeoTargetTypeSetting.PositiveGeoTargetType"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"Label.Status"=>{:fields=>[]}, :Level=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PageOnePromotedBiddingScheme.StrategyGoal"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RegionCodeError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :ServingStatus=>{:fields=>[]}, :"SettingError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StatsQueryError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"TargetError.Reason"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}} + CAMPAIGNSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CAMPAIGNSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CAMPAIGNSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CAMPAIGNSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CampaignServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_shared_set_service.rb b/adwords_api/lib/adwords_api/v201502/campaign_shared_set_service.rb new file mode 100755 index 000000000..cb249457b --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_shared_set_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:14. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/campaign_shared_set_service_registry' + +module AdwordsApi; module V201502; module CampaignSharedSetService + class CampaignSharedSetService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return CampaignSharedSetServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CampaignSharedSetService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/campaign_shared_set_service_registry.rb b/adwords_api/lib/adwords_api/v201502/campaign_shared_set_service_registry.rb new file mode 100755 index 000000000..37007c869 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/campaign_shared_set_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:14. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CampaignSharedSetService + class CampaignSharedSetServiceRegistry + CAMPAIGNSHAREDSETSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CampaignSharedSetPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CampaignSharedSetOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CampaignSharedSetReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + CAMPAIGNSHAREDSETSERVICE_TYPES = {: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"}, :CampaignSharedSet=>{:fields=>[{:name=>:shared_set_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:shared_set_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:shared_set_type, :type=>"SharedSetType", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CampaignSharedSet.Status", :min_occurs=>0, :max_occurs=>1}]}, :CampaignSharedSetError=>{:fields=>[{:name=>:reason, :type=>"CampaignSharedSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignSharedSetOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignSharedSet", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignSharedSetPage=>{:fields=>[{:name=>:entries, :type=>"CampaignSharedSet", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :CampaignSharedSetReturnValue=>{:fields=>[{:name=>:value, :type=>"CampaignSharedSet", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :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}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :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"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"CampaignSharedSet.Status"=>{:fields=>[]}, :"CampaignSharedSetError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :SharedSetType=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CAMPAIGNSHAREDSETSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CAMPAIGNSHAREDSETSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CAMPAIGNSHAREDSETSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CAMPAIGNSHAREDSETSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CampaignSharedSetServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/constant_data_service.rb b/adwords_api/lib/adwords_api/v201502/constant_data_service.rb new file mode 100755 index 000000000..f694cf323 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/constant_data_service.rb @@ -0,0 +1,66 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:15. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/constant_data_service_registry' + +module AdwordsApi; module V201502; module ConstantDataService + class ConstantDataService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get_age_range_criterion(*args, &block) + return execute_action('get_age_range_criterion', args, &block) + end + + def get_carrier_criterion(*args, &block) + return execute_action('get_carrier_criterion', args, &block) + end + + def get_gender_criterion(*args, &block) + return execute_action('get_gender_criterion', args, &block) + end + + def get_language_criterion(*args, &block) + return execute_action('get_language_criterion', args, &block) + end + + def get_mobile_device_criterion(*args, &block) + return execute_action('get_mobile_device_criterion', args, &block) + end + + def get_operating_system_version_criterion(*args, &block) + return execute_action('get_operating_system_version_criterion', args, &block) + end + + def get_product_bidding_category_data(*args, &block) + return execute_action('get_product_bidding_category_data', args, &block) + end + + def get_user_interest_criterion(*args, &block) + return execute_action('get_user_interest_criterion', args, &block) + end + + def get_vertical_criterion(*args, &block) + return execute_action('get_vertical_criterion', args, &block) + end + + private + + def get_service_registry() + return ConstantDataServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::ConstantDataService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/constant_data_service_registry.rb b/adwords_api/lib/adwords_api/v201502/constant_data_service_registry.rb new file mode 100755 index 000000000..1464e74cd --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/constant_data_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:15. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module ConstantDataService + class ConstantDataServiceRegistry + CONSTANTDATASERVICE_METHODS = {:get_age_range_criterion=>{:input=>[], :output=>{:name=>"get_age_range_criterion_response", :fields=>[{:name=>:rval, :type=>"AgeRange", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_carrier_criterion=>{:input=>[], :output=>{:name=>"get_carrier_criterion_response", :fields=>[{:name=>:rval, :type=>"Carrier", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_gender_criterion=>{:input=>[], :output=>{:name=>"get_gender_criterion_response", :fields=>[{:name=>:rval, :type=>"Gender", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_language_criterion=>{:input=>[], :output=>{:name=>"get_language_criterion_response", :fields=>[{:name=>:rval, :type=>"Language", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_mobile_device_criterion=>{:input=>[], :output=>{:name=>"get_mobile_device_criterion_response", :fields=>[{:name=>:rval, :type=>"MobileDevice", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_operating_system_version_criterion=>{:input=>[], :output=>{:name=>"get_operating_system_version_criterion_response", :fields=>[{:name=>:rval, :type=>"OperatingSystemVersion", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_product_bidding_category_data=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_product_bidding_category_data_response", :fields=>[{:name=>:rval, :type=>"ProductBiddingCategoryData", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_user_interest_criterion=>{:input=>[{:name=>:user_interest_taxonomy_type, :type=>"ConstantDataService.UserInterestTaxonomyType", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_user_interest_criterion_response", :fields=>[{:name=>:rval, :type=>"CriterionUserInterest", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_vertical_criterion=>{:input=>[], :output=>{:name=>"get_vertical_criterion_response", :fields=>[{:name=>:rval, :type=>"Vertical", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + CONSTANTDATASERVICE_TYPES = {:AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AgeRange=>{:fields=>[{:name=>:age_range_type, :type=>"AgeRange.AgeRangeType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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"}, :Carrier=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :Gender=>{:fields=>[{:name=>:gender_type, :type=>"Gender.GenderType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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"}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Language=>{:fields=>[{:name=>:code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileDevice=>{:fields=>[{:name=>:device_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:manufacturer_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_type, :type=>"MobileDevice.DeviceType", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatingSystemVersion=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:operator_type, :type=>"OperatingSystemVersion.OperatorType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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}]}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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}]}, :ProductAdwordsGrouping=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductAdwordsLabels=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductBiddingCategory=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductBrand=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductCanonicalCondition=>{:fields=>[{:name=>:condition, :type=>"ProductCanonicalCondition.Condition", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductChannel=>{:fields=>[{:name=>:channel, :type=>"ShoppingProductChannel", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductChannelExclusivity=>{:fields=>[{:name=>:channel_exclusivity, :type=>"ShoppingProductChannelExclusivity", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductLegacyCondition=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductCustomAttribute=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductOfferId=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductType=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductTypeFull=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ProductDimension=>{:fields=>[{:name=>:product_dimension_type, :original_name=>"ProductDimension.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}]}, :ProductBiddingCategoryData=>{:fields=>[{:name=>:dimension_value, :type=>"ProductBiddingCategory", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_dimension_value, :type=>"ProductBiddingCategory", :min_occurs=>0, :max_occurs=>1}, {:name=>:country, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ShoppingBiddingDimensionStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_value, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ConstantData"}, :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}]}, :ConstantData=>{:fields=>[{:name=>:constant_data_type, :original_name=>"ConstantData.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :"AdxError.Reason"=>{:fields=>[]}, :"AgeRange.AgeRangeType"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"ConstantDataService.UserInterestTaxonomyType"=>{:fields=>[]}, :"Criterion.Type"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"Gender.GenderType"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :KeywordMatchType=>{:fields=>[]}, :"MobileDevice.DeviceType"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperatingSystemVersion.OperatorType"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"ProductCanonicalCondition.Condition"=>{:fields=>[]}, :ProductDimensionType=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :ShoppingBiddingDimensionStatus=>{:fields=>[]}, :ShoppingProductChannel=>{:fields=>[]}, :ShoppingProductChannelExclusivity=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"CriterionUserList.MembershipStatus"=>{:fields=>[]}} + CONSTANTDATASERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CONSTANTDATASERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CONSTANTDATASERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CONSTANTDATASERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ConstantDataServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/conversion_tracker_service.rb b/adwords_api/lib/adwords_api/v201502/conversion_tracker_service.rb new file mode 100755 index 000000000..78f4aeedc --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/conversion_tracker_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:17. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/conversion_tracker_service_registry' + +module AdwordsApi; module V201502; module ConversionTrackerService + class ConversionTrackerService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return ConversionTrackerServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::ConversionTrackerService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/conversion_tracker_service_registry.rb b/adwords_api/lib/adwords_api/v201502/conversion_tracker_service_registry.rb new file mode 100755 index 000000000..655b25343 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/conversion_tracker_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:17. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module ConversionTrackerService + class ConversionTrackerServiceRegistry + CONVERSIONTRACKERSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"ConversionTrackerPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"ConversionTrackerOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"ConversionTrackerReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"ConversionTrackerPage", :min_occurs=>0, :max_occurs=>1}]}}} + CONVERSIONTRACKERSERVICE_TYPES = {:AdCallMetricsConversion=>{:fields=>[{:name=>:phone_call_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ConversionTracker"}, :AdWordsConversionTracker=>{:fields=>[{:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:markup_language, :type=>"AdWordsConversionTracker.MarkupLanguage", :min_occurs=>0, :max_occurs=>1}, {:name=>:text_format, :type=>"AdWordsConversionTracker.TextFormat", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_page_language, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:background_color, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_code_type, :type=>"AdWordsConversionTracker.TrackingCodeType", :min_occurs=>0, :max_occurs=>1}], :base=>"ConversionTracker"}, :AppConversion=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_platform, :type=>"AppConversion.AppPlatform", :min_occurs=>0, :max_occurs=>1}, {:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_conversion_type, :type=>"AppConversion.AppConversionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_postback_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ConversionTracker"}, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConversionTrackingError=>{:fields=>[{:name=>:reason, :type=>"ConversionTrackingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :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"}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UploadConversion=>{:fields=>[], :base=>"ConversionTracker"}, :WebsiteCallMetricsConversion=>{:fields=>[{:name=>:phone_call_duration, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ConversionTracker"}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ConversionTrackerStats=>{:fields=>[{:name=>:num_conversion_events, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_value, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:most_recent_conversion_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_converted_clicks, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :ConversionTracker=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:original_conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ConversionTracker.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:category, :type=>"ConversionTracker.Category", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_type_owner_customer_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:stats, :type=>"ConversionTrackerStats", :min_occurs=>0, :max_occurs=>1}, {:name=>:viewthrough_lookback_window, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_product_ads_chargeable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:product_ads_chargeable_conversion_window, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:ctc_lookback_window, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:counting_type, :type=>"ConversionDeduplicationMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:default_revenue_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:default_revenue_currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:always_use_default_revenue_value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:exclude_from_bidding, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_tracker_type, :original_name=>"ConversionTracker.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ConversionTrackerOperation=>{:fields=>[{:name=>:operand, :type=>"ConversionTracker", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :ConversionTrackerReturnValue=>{:fields=>[{:name=>:value, :type=>"ConversionTracker", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.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}, :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}, :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}]}, :ConversionTrackerPage=>{:fields=>[{:name=>:entries, :type=>"ConversionTracker", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NoStatsPage"}, :NoStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :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}, :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}]}, :"AdWordsConversionTracker.MarkupLanguage"=>{:fields=>[]}, :"AdWordsConversionTracker.TextFormat"=>{:fields=>[]}, :"AdWordsConversionTracker.TrackingCodeType"=>{:fields=>[]}, :"AppConversion.AppConversionType"=>{:fields=>[]}, :"AppConversion.AppPlatform"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :ConversionDeduplicationMode=>{:fields=>[]}, :"ConversionTracker.Category"=>{:fields=>[]}, :"ConversionTracker.Status"=>{:fields=>[]}, :"ConversionTrackingError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CONVERSIONTRACKERSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CONVERSIONTRACKERSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CONVERSIONTRACKERSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CONVERSIONTRACKERSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ConversionTrackerServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/customer_extension_setting_service.rb b/adwords_api/lib/adwords_api/v201502/customer_extension_setting_service.rb new file mode 100755 index 000000000..0dcbf145c --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/customer_extension_setting_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:19. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/customer_extension_setting_service_registry' + +module AdwordsApi; module V201502; module CustomerExtensionSettingService + class CustomerExtensionSettingService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return CustomerExtensionSettingServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CustomerExtensionSettingService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/customer_extension_setting_service_registry.rb b/adwords_api/lib/adwords_api/v201502/customer_extension_setting_service_registry.rb new file mode 100755 index 000000000..aaf726e4b --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/customer_extension_setting_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:19. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CustomerExtensionSettingService + class CustomerExtensionSettingServiceRegistry + CUSTOMEREXTENSIONSETTINGSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CustomerExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CustomerExtensionSettingOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CustomerExtensionSettingReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"CustomerExtensionSettingPage", :min_occurs=>0, :max_occurs=>1}]}}} + CUSTOMEREXTENSIONSETTINGSERVICE_TYPES = {:AppFeedItem=>{:fields=>[{:name=>:app_store, :type=>"AppFeedItem.AppStore", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_link_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:app_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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"}, :CallConversionType=>{:fields=>[{:name=>:conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CallFeedItem=>{:fields=>[{:name=>:call_phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_tracking, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_conversion_type, :type=>"CallConversionType", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :CalloutFeedItem=>{:fields=>[{:name=>:callout_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExtensionSettingError=>{:fields=>[{:name=>:reason, :type=>"ExtensionSettingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItemDevicePreference=>{:fields=>[{:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemScheduling=>{:fields=>[{:name=>:feed_item_schedules, :type=>"FeedItemSchedule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ReviewFeedItem=>{:fields=>[{:name=>:review_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:review_text_exactly_quoted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlList=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SitelinkFeedItem=>{:fields=>[{:name=>:sitelink_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_line3, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_final_mobile_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sitelink_url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}], :base=>"ExtensionFeedItem"}, :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}]}, :ExtensionFeedItem=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedItem.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_preference, :type=>"FeedItemDevicePreference", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduling, :type=>"FeedItemScheduling", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_feed_item_type, :original_name=>"ExtensionFeedItem.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ExtensionSetting=>{:fields=>[{:name=>:extensions, :type=>"ExtensionFeedItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:platform_restrictions, :type=>"ExtensionSetting.Platform", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :CustomerExtensionSetting=>{:fields=>[{:name=>:extension_type, :type=>"Feed.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:extension_setting, :type=>"ExtensionSetting", :min_occurs=>0, :max_occurs=>1}]}, :CustomerExtensionSettingOperation=>{:fields=>[{:name=>:operand, :type=>"CustomerExtensionSetting", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CustomerExtensionSettingPage=>{:fields=>[{:name=>:entries, :type=>"CustomerExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :CustomerExtensionSettingReturnValue=>{:fields=>[{:name=>:value, :type=>"CustomerExtensionSetting", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AppFeedItem.AppStore"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"ExtensionSetting.Platform"=>{:fields=>[]}, :"ExtensionSettingError.Reason"=>{:fields=>[]}, :"FeedItem.Status"=>{:fields=>[]}, :"Feed.Type"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}} + CUSTOMEREXTENSIONSETTINGSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CUSTOMEREXTENSIONSETTINGSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CUSTOMEREXTENSIONSETTINGSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CUSTOMEREXTENSIONSETTINGSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CustomerExtensionSettingServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/customer_feed_service.rb b/adwords_api/lib/adwords_api/v201502/customer_feed_service.rb new file mode 100755 index 000000000..507d5a936 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/customer_feed_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:20. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/customer_feed_service_registry' + +module AdwordsApi; module V201502; module CustomerFeedService + class CustomerFeedService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return CustomerFeedServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CustomerFeedService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/customer_feed_service_registry.rb b/adwords_api/lib/adwords_api/v201502/customer_feed_service_registry.rb new file mode 100755 index 000000000..64b7bd444 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/customer_feed_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:20. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CustomerFeedService + class CustomerFeedServiceRegistry + CUSTOMERFEEDSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CustomerFeedPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"CustomerFeedOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"CustomerFeedReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"CustomerFeedPage", :min_occurs=>0, :max_occurs=>1}]}}} + CUSTOMERFEEDSERVICE_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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ConstantOperand=>{:fields=>[{:name=>:type, :type=>"ConstantOperand.ConstantType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit, :type=>"ConstantOperand.Unit", :min_occurs=>0, :max_occurs=>1}, {:name=>:long_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:boolean_value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:double_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:string_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :CustomerFeed=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:matching_function, :type=>"Function", :min_occurs=>0, :max_occurs=>1}, {:name=>:placeholder_types, :type=>"int", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:status, :type=>"CustomerFeed.Status", :min_occurs=>0, :max_occurs=>1}]}, :CustomerFeedError=>{:fields=>[{:name=>:reason, :type=>"CustomerFeedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CustomerFeedOperation=>{:fields=>[{:name=>:operand, :type=>"CustomerFeed", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CustomerFeedPage=>{:fields=>[{:name=>:entries, :type=>"CustomerFeed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :CustomerFeedReturnValue=>{:fields=>[{:name=>:value, :type=>"CustomerFeed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :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"}, :FeedAttributeOperand=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_attribute_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :Function=>{:fields=>[{:name=>:operator, :type=>"Function.Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:lhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:rhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:function_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :FunctionError=>{:fields=>[{:name=>:reason, :type=>"FunctionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FunctionOperand=>{:fields=>[{:name=>:value, :type=>"Function", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :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}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :FunctionArgumentOperand=>{:fields=>[{:name=>:function_argument_operand_type, :original_name=>"FunctionArgumentOperand.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RequestContextOperand=>{:fields=>[{:name=>:context_type, :type=>"RequestContextOperand.ContextType", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"ConstantOperand.ConstantType"=>{:fields=>[]}, :"ConstantOperand.Unit"=>{:fields=>[]}, :"CustomerFeed.Status"=>{:fields=>[]}, :"CustomerFeedError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"Function.Operator"=>{:fields=>[]}, :"FunctionError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestContextOperand.ContextType"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + CUSTOMERFEEDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return CUSTOMERFEEDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CUSTOMERFEEDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CUSTOMERFEEDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CustomerFeedServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/customer_service.rb b/adwords_api/lib/adwords_api/v201502/customer_service.rb new file mode 100755 index 000000000..e1d633cc1 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/customer_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:21. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/customer_service_registry' + +module AdwordsApi; module V201502; module CustomerService + class CustomerService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/mcm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return CustomerServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CustomerService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/customer_service_registry.rb b/adwords_api/lib/adwords_api/v201502/customer_service_registry.rb new file mode 100755 index 000000000..8edc2d2ef --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/customer_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:21. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CustomerService + class CustomerServiceRegistry + CUSTOMERSERVICE_METHODS = {:get=>{:input=>[], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"Customer", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:customer, :type=>"Customer", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"Customer", :min_occurs=>0, :max_occurs=>1}]}}} + CUSTOMERSERVICE_TYPES = {:AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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", :ns=>0}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SoapHeader=>{:fields=>[{: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}], :ns=>0}, :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}], :ns=>0}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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, :ns=>0}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException", :ns=>0}, :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}], :ns=>0}, :"AuthenticationError.Reason"=>{:fields=>[], :ns=>0}, :"AuthorizationError.Reason"=>{:fields=>[], :ns=>0}, :"ClientTermsError.Reason"=>{:fields=>[], :ns=>0}, :ConversionDeduplicationMode=>{:fields=>[], :ns=>0}, :"DatabaseError.Reason"=>{:fields=>[], :ns=>0}, :"DistinctError.Reason"=>{:fields=>[], :ns=>0}, :"IdError.Reason"=>{:fields=>[], :ns=>0}, :"InternalApiError.Reason"=>{:fields=>[], :ns=>0}, :"NotEmptyError.Reason"=>{:fields=>[], :ns=>0}, :"NullError.Reason"=>{:fields=>[], :ns=>0}, :"OperationAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :"OperatorError.Reason"=>{:fields=>[], :ns=>0}, :"QuotaCheckError.Reason"=>{:fields=>[], :ns=>0}, :"RangeError.Reason"=>{:fields=>[], :ns=>0}, :"RateExceededError.Reason"=>{:fields=>[], :ns=>0}, :"ReadOnlyError.Reason"=>{:fields=>[], :ns=>0}, :"RejectedError.Reason"=>{:fields=>[], :ns=>0}, :"RequestError.Reason"=>{:fields=>[], :ns=>0}, :"RequiredError.Reason"=>{:fields=>[], :ns=>0}, :"SizeLimitError.Reason"=>{:fields=>[], :ns=>0}, :"StringLengthError.Reason"=>{:fields=>[], :ns=>0}, :"UrlError.Reason"=>{:fields=>[], :ns=>0}, :ConversionTrackingSettings=>{:fields=>[{:name=>:conversion_optimizer_mode, :type=>"ConversionDeduplicationMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:effective_conversion_tracking_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:uses_cross_account_conversion_tracking, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :RemarketingSettings=>{:fields=>[{:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Customer=>{:fields=>[{:name=>:customer_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:date_time_zone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:descriptive_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:company_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:can_manage_clients, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:test_account, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:auto_tagging_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_tracking_settings, :type=>"ConversionTrackingSettings", :min_occurs=>0, :max_occurs=>1}, {:name=>:remarketing_settings, :type=>"RemarketingSettings", :min_occurs=>0, :max_occurs=>1}]}} + CUSTOMERSERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201502"] + + def self.get_method_signature(method_name) + return CUSTOMERSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CUSTOMERSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CUSTOMERSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CustomerServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/customer_sync_service.rb b/adwords_api/lib/adwords_api/v201502/customer_sync_service.rb new file mode 100755 index 000000000..6e9db4ccc --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/customer_sync_service.rb @@ -0,0 +1,34 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:22. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/customer_sync_service_registry' + +module AdwordsApi; module V201502; module CustomerSyncService + class CustomerSyncService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/ch/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + private + + def get_service_registry() + return CustomerSyncServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::CustomerSyncService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/customer_sync_service_registry.rb b/adwords_api/lib/adwords_api/v201502/customer_sync_service_registry.rb new file mode 100755 index 000000000..3147c195a --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/customer_sync_service_registry.rb @@ -0,0 +1,47 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:22. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module CustomerSyncService + class CustomerSyncServiceRegistry + CUSTOMERSYNCSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"CustomerSyncSelector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"CustomerChangeData", :min_occurs=>0, :max_occurs=>1}]}}} + CUSTOMERSYNCSERVICE_TYPES = {:AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateTimeRange=>{:fields=>[{:name=>:min, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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", :ns=>0}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SoapHeader=>{:fields=>[{: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}], :ns=>0}, :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}], :ns=>0}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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, :ns=>0}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException", :ns=>0}, :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}], :ns=>0}, :"AuthenticationError.Reason"=>{:fields=>[], :ns=>0}, :"AuthorizationError.Reason"=>{:fields=>[], :ns=>0}, :"ClientTermsError.Reason"=>{:fields=>[], :ns=>0}, :"DatabaseError.Reason"=>{:fields=>[], :ns=>0}, :"DateError.Reason"=>{:fields=>[], :ns=>0}, :"DistinctError.Reason"=>{:fields=>[], :ns=>0}, :"IdError.Reason"=>{:fields=>[], :ns=>0}, :"InternalApiError.Reason"=>{:fields=>[], :ns=>0}, :"NotEmptyError.Reason"=>{:fields=>[], :ns=>0}, :"OperationAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :"QuotaCheckError.Reason"=>{:fields=>[], :ns=>0}, :"RangeError.Reason"=>{:fields=>[], :ns=>0}, :"RateExceededError.Reason"=>{:fields=>[], :ns=>0}, :"ReadOnlyError.Reason"=>{:fields=>[], :ns=>0}, :"RejectedError.Reason"=>{:fields=>[], :ns=>0}, :"RequestError.Reason"=>{:fields=>[], :ns=>0}, :"RequiredError.Reason"=>{:fields=>[], :ns=>0}, :"SizeLimitError.Reason"=>{:fields=>[], :ns=>0}, :"StringLengthError.Reason"=>{:fields=>[], :ns=>0}, :AdGroupChangeData=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_change_status, :type=>"ChangeStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:changed_ads, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:changed_criteria, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:removed_criteria, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:changed_feeds, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:removed_feeds, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:changed_ad_group_bid_modifier_criteria, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:removed_ad_group_bid_modifier_criteria, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CampaignChangeData=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_change_status, :type=>"ChangeStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:changed_ad_groups, :type=>"AdGroupChangeData", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:added_campaign_criteria, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:removed_campaign_criteria, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:added_ad_extensions, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:removed_ad_extensions, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:changed_feeds, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:removed_feeds, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CustomerSyncError=>{:fields=>[{:name=>:reason, :type=>"CustomerSyncError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedChangeData=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_change_status, :type=>"ChangeStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:changed_feed_items, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:removed_feed_items, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CustomerChangeData=>{:fields=>[{:name=>:changed_campaigns, :type=>"CampaignChangeData", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:changed_feeds, :type=>"FeedChangeData", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:last_change_timestamp, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomerSyncSelector=>{:fields=>[{:name=>:date_time_range, :type=>"DateTimeRange", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:feed_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ChangeStatus=>{:fields=>[]}, :"CustomerSyncError.Reason"=>{:fields=>[]}} + CUSTOMERSYNCSERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201502"] + + def self.get_method_signature(method_name) + return CUSTOMERSYNCSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return CUSTOMERSYNCSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return CUSTOMERSYNCSERVICE_NAMESPACES[index] + end + end + + # Indicates that this instance is a subtype of ApplicationException. + # Although this field is returned in the response, it is ignored on input + # and cannot be selected. Specify xsi:type instead. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, CustomerSyncServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/data_service.rb b/adwords_api/lib/adwords_api/v201502/data_service.rb new file mode 100755 index 000000000..f46f3b7b6 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/data_service.rb @@ -0,0 +1,54 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:22. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/data_service_registry' + +module AdwordsApi; module V201502; module DataService + class DataService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get_ad_group_bid_landscape(*args, &block) + return execute_action('get_ad_group_bid_landscape', args, &block) + end + + def get_criterion_bid_landscape(*args, &block) + return execute_action('get_criterion_bid_landscape', args, &block) + end + + def get_domain_category(*args, &block) + return execute_action('get_domain_category', args, &block) + end + + def query_ad_group_bid_landscape(*args, &block) + return execute_action('query_ad_group_bid_landscape', args, &block) + end + + def query_criterion_bid_landscape(*args, &block) + return execute_action('query_criterion_bid_landscape', args, &block) + end + + def query_domain_category(*args, &block) + return execute_action('query_domain_category', args, &block) + end + + private + + def get_service_registry() + return DataServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::DataService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/data_service_registry.rb b/adwords_api/lib/adwords_api/v201502/data_service_registry.rb new file mode 100755 index 000000000..f4a4635bc --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/data_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:22. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module DataService + class DataServiceRegistry + DATASERVICE_METHODS = {:get_ad_group_bid_landscape=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_ad_group_bid_landscape_response", :fields=>[{:name=>:rval, :type=>"AdGroupBidLandscapePage", :min_occurs=>0, :max_occurs=>1}]}}, :get_criterion_bid_landscape=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_criterion_bid_landscape_response", :fields=>[{:name=>:rval, :type=>"CriterionBidLandscapePage", :min_occurs=>0, :max_occurs=>1}]}}, :get_domain_category=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_domain_category_response", :fields=>[{:name=>:rval, :type=>"DomainCategoryPage", :min_occurs=>0, :max_occurs=>1}]}}, :query_ad_group_bid_landscape=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_ad_group_bid_landscape_response", :fields=>[{:name=>:rval, :type=>"AdGroupBidLandscapePage", :min_occurs=>0, :max_occurs=>1}]}}, :query_criterion_bid_landscape=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_criterion_bid_landscape_response", :fields=>[{:name=>:rval, :type=>"CriterionBidLandscapePage", :min_occurs=>0, :max_occurs=>1}]}}, :query_domain_category=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_domain_category_response", :fields=>[{:name=>:rval, :type=>"DomainCategoryPage", :min_occurs=>0, :max_occurs=>1}]}}} + DATASERVICE_TYPES = {:AdGroupBidLandscape=>{:fields=>[{:name=>:type, :type=>"AdGroupBidLandscape.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:landscape_current, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BidLandscape"}, :AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :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"}, :LevelOfDetail=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DataError=>{:fields=>[{:name=>:reason, :type=>"DataError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :CriterionBidLandscape=>{:fields=>[{:name=>:criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"BidLandscape"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DomainCategory=>{:fields=>[{:name=>:category, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:coverage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:domain_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:iso_language, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"DimensionProperties"}, :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}]}, :"BidLandscape.LandscapePoint"=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:impressions, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:promoted_impressions, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :BidLandscape=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:landscape_points, :type=>"BidLandscape.LandscapePoint", :min_occurs=>0, :max_occurs=>:unbounded}], :abstract=>true, :base=>"DataEntry"}, :DimensionProperties=>{:fields=>[{:name=>:level_of_detail, :type=>"LevelOfDetail", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :base=>"DataEntry"}, :DataEntry=>{:fields=>[{:name=>:data_entry_type, :original_name=>"DataEntry.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :AdGroupBidLandscapePage=>{:fields=>[{:name=>:entries, :type=>"AdGroupBidLandscape", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NoStatsPage"}, :CriterionBidLandscapePage=>{:fields=>[{:name=>:entries, :type=>"CriterionBidLandscape", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NoStatsPage"}, :DomainCategoryPage=>{:fields=>[{:name=>:entries, :type=>"DomainCategory", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :NoStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :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}, :"AdGroupBidLandscape.Type"=>{:fields=>[]}, :"AdxError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"DataError.Reason"=>{:fields=>[]}} + DATASERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return DATASERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return DATASERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return DATASERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, DataServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/experiment_service.rb b/adwords_api/lib/adwords_api/v201502/experiment_service.rb new file mode 100755 index 000000000..4a3e9020b --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/experiment_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:23. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/experiment_service_registry' + +module AdwordsApi; module V201502; module ExperimentService + class ExperimentService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return ExperimentServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::ExperimentService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/experiment_service_registry.rb b/adwords_api/lib/adwords_api/v201502/experiment_service_registry.rb new file mode 100755 index 000000000..db5204f8d --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/experiment_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:23. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module ExperimentService + class ExperimentServiceRegistry + EXPERIMENTSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"ExperimentPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"ExperimentOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"ExperimentReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + EXPERIMENTSERVICE_TYPES = {:AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :BudgetError=>{:fields=>[{:name=>:reason, :type=>"BudgetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :ExperimentServiceError=>{:fields=>[{:name=>:reason, :type=>"ExperimentServiceError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExperimentSummaryStats=>{:fields=>[{:name=>:ad_groups_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_criteria_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_ads_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :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"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Experiment=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:control_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"ExperimentStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:serving_status, :type=>"ExperimentServingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:query_percentage, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:last_modified_date_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_summary_stats, :type=>"ExperimentSummaryStats", :min_occurs=>0, :max_occurs=>1}]}, :ExperimentOperation=>{:fields=>[{:name=>:operand, :type=>"Experiment", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :ExperimentPage=>{:fields=>[{:name=>:entries, :type=>"Experiment", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :ExperimentReturnValue=>{:fields=>[{:name=>:value, :type=>"Experiment", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :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}]}, :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}]}, :"AdxError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"BudgetError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"ExperimentServiceError.Reason"=>{:fields=>[]}, :ExperimentServingStatus=>{:fields=>[]}, :ExperimentStatus=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + EXPERIMENTSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return EXPERIMENTSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return EXPERIMENTSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return EXPERIMENTSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ExperimentServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/feed_item_service.rb b/adwords_api/lib/adwords_api/v201502/feed_item_service.rb new file mode 100755 index 000000000..4030ccd16 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/feed_item_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:24. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/feed_item_service_registry' + +module AdwordsApi; module V201502; module FeedItemService + class FeedItemService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return FeedItemServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::FeedItemService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/feed_item_service_registry.rb b/adwords_api/lib/adwords_api/v201502/feed_item_service_registry.rb new file mode 100755 index 000000000..ce1526642 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/feed_item_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:24. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module FeedItemService + class FeedItemServiceRegistry + FEEDITEMSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"FeedItemPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"FeedItemOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"FeedItemReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"FeedItemPage", :min_occurs=>0, :max_occurs=>1}]}}} + FEEDITEMSERVICE_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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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}]}, :DisapprovalReason=>{:fields=>[{:name=>:short_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItem=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedItem.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:attribute_values, :type=>"FeedItemAttributeValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:policy_data, :type=>"FeedItemPolicyData", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:device_preference, :type=>"FeedItemDevicePreference", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduling, :type=>"FeedItemScheduling", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_targeting, :type=>"FeedItemCampaignTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_targeting, :type=>"FeedItemAdGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:keyword_targeting, :type=>"Keyword", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemAdGroupTargeting=>{:fields=>[{:name=>:targeting_ad_group_id, :original_name=>"TargetingAdGroupId", :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemAttributeError=>{:fields=>[{:name=>:feed_attribute_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:validation_error_code, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_information, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemAttributeValue=>{:fields=>[{:name=>:feed_attribute_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:integer_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:double_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:boolean_value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:string_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:integer_values, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:double_values, :type=>"double", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:boolean_values, :type=>"boolean", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:string_values, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :FeedItemCampaignTargeting=>{:fields=>[{:name=>:targeting_campaign_id, :original_name=>"TargetingCampaignId", :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemDevicePreference=>{:fields=>[{:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemError=>{:fields=>[{:name=>:reason, :type=>"FeedItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItemOperation=>{:fields=>[{:name=>:operand, :type=>"FeedItem", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :FeedItemPage=>{:fields=>[{:name=>:entries, :type=>"FeedItem", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :FeedItemPolicyData=>{:fields=>[{:name=>:placeholder_type, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_mapping_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:validation_status, :type=>"FeedItemValidationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"FeedItemApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:validation_errors, :type=>"FeedItemAttributeError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"PolicyData"}, :FeedItemReturnValue=>{:fields=>[{:name=>:value, :type=>"FeedItem", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :FeedItemSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemScheduling=>{:fields=>[{:name=>:feed_item_schedules, :type=>"FeedItemSchedule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Location=>{:fields=>[{:name=>:location_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_status, :type=>"LocationTargetingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :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}]}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :PolicyData=>{:fields=>[{:name=>:disapproval_reasons, :type=>"DisapprovalReason", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:policy_data_type, :original_name=>"PolicyData.Type", :type=>"string", :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"Criterion.Type"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"FeedItem.Status"=>{:fields=>[]}, :FeedItemApprovalStatus=>{:fields=>[]}, :"FeedItemError.Reason"=>{:fields=>[]}, :FeedItemValidationStatus=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :KeywordMatchType=>{:fields=>[]}, :LocationTargetingStatus=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}, :"CriterionUserList.MembershipStatus"=>{:fields=>[]}} + FEEDITEMSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return FEEDITEMSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return FEEDITEMSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return FEEDITEMSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, FeedItemServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/feed_mapping_service.rb b/adwords_api/lib/adwords_api/v201502/feed_mapping_service.rb new file mode 100755 index 000000000..bd2dd1366 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/feed_mapping_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:26. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/feed_mapping_service_registry' + +module AdwordsApi; module V201502; module FeedMappingService + class FeedMappingService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return FeedMappingServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::FeedMappingService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/feed_mapping_service_registry.rb b/adwords_api/lib/adwords_api/v201502/feed_mapping_service_registry.rb new file mode 100755 index 000000000..4101de532 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/feed_mapping_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:26. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module FeedMappingService + class FeedMappingServiceRegistry + FEEDMAPPINGSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"FeedMappingPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"FeedMappingOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"FeedMappingReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"FeedMappingPage", :min_occurs=>0, :max_occurs=>1}]}}} + FEEDMAPPINGSERVICE_TYPES = {:AttributeFieldMapping=>{:fields=>[{:name=>:feed_attribute_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_id, :type=>"int", :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.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"}, :FeedMapping=>{:fields=>[{:name=>:feed_mapping_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:placeholder_type, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedMapping.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:attribute_field_mappings, :type=>"AttributeFieldMapping", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:criterion_type, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :FeedMappingError=>{:fields=>[{:name=>:reason, :type=>"FeedMappingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedMappingOperation=>{:fields=>[{:name=>:operand, :type=>"FeedMapping", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :FeedMappingPage=>{:fields=>[{:name=>:entries, :type=>"FeedMapping", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :FeedMappingReturnValue=>{:fields=>[{:name=>:value, :type=>"FeedMapping", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :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}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :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"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"FeedMapping.Status"=>{:fields=>[]}, :"FeedMappingError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + FEEDMAPPINGSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return FEEDMAPPINGSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return FEEDMAPPINGSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return FEEDMAPPINGSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, FeedMappingServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/feed_service.rb b/adwords_api/lib/adwords_api/v201502/feed_service.rb new file mode 100755 index 000000000..52ff17054 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/feed_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:27. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/feed_service_registry' + +module AdwordsApi; module V201502; module FeedService + class FeedService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return FeedServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::FeedService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/feed_service_registry.rb b/adwords_api/lib/adwords_api/v201502/feed_service_registry.rb new file mode 100755 index 000000000..8a45f5a07 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/feed_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:27. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module FeedService + class FeedServiceRegistry + FEEDSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"FeedPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"FeedOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"FeedReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"FeedPage", :min_occurs=>0, :max_occurs=>1}]}}} + FEEDSERVICE_TYPES = {: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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.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"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedAttribute=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"FeedAttribute.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_part_of_key, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :FeedError=>{:fields=>[{:name=>:reason, :type=>"FeedError.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"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OAuthInfo=>{:fields=>[{:name=>:http_method, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:http_request_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:http_authorization_header, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlacesLocationFeedData=>{:fields=>[{:name=>:o_auth_info, :type=>"OAuthInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:email_address, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:business_account_identifier, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:business_name_filter, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:category_filters, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"SystemFeedGenerationData"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SystemFeedGenerationData=>{:fields=>[{:name=>:system_feed_generation_data_type, :original_name=>"SystemFeedGenerationData.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :Feed=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:attributes, :type=>"FeedAttribute", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:status, :type=>"Feed.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:origin, :type=>"Feed.Origin", :min_occurs=>0, :max_occurs=>1}, {:name=>:system_feed_generation_data, :type=>"SystemFeedGenerationData", :min_occurs=>0, :max_occurs=>1}]}, :FeedOperation=>{:fields=>[{:name=>:operand, :type=>"Feed", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :FeedPage=>{:fields=>[{:name=>:entries, :type=>"Feed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :FeedReturnValue=>{:fields=>[{:name=>:value, :type=>"Feed", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :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}, :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}, :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}]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"Feed.Origin"=>{:fields=>[]}, :"Feed.Status"=>{:fields=>[]}, :"FeedAttribute.Type"=>{:fields=>[]}, :"FeedError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + FEEDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return FEEDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return FEEDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return FEEDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, FeedServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/geo_location_service.rb b/adwords_api/lib/adwords_api/v201502/geo_location_service.rb new file mode 100755 index 000000000..4a953ed13 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/geo_location_service.rb @@ -0,0 +1,34 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:28. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/geo_location_service_registry' + +module AdwordsApi; module V201502; module GeoLocationService + class GeoLocationService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + private + + def get_service_registry() + return GeoLocationServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::GeoLocationService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/geo_location_service_registry.rb b/adwords_api/lib/adwords_api/v201502/geo_location_service_registry.rb new file mode 100755 index 000000000..bf2381d7e --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/geo_location_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:28. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module GeoLocationService + class GeoLocationServiceRegistry + GEOLOCATIONSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"GeoLocationSelector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"GeoLocation", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + GEOLOCATIONSERVICE_TYPES = {:Address=>{:fields=>[{:name=>:street_address, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:street_address2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:city_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:province_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:province_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:postal_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoLocationError=>{:fields=>[{:name=>:reason, :type=>"GeoLocationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoLocationSelector=>{:fields=>[{:name=>:addresses, :type=>"Address", :min_occurs=>0, :max_occurs=>:unbounded}]}, :GeoPoint=>{:fields=>[{:name=>:latitude_in_micro_degrees, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:longitude_in_micro_degrees, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :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"}, :InvalidGeoLocation=>{:fields=>[], :base=>"GeoLocation"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RegionCodeError=>{:fields=>[{:name=>:reason, :type=>"RegionCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :GeoLocation=>{:fields=>[{:name=>:geo_point, :type=>"GeoPoint", :min_occurs=>0, :max_occurs=>1}, {:name=>:address, :type=>"Address", :min_occurs=>0, :max_occurs=>1}, {:name=>:encoded_location, :type=>"base64Binary", :min_occurs=>0, :max_occurs=>1}, {:name=>:geo_location_type, :original_name=>"GeoLocation.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :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.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"GeoLocationError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RegionCodeError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + GEOLOCATIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return GEOLOCATIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return GEOLOCATIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return GEOLOCATIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, GeoLocationServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/label_service.rb b/adwords_api/lib/adwords_api/v201502/label_service.rb new file mode 100755 index 000000000..30b4494ed --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/label_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:29. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/label_service_registry' + +module AdwordsApi; module V201502; module LabelService + class LabelService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return LabelServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::LabelService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/label_service_registry.rb b/adwords_api/lib/adwords_api/v201502/label_service_registry.rb new file mode 100755 index 000000000..0dfef9899 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/label_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:29. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module LabelService + class LabelServiceRegistry + LABELSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"LabelPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"LabelOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"LabelReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"LabelPage", :min_occurs=>0, :max_occurs=>1}]}}} + LABELSERVICE_TYPES = {: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"}, :TextLabel=>{:fields=>[], :base=>"Label"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.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"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :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"}, :LabelError=>{:fields=>[{:name=>:reason, :type=>"LabelError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :Label=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Label.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_type, :original_name=>"Label.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :LabelOperation=>{:fields=>[{:name=>:operand, :type=>"Label", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :LabelPage=>{:fields=>[{:name=>:entries, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NoStatsPage"}, :LabelReturnValue=>{:fields=>[{:name=>:value, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :NoStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :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}, :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}, :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}]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"Label.Status"=>{:fields=>[]}, :"LabelError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + LABELSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return LABELSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return LABELSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return LABELSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, LabelServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/location_criterion_service.rb b/adwords_api/lib/adwords_api/v201502/location_criterion_service.rb new file mode 100755 index 000000000..1d2013298 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/location_criterion_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:30. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/location_criterion_service_registry' + +module AdwordsApi; module V201502; module LocationCriterionService + class LocationCriterionService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + private + + def get_service_registry() + return LocationCriterionServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::LocationCriterionService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/location_criterion_service_registry.rb b/adwords_api/lib/adwords_api/v201502/location_criterion_service_registry.rb new file mode 100755 index 000000000..b5b989650 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/location_criterion_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:30. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module LocationCriterionService + class LocationCriterionServiceRegistry + LOCATIONCRITERIONSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"LocationCriterion", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"LocationCriterion", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + LOCATIONCRITERIONSERVICE_TYPES = {:AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Date=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:day, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateRange=>{:fields=>[{:name=>:min, :type=>"Date", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"Date", :min_occurs=>0, :max_occurs=>1}]}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.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"}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Location=>{:fields=>[{:name=>:location_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_status, :type=>"LocationTargetingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :LocationCriterion=>{:fields=>[{:name=>:location, :type=>"Location", :min_occurs=>0, :max_occurs=>1}, {:name=>:canonical_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:reach, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:locale, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:search_term, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :LocationCriterionServiceError=>{:fields=>[{:name=>:reason, :type=>"LocationCriterionServiceError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :"AdxError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"Criterion.Type"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :KeywordMatchType=>{:fields=>[]}, :"LocationCriterionServiceError.Reason"=>{:fields=>[]}, :LocationTargetingStatus=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"CriterionUserList.MembershipStatus"=>{:fields=>[]}} + LOCATIONCRITERIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return LOCATIONCRITERIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return LOCATIONCRITERIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return LOCATIONCRITERIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, LocationCriterionServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/managed_customer_service.rb b/adwords_api/lib/adwords_api/v201502/managed_customer_service.rb new file mode 100755 index 000000000..dcc1b358b --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/managed_customer_service.rb @@ -0,0 +1,54 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:31. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/managed_customer_service_registry' + +module AdwordsApi; module V201502; module ManagedCustomerService + class ManagedCustomerService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/mcm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def get_pending_invitations(*args, &block) + return execute_action('get_pending_invitations', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + def mutate_label(*args, &block) + return execute_action('mutate_label', args, &block) + end + + def mutate_link(*args, &block) + return execute_action('mutate_link', args, &block) + end + + def mutate_manager(*args, &block) + return execute_action('mutate_manager', args, &block) + end + + private + + def get_service_registry() + return ManagedCustomerServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::ManagedCustomerService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/managed_customer_service_registry.rb b/adwords_api/lib/adwords_api/v201502/managed_customer_service_registry.rb new file mode 100755 index 000000000..7efd9b40e --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/managed_customer_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:31. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module ManagedCustomerService + class ManagedCustomerServiceRegistry + MANAGEDCUSTOMERSERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"ManagedCustomerPage", :min_occurs=>0, :max_occurs=>1}]}}, :get_pending_invitations=>{:input=>[{:name=>:selector, :type=>"PendingInvitationSelector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_pending_invitations_response", :fields=>[{:name=>:rval, :type=>"PendingInvitation", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"ManagedCustomerOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"ManagedCustomerReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :mutate_label=>{:input=>[{:name=>:operations, :type=>"ManagedCustomerLabelOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_label_response", :fields=>[{:name=>:rval, :type=>"ManagedCustomerLabelReturnValue", :min_occurs=>0, :max_occurs=>1}]}}, :mutate_link=>{:input=>[{:name=>:operations, :type=>"LinkOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_link_response", :fields=>[{:name=>:rval, :type=>"MutateLinkResults", :min_occurs=>0, :max_occurs=>1}]}}, :mutate_manager=>{:input=>[{:name=>:operations, :type=>"MoveOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_manager_response", :fields=>[{:name=>:rval, :type=>"MutateManagerResults", :min_occurs=>0, :max_occurs=>1}]}}} + MANAGEDCUSTOMERSERVICE_TYPES = {:AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateRange=>{:fields=>[{:name=>:min, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OrderBy=>{:fields=>[{:name=>:field, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:sort_order, :type=>"SortOrder", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :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}], :ns=>0}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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", :ns=>0}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SelectorError=>{:fields=>[{:name=>:reason, :type=>"SelectorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SoapHeader=>{:fields=>[{: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}], :ns=>0}, :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}], :ns=>0}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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, :ns=>0}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException", :ns=>0}, :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}], :ns=>0}, :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}], :ns=>0}, :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, :ns=>0}, :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, :ns=>0}, :"AuthenticationError.Reason"=>{:fields=>[], :ns=>0}, :"AuthorizationError.Reason"=>{:fields=>[], :ns=>0}, :"ClientTermsError.Reason"=>{:fields=>[], :ns=>0}, :"DatabaseError.Reason"=>{:fields=>[], :ns=>0}, :"DateError.Reason"=>{:fields=>[], :ns=>0}, :"DistinctError.Reason"=>{:fields=>[], :ns=>0}, :"IdError.Reason"=>{:fields=>[], :ns=>0}, :"InternalApiError.Reason"=>{:fields=>[], :ns=>0}, :"NotEmptyError.Reason"=>{:fields=>[], :ns=>0}, :"NullError.Reason"=>{:fields=>[], :ns=>0}, :"OperationAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :Operator=>{:fields=>[], :ns=>0}, :"OperatorError.Reason"=>{:fields=>[], :ns=>0}, :"Predicate.Operator"=>{:fields=>[], :ns=>0}, :"QuotaCheckError.Reason"=>{:fields=>[], :ns=>0}, :"RangeError.Reason"=>{:fields=>[], :ns=>0}, :"RateExceededError.Reason"=>{:fields=>[], :ns=>0}, :"ReadOnlyError.Reason"=>{:fields=>[], :ns=>0}, :"RejectedError.Reason"=>{:fields=>[], :ns=>0}, :"RequestError.Reason"=>{:fields=>[], :ns=>0}, :"RequiredError.Reason"=>{:fields=>[], :ns=>0}, :"SelectorError.Reason"=>{:fields=>[], :ns=>0}, :"SizeLimitError.Reason"=>{:fields=>[], :ns=>0}, :SortOrder=>{:fields=>[], :ns=>0}, :"StringLengthError.Reason"=>{:fields=>[], :ns=>0}, :ManagedCustomerLabel=>{:fields=>[{:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:customer_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :ManagedCustomerLabelOperation=>{:fields=>[{:name=>:operand, :type=>"ManagedCustomerLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :ManagedCustomerLabelReturnValue=>{:fields=>[{:name=>:value, :type=>"ManagedCustomerLabel", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ManagedCustomerServiceError=>{:fields=>[{:name=>:reason, :type=>"ManagedCustomerServiceError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:customer_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApiError"}, :PendingInvitationSelector=>{:fields=>[{:name=>:manager_customer_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:client_customer_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AccountLabel=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ManagedCustomerLink=>{:fields=>[{:name=>:manager_customer_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:client_customer_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:link_status, :type=>"LinkStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:pending_descriptive_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :LinkOperation=>{:fields=>[{:name=>:operand, :type=>"ManagedCustomerLink", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :MoveOperation=>{:fields=>[{:name=>:operand, :type=>"ManagedCustomerLink", :min_occurs=>0, :max_occurs=>1}, {:name=>:old_manager_customer_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :MutateLinkResults=>{:fields=>[{:name=>:links, :type=>"ManagedCustomerLink", :min_occurs=>0, :max_occurs=>:unbounded}]}, :MutateManagerResults=>{:fields=>[{:name=>:links, :type=>"ManagedCustomerLink", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ManagedCustomer=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:company_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:customer_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:can_manage_clients, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:date_time_zone, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:test_account, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_labels, :type=>"AccountLabel", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ManagedCustomerOperation=>{:fields=>[{:name=>:operand, :type=>"ManagedCustomer", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :ManagedCustomerPage=>{:fields=>[{:name=>:entries, :type=>"ManagedCustomer", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:links, :type=>"ManagedCustomerLink", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :ManagedCustomerReturnValue=>{:fields=>[{:name=>:value, :type=>"ManagedCustomer", :min_occurs=>0, :max_occurs=>:unbounded}]}, :PendingInvitation=>{:fields=>[{:name=>:manager, :type=>"ManagedCustomer", :min_occurs=>0, :max_occurs=>1}, {:name=>:client, :type=>"ManagedCustomer", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:expiration_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :LinkStatus=>{:fields=>[]}, :"ManagedCustomerServiceError.Reason"=>{:fields=>[]}} + MANAGEDCUSTOMERSERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201502"] + + def self.get_method_signature(method_name) + return MANAGEDCUSTOMERSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return MANAGEDCUSTOMERSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return MANAGEDCUSTOMERSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ManagedCustomerServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/media_service.rb b/adwords_api/lib/adwords_api/v201502/media_service.rb new file mode 100755 index 000000000..dede0f490 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/media_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:32. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/media_service_registry' + +module AdwordsApi; module V201502; module MediaService + class MediaService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def query(*args, &block) + return execute_action('query', args, &block) + end + + def upload(*args, &block) + return execute_action('upload', args, &block) + end + + private + + def get_service_registry() + return MediaServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::MediaService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/media_service_registry.rb b/adwords_api/lib/adwords_api/v201502/media_service_registry.rb new file mode 100755 index 000000000..6a9657f81 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/media_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:32. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module MediaService + class MediaServiceRegistry + MEDIASERVICE_METHODS = {:get=>{:input=>[{:name=>:service_selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"MediaPage", :min_occurs=>0, :max_occurs=>1}]}}, :query=>{:input=>[{:name=>:query, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"query_response", :fields=>[{:name=>:rval, :type=>"MediaPage", :min_occurs=>0, :max_occurs=>1}]}}, :upload=>{:input=>[{:name=>:media, :type=>"Media", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"upload_response", :fields=>[{:name=>:rval, :type=>"Media", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + MEDIASERVICE_TYPES = {:Audio=>{:fields=>[{:name=>:duration_millis, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:streaming_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ready_to_play_on_the_web, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :AudioError=>{:fields=>[{:name=>:reason, :type=>"AudioError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.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}]}, :Dimensions=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :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"}, :Image=>{:fields=>[{:name=>:data, :type=>"base64Binary", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :MediaError=>{:fields=>[{:name=>:reason, :type=>"MediaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Media_Size_DimensionsMapEntry=>{:fields=>[{:name=>:key, :type=>"Media.Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Dimensions", :min_occurs=>0, :max_occurs=>1}]}, :Media_Size_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"Media.Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Video=>{:fields=>[{:name=>:duration_millis, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:streaming_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ready_to_play_on_the_web, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:industry_standard_commercial_identifier, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertising_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:you_tube_video_id_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :VideoError=>{:fields=>[{:name=>:reason, :type=>"VideoError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :Media=>{:fields=>[{:name=>:media_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Media.MediaType", :min_occurs=>0, :max_occurs=>1}, {:name=>:reference_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:dimensions, :type=>"Media_Size_DimensionsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:urls, :type=>"Media_Size_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mime_type, :type=>"Media.MimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:media_type, :original_name=>"Media.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MediaPage=>{:fields=>[{:name=>:entries, :type=>"Media", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:total_num_entries, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :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}]}, :"AudioError.Reason"=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"Media.MediaType"=>{:fields=>[]}, :"Media.MimeType"=>{:fields=>[]}, :"Media.Size"=>{:fields=>[]}, :"MediaError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"VideoError.Reason"=>{:fields=>[]}} + MEDIASERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return MEDIASERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return MEDIASERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return MEDIASERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, MediaServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/mutate_job_service.rb b/adwords_api/lib/adwords_api/v201502/mutate_job_service.rb new file mode 100755 index 000000000..fca187486 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/mutate_job_service.rb @@ -0,0 +1,42 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:34. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/mutate_job_service_registry' + +module AdwordsApi; module V201502; module MutateJobService + class MutateJobService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def get_result(*args, &block) + return execute_action('get_result', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return MutateJobServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::MutateJobService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/mutate_job_service_registry.rb b/adwords_api/lib/adwords_api/v201502/mutate_job_service_registry.rb new file mode 100755 index 000000000..eaa8e4b9d --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/mutate_job_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:34. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module MutateJobService + class MutateJobServiceRegistry + MUTATEJOBSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"JobSelector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"Job", :min_occurs=>0, :max_occurs=>:unbounded}]}}, :get_result=>{:input=>[{:name=>:selector, :type=>"JobSelector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_result_response", :fields=>[{:name=>:rval, :type=>"JobResult", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"Operation", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:policy, :type=>"BulkMutateJobPolicy", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"SimpleMutateJob", :min_occurs=>0, :max_occurs=>1}]}}} + MUTATEJOBSERVICE_TYPES = {:Ad=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:final_mobile_urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:final_app_urls, :type=>"AppUrl", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_type, :original_name=>"Ad.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdCustomizerError=>{:fields=>[{:name=>:reason, :type=>"AdCustomizerError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:function_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:operator_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:operand_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:operand_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdError=>{:fields=>[{:name=>:reason, :type=>"AdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdExtension=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_extension_type, :original_name=>"AdExtension.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdExtensionError=>{:fields=>[{:name=>:reason, :type=>"AdExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdGroup=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"AdGroup.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:settings, :type=>"Setting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:experiment_data, :type=>"AdGroupExperimentData", :min_occurs=>0, :max_occurs=>1}, {:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:bidding_strategy_configuration, :type=>"BiddingStrategyConfiguration", :min_occurs=>0, :max_occurs=>1}, {:name=>:content_bid_criterion_type_group, :type=>"CriterionTypeGroup", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupAd=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad, :type=>"Ad", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data, :type=>"AdGroupAdExperimentData", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"AdGroupAd.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"AdGroupAd.ApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:trademarks, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:disapproval_reasons, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:trademark_disapproved, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :AdGroupAdCountLimitExceeded=>{:fields=>[], :base=>"EntityCountLimitExceeded"}, :AdGroupAdError=>{:fields=>[{:name=>:reason, :type=>"AdGroupAdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdGroupAdExperimentData=>{:fields=>[{:name=>:experiment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_delta_status, :type=>"ExperimentDeltaStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data_status, :type=>"ExperimentDataStatus", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupAdLabel=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupAdLabelOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupAdLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupAdOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupAd", :min_occurs=>0, :max_occurs=>1}, {:name=>:exemption_requests, :type=>"ExemptionRequest", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Operation"}, :AdGroupBidModifier=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion, :type=>"Criterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier_source, :type=>"BidModifierSource", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupBidModifierOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupBidModifier", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupCriterion=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_use, :type=>"CriterionUse", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion, :type=>"Criterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_group_criterion_type, :original_name=>"AdGroupCriterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupCriterionError=>{:fields=>[{:name=>:reason, :type=>"AdGroupCriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdGroupCriterionExperimentBidMultiplier=>{:fields=>[{:name=>:ad_group_criterion_experiment_bid_multiplier_type, :original_name=>"AdGroupCriterionExperimentBidMultiplier.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :AdGroupCriterionLabel=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupCriterionLabelOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupCriterionLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupCriterionLimitExceeded=>{:fields=>[{:name=>:limit_type, :type=>"AdGroupCriterionLimitExceeded.CriteriaLimitType", :min_occurs=>0, :max_occurs=>1}], :base=>"EntityCountLimitExceeded"}, :AdGroupCriterionOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupCriterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:exemption_requests, :type=>"ExemptionRequest", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Operation"}, :AdGroupExperimentBidMultipliers=>{:fields=>[{:name=>:ad_group_experiment_bid_multipliers_type, :original_name=>"AdGroupExperimentBidMultipliers.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :AdGroupExperimentData=>{:fields=>[{:name=>:experiment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_delta_status, :type=>"ExperimentDeltaStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data_status, :type=>"ExperimentDataStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_bid_multipliers, :type=>"AdGroupExperimentBidMultipliers", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupLabel=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :AdGroupLabelOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroupLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupOperation=>{:fields=>[{:name=>:operand, :type=>"AdGroup", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :AdGroupServiceError=>{:fields=>[{:name=>:reason, :type=>"AdGroupServiceError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AdSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :AdScheduleTarget=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_multiplier, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"Target"}, :AdScheduleTargetList=>{:fields=>[{:name=>:targets, :type=>"AdScheduleTarget", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"TargetList"}, :AdUnionId=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_union_id_type, :original_name=>"AdUnionId.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Address=>{:fields=>[{:name=>:street_address, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:street_address2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:city_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:province_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:province_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:postal_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :AgeRange=>{:fields=>[{:name=>:age_range_type, :type=>"AgeRange.AgeRangeType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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}, :ApiErrorReason=>{:fields=>[], :choices=>[{:name=>:ad_customizer_error_reason, :original_name=>"AdCustomizerErrorReason", :type=>"AdCustomizerError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_error_reason, :original_name=>"AdErrorReason", :type=>"AdError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_extension_error_reason, :original_name=>"AdExtensionErrorReason", :type=>"AdExtensionError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group_ad_error_reason, :original_name=>"AdGroupAdErrorReason", :type=>"AdGroupAdError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group_criterion_error_reason, :original_name=>"AdGroupCriterionErrorReason", :type=>"AdGroupCriterionError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group_service_error_reason, :original_name=>"AdGroupServiceErrorReason", :type=>"AdGroupServiceError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:adx_error_reason, :original_name=>"AdxErrorReason", :type=>"AdxError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:authentication_error_reason, :original_name=>"AuthenticationErrorReason", :type=>"AuthenticationError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:authorization_error_reason, :original_name=>"AuthorizationErrorReason", :type=>"AuthorizationError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:beta_error_reason, :original_name=>"BetaErrorReason", :type=>"BetaError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:bidding_error_reason, :original_name=>"BiddingErrorReason", :type=>"BiddingError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:bidding_errors_reason, :original_name=>"BiddingErrorsReason", :type=>"BiddingErrors.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:bidding_transition_error_reason, :original_name=>"BiddingTransitionErrorReason", :type=>"BiddingTransitionError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:budget_error_reason, :original_name=>"BudgetErrorReason", :type=>"BudgetError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:bulk_mutate_job_error_reason, :original_name=>"BulkMutateJobErrorReason", :type=>"BulkMutateJobError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:campaign_ad_extension_error_reason, :original_name=>"CampaignAdExtensionErrorReason", :type=>"CampaignAdExtensionError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:campaign_criterion_error_reason, :original_name=>"CampaignCriterionErrorReason", :type=>"CampaignCriterionError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:campaign_error_reason, :original_name=>"CampaignErrorReason", :type=>"CampaignError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:client_terms_error_reason, :original_name=>"ClientTermsErrorReason", :type=>"ClientTermsError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:collection_size_error_reason, :original_name=>"CollectionSizeErrorReason", :type=>"CollectionSizeError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:criterion_error_reason, :original_name=>"CriterionErrorReason", :type=>"CriterionError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:database_error_reason, :original_name=>"DatabaseErrorReason", :type=>"DatabaseError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:date_error_reason, :original_name=>"DateErrorReason", :type=>"DateError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:date_range_error_reason, :original_name=>"DateRangeErrorReason", :type=>"DateRangeError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:distinct_error_reason, :original_name=>"DistinctErrorReason", :type=>"DistinctError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:entity_access_denied_reason, :original_name=>"EntityAccessDeniedReason", :type=>"EntityAccessDenied.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:entity_count_limit_exceeded_reason, :original_name=>"EntityCountLimitExceededReason", :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:entity_not_found_reason, :original_name=>"EntityNotFoundReason", :type=>"EntityNotFound.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:experiment_error_reason, :original_name=>"ExperimentErrorReason", :type=>"ExperimentError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:feed_attribute_reference_error_reason, :original_name=>"FeedAttributeReferenceErrorReason", :type=>"FeedAttributeReferenceError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:feed_item_error_reason, :original_name=>"FeedItemErrorReason", :type=>"FeedItemError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:forward_compatibility_error_reason, :original_name=>"ForwardCompatibilityErrorReason", :type=>"ForwardCompatibilityError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:function_error_reason, :original_name=>"FunctionErrorReason", :type=>"FunctionError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:function_parsing_error_reason, :original_name=>"FunctionParsingErrorReason", :type=>"FunctionParsingError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:id_error_reason, :original_name=>"IdErrorReason", :type=>"IdError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:image_error_reason, :original_name=>"ImageErrorReason", :type=>"ImageError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:internal_api_error_reason, :original_name=>"InternalApiErrorReason", :type=>"InternalApiError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:job_error_reason, :original_name=>"JobErrorReason", :type=>"JobError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:media_error_reason, :original_name=>"MediaErrorReason", :type=>"MediaError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:multiplier_error_reason, :original_name=>"MultiplierErrorReason", :type=>"MultiplierError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:new_entity_creation_error_reason, :original_name=>"NewEntityCreationErrorReason", :type=>"NewEntityCreationError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:not_empty_error_reason, :original_name=>"NotEmptyErrorReason", :type=>"NotEmptyError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:null_error_reason, :original_name=>"NullErrorReason", :type=>"NullError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:operation_access_denied_reason, :original_name=>"OperationAccessDeniedReason", :type=>"OperationAccessDenied.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:operator_error_reason, :original_name=>"OperatorErrorReason", :type=>"OperatorError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:paging_error_reason, :original_name=>"PagingErrorReason", :type=>"PagingError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:policy_violation_error_reason, :original_name=>"PolicyViolationErrorReason", :type=>"PolicyViolationError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:query_error_reason, :original_name=>"QueryErrorReason", :type=>"QueryError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:quota_check_error_reason, :original_name=>"QuotaCheckErrorReason", :type=>"QuotaCheckError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:range_error_reason, :original_name=>"RangeErrorReason", :type=>"RangeError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:rate_exceeded_error_reason, :original_name=>"RateExceededErrorReason", :type=>"RateExceededError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:read_only_error_reason, :original_name=>"ReadOnlyErrorReason", :type=>"ReadOnlyError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:region_code_error_reason, :original_name=>"RegionCodeErrorReason", :type=>"RegionCodeError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:rejected_error_reason, :original_name=>"RejectedErrorReason", :type=>"RejectedError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:request_error_reason, :original_name=>"RequestErrorReason", :type=>"RequestError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:required_error_reason, :original_name=>"RequiredErrorReason", :type=>"RequiredError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:selector_error_reason, :original_name=>"SelectorErrorReason", :type=>"SelectorError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:setting_error_reason, :original_name=>"SettingErrorReason", :type=>"SettingError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:size_limit_error_reason, :original_name=>"SizeLimitErrorReason", :type=>"SizeLimitError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:stats_query_error_reason, :original_name=>"StatsQueryErrorReason", :type=>"StatsQueryError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:string_format_error_reason, :original_name=>"StringFormatErrorReason", :type=>"StringFormatError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:string_length_error_reason, :original_name=>"StringLengthErrorReason", :type=>"StringLengthError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:target_error_reason, :original_name=>"TargetErrorReason", :type=>"TargetError.Reason", :min_occurs=>1, :max_occurs=>1}, {:name=>:url_error_reason, :original_name=>"UrlErrorReason", :type=>"UrlError.Reason", :min_occurs=>1, :max_occurs=>1}]}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException"}, :AppPaymentModel=>{:fields=>[{:name=>:app_payment_model_type, :type=>"AppPaymentModel.AppPaymentModelType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :AppUrl=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_type, :type=>"AppUrl.OsType", :min_occurs=>0, :max_occurs=>1}]}, :AppUrlList=>{:fields=>[{:name=>:app_urls, :type=>"AppUrl", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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}]}, :Audio=>{:fields=>[{:name=>:duration_millis, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:streaming_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ready_to_play_on_the_web, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :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"}, :Bid=>{:fields=>[{:name=>:amount, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :BidMultiplier=>{:fields=>[{:name=>:multiplier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:multiplied_bid, :type=>"Bid", :min_occurs=>0, :max_occurs=>1}]}, :BiddableAdGroupCriterion=>{:fields=>[{:name=>:user_status, :type=>"UserStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:system_serving_status, :type=>"SystemServingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"ApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:disapproval_reasons, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:destination_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data, :type=>"BiddableAdGroupCriterionExperimentData", :min_occurs=>0, :max_occurs=>1}, {:name=>:first_page_cpc, :type=>"Bid", :min_occurs=>0, :max_occurs=>1}, {:name=>:top_of_page_cpc, :type=>"Bid", :min_occurs=>0, :max_occurs=>1}, {:name=>:quality_info, :type=>"QualityInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_configuration, :type=>"BiddingStrategyConfiguration", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_mobile_urls, :type=>"UrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:final_app_urls, :type=>"AppUrlList", :min_occurs=>0, :max_occurs=>1}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}], :base=>"AdGroupCriterion"}, :BiddableAdGroupCriterionExperimentData=>{:fields=>[{:name=>:experiment_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_delta_status, :type=>"ExperimentDeltaStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_data_status, :type=>"ExperimentDataStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:experiment_bid_multiplier, :type=>"AdGroupCriterionExperimentBidMultiplier", :min_occurs=>0, :max_occurs=>1}]}, :BiddingError=>{:fields=>[{:name=>:reason, :type=>"BiddingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BiddingErrors=>{:fields=>[{:name=>:reason, :type=>"BiddingErrors.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BiddingScheme=>{:fields=>[{:name=>:bidding_scheme_type, :original_name=>"BiddingScheme.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BiddingStrategyConfiguration=>{:fields=>[{:name=>:bidding_strategy_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_type, :type=>"BiddingStrategyType", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_strategy_source, :type=>"BiddingStrategySource", :min_occurs=>0, :max_occurs=>1}, {:name=>:bidding_scheme, :type=>"BiddingScheme", :min_occurs=>0, :max_occurs=>1}, {:name=>:bids, :type=>"Bids", :min_occurs=>0, :max_occurs=>:unbounded}]}, :Bids=>{:fields=>[{:name=>:bids_type, :original_name=>"Bids.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BillingSummary=>{:fields=>[{:name=>:num_operations, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:num_units, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :Budget=>{:fields=>[{:name=>:budget_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:period, :type=>"Budget.BudgetPeriod", :min_occurs=>0, :max_occurs=>1}, {:name=>:amount, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:delivery_method, :type=>"Budget.BudgetDeliveryMethod", :min_occurs=>0, :max_occurs=>1}, {:name=>:reference_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_explicitly_shared, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Budget.BudgetStatus", :min_occurs=>0, :max_occurs=>1}]}, :BudgetError=>{:fields=>[{:name=>:reason, :type=>"BudgetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BudgetOperation=>{:fields=>[{:name=>:operand, :type=>"Budget", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :BudgetOptimizerBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :BulkMutateJobError=>{:fields=>[{:name=>:reason, :type=>"BulkMutateJobError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :BulkMutateJobPolicy=>{:fields=>[{:name=>:prerequisite_job_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :BulkMutateJobSelector=>{:fields=>[{:name=>:job_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:result_part_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"JobSelector"}, :CallOnlyAd=>{:fields=>[{:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:business_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description1, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description2, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:call_tracked, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:disable_call_conversion, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_type_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:phone_number_verification_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :Campaign=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CampaignStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:serving_status, :type=>"ServingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_date, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:budget, :type=>"Budget", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_optimizer_eligibility, :type=>"ConversionOptimizerEligibility", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_serving_optimization_status, :type=>"AdServingOptimizationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:frequency_cap, :type=>"FrequencyCap", :min_occurs=>0, :max_occurs=>1}, {:name=>:settings, :type=>"Setting", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:advertising_channel_type, :type=>"AdvertisingChannelType", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertising_channel_sub_type, :type=>"AdvertisingChannelSubType", :min_occurs=>0, :max_occurs=>1}, {:name=>:network_setting, :type=>"NetworkSetting", :min_occurs=>0, :max_occurs=>1}, {:name=>:labels, :type=>"Label", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:bidding_strategy_configuration, :type=>"BiddingStrategyConfiguration", :min_occurs=>0, :max_occurs=>1}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:tracking_url_template, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}]}, :CampaignAdExtension=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_extension, :type=>"AdExtension", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"CampaignAdExtension.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"CampaignAdExtension.ApprovalStatus", :min_occurs=>0, :max_occurs=>1}]}, :CampaignAdExtensionError=>{:fields=>[{:name=>:reason, :type=>"CampaignAdExtensionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignAdExtensionOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignAdExtension", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignCriterion=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negative, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion, :type=>"Criterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:forward_compatibility_map, :type=>"String_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:campaign_criterion_type, :original_name=>"CampaignCriterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CampaignCriterionError=>{:fields=>[{:name=>:reason, :type=>"CampaignCriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignCriterionOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignCriterion", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignError=>{:fields=>[{:name=>:reason, :type=>"CampaignError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CampaignLabel=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :CampaignLabelOperation=>{:fields=>[{:name=>:operand, :type=>"CampaignLabel", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :TextLabel=>{:fields=>[], :base=>"Label"}, :CampaignOperation=>{:fields=>[{:name=>:operand, :type=>"Campaign", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :CampaignTargetOperation=>{:fields=>[{:name=>:operand, :type=>"TargetList", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :Carrier=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ConstantOperand=>{:fields=>[{:name=>:type, :type=>"ConstantOperand.ConstantType", :min_occurs=>0, :max_occurs=>1}, {:name=>:unit, :type=>"ConstantOperand.Unit", :min_occurs=>0, :max_occurs=>1}, {:name=>:long_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:boolean_value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:double_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:string_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :ContentLabel=>{:fields=>[{:name=>:content_label_type, :type=>"ContentLabelType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :ConversionOptimizerBiddingScheme=>{:fields=>[{:name=>:pricing_mode, :type=>"ConversionOptimizerBiddingScheme.PricingMode", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_type, :type=>"ConversionOptimizerBiddingScheme.BidType", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :ConversionOptimizerEligibility=>{:fields=>[{:name=>:eligible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:rejection_reasons, :type=>"ConversionOptimizerEligibility.RejectionReason", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CpaBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CpcBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cpc_bid_source, :type=>"BidSource", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :CpmBid=>{:fields=>[{:name=>:bid, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:cpm_bid_source, :type=>"BidSource", :min_occurs=>0, :max_occurs=>1}], :base=>"Bids"}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :CriterionError=>{:fields=>[{:name=>:reason, :type=>"CriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CriterionParameter=>{:fields=>[{:name=>:criterion_parameter_type, :original_name=>"CriterionParameter.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :CriterionPolicyError=>{:fields=>[], :base=>"PolicyViolationError"}, :CustomParameter=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_remove, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :CustomParameters=>{:fields=>[{:name=>:parameters, :type=>"CustomParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:do_replace, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateRangeError=>{:fields=>[{:name=>:reason, :type=>"DateRangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DeprecatedAd=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"DeprecatedAd.Type", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :Dimensions=>{:fields=>[{:name=>:width, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :DisapprovalReason=>{:fields=>[{:name=>:short_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :DynamicSearchAdsSetting=>{:fields=>[{:name=>:domain_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:language_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :EnhancedCpcBiddingScheme=>{:fields=>[], :base=>"BiddingScheme"}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExemptionRequest=>{:fields=>[{:name=>:key, :type=>"PolicyViolationKey", :min_occurs=>0, :max_occurs=>1}]}, :ExperimentError=>{:fields=>[{:name=>:reason, :type=>"ExperimentError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ExplorerAutoOptimizerSetting=>{:fields=>[{:name=>:opt_in, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :FeedAttributeReferenceError=>{:fields=>[{:name=>:reason, :type=>"FeedAttributeReferenceError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_attribute_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItem=>{:fields=>[{:name=>:feed_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_item_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"FeedItem.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:attribute_values, :type=>"FeedItemAttributeValue", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:policy_data, :type=>"FeedItemPolicyData", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:device_preference, :type=>"FeedItemDevicePreference", :min_occurs=>0, :max_occurs=>1}, {:name=>:scheduling, :type=>"FeedItemScheduling", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_targeting, :type=>"FeedItemCampaignTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_targeting, :type=>"FeedItemAdGroupTargeting", :min_occurs=>0, :max_occurs=>1}, {:name=>:keyword_targeting, :type=>"Keyword", :min_occurs=>0, :max_occurs=>1}, {:name=>:url_custom_parameters, :type=>"CustomParameters", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemAdGroupTargeting=>{:fields=>[{:name=>:targeting_ad_group_id, :original_name=>"TargetingAdGroupId", :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemAttributeError=>{:fields=>[{:name=>:feed_attribute_ids, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:validation_error_code, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:error_information, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemAttributeValue=>{:fields=>[{:name=>:feed_attribute_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:integer_value, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:double_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:boolean_value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:string_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:integer_values, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:double_values, :type=>"double", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:boolean_values, :type=>"boolean", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:string_values, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :FeedItemCampaignTargeting=>{:fields=>[{:name=>:targeting_campaign_id, :original_name=>"TargetingCampaignId", :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemDevicePreference=>{:fields=>[{:name=>:device_preference, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemError=>{:fields=>[{:name=>:reason, :type=>"FeedItemError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FeedItemOperation=>{:fields=>[{:name=>:operand, :type=>"FeedItem", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :FeedItemPolicyData=>{:fields=>[{:name=>:placeholder_type, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:feed_mapping_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:validation_status, :type=>"FeedItemValidationStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:approval_status, :type=>"FeedItemApprovalStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:validation_errors, :type=>"FeedItemAttributeError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"PolicyData"}, :FeedItemSchedule=>{:fields=>[{:name=>:day_of_week, :type=>"DayOfWeek", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:start_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_hour, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:end_minute, :type=>"MinuteOfHour", :min_occurs=>0, :max_occurs=>1}]}, :FeedItemScheduling=>{:fields=>[{:name=>:feed_item_schedules, :type=>"FeedItemSchedule", :min_occurs=>0, :max_occurs=>:unbounded}]}, :ForwardCompatibilityError=>{:fields=>[{:name=>:reason, :type=>"ForwardCompatibilityError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FrequencyCap=>{:fields=>[{:name=>:impressions, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:time_unit, :type=>"TimeUnit", :min_occurs=>0, :max_occurs=>1}, {:name=>:level, :type=>"Level", :min_occurs=>0, :max_occurs=>1}]}, :Function=>{:fields=>[{:name=>:operator, :type=>"Function.Operator", :min_occurs=>0, :max_occurs=>1}, {:name=>:lhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:rhs_operand, :type=>"FunctionArgumentOperand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:function_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :FunctionError=>{:fields=>[{:name=>:reason, :type=>"FunctionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :FunctionParsingError=>{:fields=>[{:name=>:reason, :type=>"FunctionParsingError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:offending_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:offending_text_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Gender=>{:fields=>[{:name=>:gender_type, :type=>"Gender.GenderType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :GeoPoint=>{:fields=>[{:name=>:latitude_in_micro_degrees, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:longitude_in_micro_degrees, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :GeoTargetOperand=>{:fields=>[{:name=>:locations, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"FunctionArgumentOperand"}, :GeoTargetTypeSetting=>{:fields=>[{:name=>:positive_geo_target_type, :type=>"GeoTargetTypeSetting.PositiveGeoTargetType", :min_occurs=>0, :max_occurs=>1}, {:name=>:negative_geo_target_type, :type=>"GeoTargetTypeSetting.NegativeGeoTargetType", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Image=>{:fields=>[{:name=>:data, :type=>"base64Binary", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :ImageAd=>{:fields=>[{:name=>:image, :type=>"Image", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_to_copy_image_from, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :ImageError=>{:fields=>[{:name=>:reason, :type=>"ImageError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :IncomeOperand=>{:fields=>[{:name=>:tier, :type=>"IncomeTier", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :IpBlock=>{:fields=>[{:name=>:ip_address, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Job=>{:fields=>[{:name=>:failure_reason, :type=>"ApiErrorReason", :min_occurs=>0, :max_occurs=>1}, {:name=>:stats, :type=>"JobStats", :min_occurs=>0, :max_occurs=>1}, {:name=>:billing_summary, :type=>"BillingSummary", :min_occurs=>0, :max_occurs=>1}, {:name=>:job_type, :original_name=>"Job.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :JobError=>{:fields=>[{:name=>:reason, :type=>"JobError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :JobEvent=>{:fields=>[{:name=>:date_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:job_event_type, :original_name=>"JobEvent.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :JobResult=>{:fields=>[], :choices=>[{:name=>:simple_mutate_result, :original_name=>"SimpleMutateResult", :type=>"SimpleMutateResult", :min_occurs=>1, :max_occurs=>1}]}, :JobSelector=>{:fields=>[{:name=>:include_history, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:include_stats, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:job_selector_type, :original_name=>"JobSelector.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :JobStats=>{:fields=>[{:name=>:progress_percent, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:pending_time_millis, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:processing_time_millis, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:job_stats_type, :original_name=>"JobStats.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Label=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"Label.Status", :min_occurs=>0, :max_occurs=>1}, {:name=>:label_type, :original_name=>"Label.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Language=>{:fields=>[{:name=>:code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Location=>{:fields=>[{:name=>:location_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_status, :type=>"LocationTargetingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :LocationExtension=>{:fields=>[{:name=>:address, :type=>"Address", :min_occurs=>0, :max_occurs=>1}, {:name=>:geo_point, :type=>"GeoPoint", :min_occurs=>0, :max_occurs=>1}, {:name=>:encoded_location, :type=>"base64Binary", :min_occurs=>0, :max_occurs=>1}, {:name=>:company_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:source, :type=>"LocationExtension.Source", :min_occurs=>0, :max_occurs=>1}, {:name=>:icon_media_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:image_media_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"AdExtension"}, :LocationExtensionOperand=>{:fields=>[{:name=>:radius, :type=>"ConstantOperand", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :LocationSyncExtension=>{:fields=>[{:name=>:email, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:o_auth_info, :type=>"OAuthInfo", :min_occurs=>0, :max_occurs=>1}, {:name=>:icon_media_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:should_sync_url, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"AdExtension"}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue"}, :ManualCPCAdGroupCriterionExperimentBidMultiplier=>{:fields=>[{:name=>:max_cpc_multiplier, :type=>"BidMultiplier", :min_occurs=>0, :max_occurs=>1}, {:name=>:multiplier_source, :type=>"MultiplierSource", :min_occurs=>0, :max_occurs=>1}], :base=>"AdGroupCriterionExperimentBidMultiplier"}, :ManualCPCAdGroupExperimentBidMultipliers=>{:fields=>[{:name=>:max_cpc_multiplier, :type=>"BidMultiplier", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_content_cpc_multiplier, :type=>"BidMultiplier", :min_occurs=>0, :max_occurs=>1}], :base=>"AdGroupExperimentBidMultipliers"}, :ManualCPMAdGroupExperimentBidMultipliers=>{:fields=>[{:name=>:max_cpm_multiplier, :type=>"BidMultiplier", :min_occurs=>0, :max_occurs=>1}], :base=>"AdGroupExperimentBidMultipliers"}, :ManualCpcBiddingScheme=>{:fields=>[{:name=>:enhanced_cpc_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :ManualCpmBiddingScheme=>{:fields=>[{:name=>:active_view_cpm_enabled, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :Media=>{:fields=>[{:name=>:media_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Media.MediaType", :min_occurs=>0, :max_occurs=>1}, {:name=>:reference_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:dimensions, :type=>"Media_Size_DimensionsMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:urls, :type=>"Media_Size_StringMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mime_type, :type=>"Media.MimeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:file_size, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:creation_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:media_type, :original_name=>"Media.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MediaError=>{:fields=>[{:name=>:reason, :type=>"MediaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Media_Size_DimensionsMapEntry=>{:fields=>[{:name=>:key, :type=>"Media.Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Dimensions", :min_occurs=>0, :max_occurs=>1}]}, :Media_Size_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"Media.Size", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :MobileAd=>{:fields=>[{:name=>:headline, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:markup_languages, :type=>"MarkupLanguageType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mobile_carriers, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:business_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:country_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:phone_number, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileDevice=>{:fields=>[{:name=>:device_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:manufacturer_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:device_type, :type=>"MobileDevice.DeviceType", :min_occurs=>0, :max_occurs=>1}, {:name=>:operating_system_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileImageAd=>{:fields=>[{:name=>:markup_languages, :type=>"MarkupLanguageType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:mobile_carriers, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:image, :type=>"Image", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue"}, :MultiplierError=>{:fields=>[{:name=>:reason, :type=>"MultiplierError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NegativeAdGroupCriterion=>{:fields=>[], :base=>"AdGroupCriterion"}, :NegativeCampaignCriterion=>{:fields=>[], :base=>"CampaignCriterion"}, :NetworkSetting=>{:fields=>[{:name=>:target_google_search, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_search_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_content_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_partner_search_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue"}, :OAuthInfo=>{:fields=>[{:name=>:http_method, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:http_request_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:http_authorization_header, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :FunctionArgumentOperand=>{:fields=>[{:name=>:function_argument_operand_type, :original_name=>"FunctionArgumentOperand.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :Operand=>{:fields=>[], :choices=>[{:name=>:ad_group_ad_label, :original_name=>"AdGroupAdLabel", :type=>"AdGroupAdLabel", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group_ad, :original_name=>"AdGroupAd", :type=>"AdGroupAd", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group_bid_modifier, :original_name=>"AdGroupBidModifier", :type=>"AdGroupBidModifier", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group_criterion_label, :original_name=>"AdGroupCriterionLabel", :type=>"AdGroupCriterionLabel", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group_criterion, :original_name=>"AdGroupCriterion", :type=>"AdGroupCriterion", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group_label, :original_name=>"AdGroupLabel", :type=>"AdGroupLabel", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad_group, :original_name=>"AdGroup", :type=>"AdGroup", :min_occurs=>1, :max_occurs=>1}, {:name=>:ad, :original_name=>"Ad", :type=>"Ad", :min_occurs=>1, :max_occurs=>1}, {:name=>:budget, :original_name=>"Budget", :type=>"Budget", :min_occurs=>1, :max_occurs=>1}, {:name=>:campaign_ad_extension, :original_name=>"CampaignAdExtension", :type=>"CampaignAdExtension", :min_occurs=>1, :max_occurs=>1}, {:name=>:campaign_criterion, :original_name=>"CampaignCriterion", :type=>"CampaignCriterion", :min_occurs=>1, :max_occurs=>1}, {:name=>:campaign_label, :original_name=>"CampaignLabel", :type=>"CampaignLabel", :min_occurs=>1, :max_occurs=>1}, {:name=>:campaign, :original_name=>"Campaign", :type=>"Campaign", :min_occurs=>1, :max_occurs=>1}, {:name=>:feed_item, :original_name=>"FeedItem", :type=>"FeedItem", :min_occurs=>1, :max_occurs=>1}, {:name=>:job, :original_name=>"Job", :type=>"Job", :min_occurs=>1, :max_occurs=>1}, {:name=>:label, :original_name=>"Label", :type=>"Label", :min_occurs=>1, :max_occurs=>1}, {:name=>:media, :original_name=>"Media", :type=>"Media", :min_occurs=>1, :max_occurs=>1}, {:name=>:place_holder, :original_name=>"PlaceHolder", :type=>"PlaceHolder", :min_occurs=>1, :max_occurs=>1}, {:name=>:target_list, :original_name=>"TargetList", :type=>"TargetList", :min_occurs=>1, :max_occurs=>1}, {:name=>:target, :original_name=>"Target", :type=>"Target", :min_occurs=>1, :max_occurs=>1}]}, :OperatingSystemVersion=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_major_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:os_minor_version, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:operator_type, :type=>"OperatingSystemVersion.OperatorType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PageOnePromotedBiddingScheme=>{:fields=>[{:name=>:strategy_goal, :type=>"PageOnePromotedBiddingScheme.StrategyGoal", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_modifier, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_budget_constrained, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PlaceHolder=>{:fields=>[]}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :PlacesOfInterestOperand=>{:fields=>[{:name=>:category, :type=>"PlacesOfInterestOperand.Category", :min_occurs=>0, :max_occurs=>1}], :base=>"FunctionArgumentOperand"}, :Platform=>{:fields=>[{:name=>:platform_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :PolicyData=>{:fields=>[{:name=>:disapproval_reasons, :type=>"DisapprovalReason", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:policy_data_type, :original_name=>"PolicyData.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :PolicyViolationError=>{:fields=>[{:name=>:key, :type=>"PolicyViolationKey", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_exemptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_parts, :type=>"PolicyViolationError.Part", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApiError"}, :"PolicyViolationError.Part"=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:length, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PolicyViolationKey=>{:fields=>[{:name=>:policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :ProductAd=>{:fields=>[{:name=>:promotion_line, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :ProductAdwordsGrouping=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductAdwordsLabels=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductBiddingCategory=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductBrand=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductCanonicalCondition=>{:fields=>[{:name=>:condition, :type=>"ProductCanonicalCondition.Condition", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductChannel=>{:fields=>[{:name=>:channel, :type=>"ShoppingProductChannel", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductChannelExclusivity=>{:fields=>[{:name=>:channel_exclusivity, :type=>"ShoppingProductChannelExclusivity", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductLegacyCondition=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductCustomAttribute=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductDimension=>{:fields=>[{:name=>:product_dimension_type, :original_name=>"ProductDimension.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :ProductOfferId=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductPartition=>{:fields=>[{:name=>:partition_type, :type=>"ProductPartitionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:case_value, :type=>"ProductDimension", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :ProductScope=>{:fields=>[{:name=>:dimensions, :type=>"ProductDimension", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :ProductType=>{:fields=>[{:name=>:type, :type=>"ProductDimensionType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :ProductTypeFull=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ProductDimension"}, :Proximity=>{:fields=>[{:name=>:geo_point, :type=>"GeoPoint", :min_occurs=>0, :max_occurs=>1}, {:name=>:radius_distance_units, :type=>"Proximity.DistanceUnits", :min_occurs=>0, :max_occurs=>1}, {:name=>:radius_in_units, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:address, :type=>"Address", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :QualityInfo=>{:fields=>[{:name=>:is_keyword_ad_relevance_acceptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_landing_page_quality_acceptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:quality_score, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :QueryError=>{:fields=>[{:name=>:reason, :type=>"QueryError.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:message, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RealTimeBiddingSetting=>{:fields=>[{:name=>:opt_in, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :RegionCodeError=>{:fields=>[{:name=>:reason, :type=>"RegionCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RichMediaAd=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:dimensions, :type=>"Dimensions", :min_occurs=>0, :max_occurs=>1}, {:name=>:snippet, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:impression_beacon_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:certified_vendor_format_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:source_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:rich_media_ad_type, :type=>"RichMediaAd.RichMediaAdType", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_attributes, :type=>"RichMediaAd.AdAttribute", :min_occurs=>0, :max_occurs=>:unbounded}], :abstract=>true, :base=>"Ad"}, :SelectorError=>{:fields=>[{:name=>:reason, :type=>"SelectorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :LocationGroups=>{:fields=>[{:name=>:matching_function, :type=>"Function", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Setting=>{:fields=>[{:name=>:setting_type, :original_name=>"Setting.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :SettingError=>{:fields=>[{:name=>:reason, :type=>"SettingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ShoppingSetting=>{:fields=>[{:name=>:merchant_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:sales_country, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:campaign_priority, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:enable_local, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :SimpleMutateJob=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"BasicJobStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:history, :type=>"JobEvent", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Job"}, :SimpleMutateResult=>{:fields=>[{:name=>:results, :type=>"Operand", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}]}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{: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}]}, :StatsQueryError=>{:fields=>[{:name=>:reason, :type=>"StatsQueryError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :String_StringMapEntry=>{:fields=>[{:name=>:key, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :Target=>{:fields=>[{:name=>:target_type, :original_name=>"Target.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :TargetCpaBiddingScheme=>{:fields=>[{:name=>:target_cpa, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetError=>{:fields=>[{:name=>:reason, :type=>"TargetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TargetList=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_list_type, :original_name=>"TargetList.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :TargetOutrankShareBiddingScheme=>{:fields=>[{:name=>:target_outrank_share, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:competitor_domain, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc_bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_changes_for_raises_only, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:raise_bid_when_low_quality_score, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetingSettingDetail=>{:fields=>[{:name=>:criterion_type_group, :type=>"CriterionTypeGroup", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_all, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :TargetRoasBiddingScheme=>{:fields=>[{:name=>:target_roas, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:bid_floor, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetSpendBiddingScheme=>{:fields=>[{:name=>:bid_ceiling, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:spend_target, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"BiddingScheme"}, :TargetingSetting=>{:fields=>[{:name=>:details, :type=>"TargetingSettingDetail", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Setting"}, :TempAdUnionId=>{:fields=>[], :base=>"AdUnionId"}, :TemplateAd=>{:fields=>[{:name=>:template_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_union_id, :type=>"AdUnionId", :min_occurs=>0, :max_occurs=>1}, {:name=>:template_elements, :type=>"TemplateElement", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_as_image, :type=>"Image", :min_occurs=>0, :max_occurs=>1}, {:name=>:dimensions, :type=>"Dimensions", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:duration, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:origin_ad_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :TemplateElement=>{:fields=>[{:name=>:unique_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:fields, :type=>"TemplateElementField", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TemplateElementField=>{:fields=>[{:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"TemplateElementField.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_media, :type=>"Media", :min_occurs=>0, :max_occurs=>1}]}, :TextAd=>{:fields=>[{:name=>:headline, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description1, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description2, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :ThirdPartyRedirectAd=>{:fields=>[{:name=>:is_cookie_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_user_interest_targeted, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_tagged, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_types, :type=>"VideoType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:expanding_directions, :type=>"ThirdPartyRedirectAd.ExpandingDirection", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"RichMediaAd"}, :TrackingSetting=>{:fields=>[{:name=>:tracking_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Setting"}, :UrlError=>{:fields=>[{:name=>:reason, :type=>"UrlError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :UrlList=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}]}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :Video=>{:fields=>[{:name=>:duration_millis, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:streaming_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:ready_to_play_on_the_web, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:industry_standard_commercial_identifier, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:advertising_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:you_tube_video_id_string, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Media"}, :Webpage=>{:fields=>[{:name=>:parameter, :type=>"WebpageParameter", :min_occurs=>0, :max_occurs=>1}, {:name=>:criteria_coverage, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:criteria_samples, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :WebpageCondition=>{:fields=>[{:name=>:operand, :type=>"WebpageConditionOperand", :min_occurs=>0, :max_occurs=>1}, {:name=>:argument, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :WebpageParameter=>{:fields=>[{:name=>:criterion_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:conditions, :type=>"WebpageCondition", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"CriterionParameter"}, :DynamicSearchAd=>{:fields=>[{:name=>:description1, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:description2, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Ad"}, :YouTubeChannel=>{:fields=>[{:name=>:channel_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:channel_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :YouTubeVideo=>{:fields=>[{:name=>:video_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:video_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :"AdCustomizerError.Reason"=>{:fields=>[]}, :"AdError.Reason"=>{:fields=>[]}, :"AdExtensionError.Reason"=>{:fields=>[]}, :"AdGroupAd.ApprovalStatus"=>{:fields=>[]}, :"AdGroupAd.Status"=>{:fields=>[]}, :"AdGroupAdError.Reason"=>{:fields=>[]}, :"AdGroupCriterionError.Reason"=>{:fields=>[]}, :"AdGroupCriterionLimitExceeded.CriteriaLimitType"=>{:fields=>[]}, :"AdGroupServiceError.Reason"=>{:fields=>[]}, :"AdGroup.Status"=>{:fields=>[]}, :AdServingOptimizationStatus=>{:fields=>[]}, :AdvertisingChannelSubType=>{:fields=>[]}, :AdvertisingChannelType=>{:fields=>[]}, :"AdxError.Reason"=>{:fields=>[]}, :"AgeRange.AgeRangeType"=>{:fields=>[]}, :"AppPaymentModel.AppPaymentModelType"=>{:fields=>[]}, :"AppUrl.OsType"=>{:fields=>[]}, :ApprovalStatus=>{:fields=>[]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :BasicJobStatus=>{:fields=>[]}, :"BetaError.Reason"=>{:fields=>[]}, :BidModifierSource=>{:fields=>[]}, :BidSource=>{:fields=>[]}, :"BiddingError.Reason"=>{:fields=>[]}, :"BiddingErrors.Reason"=>{:fields=>[]}, :BiddingStrategySource=>{:fields=>[]}, :BiddingStrategyType=>{:fields=>[]}, :"BiddingTransitionError.Reason"=>{:fields=>[]}, :"Budget.BudgetDeliveryMethod"=>{:fields=>[]}, :"Budget.BudgetPeriod"=>{:fields=>[]}, :"Budget.BudgetStatus"=>{:fields=>[]}, :"BudgetError.Reason"=>{:fields=>[]}, :"BulkMutateJobError.Reason"=>{:fields=>[]}, :"CampaignAdExtension.ApprovalStatus"=>{:fields=>[]}, :"CampaignAdExtension.Status"=>{:fields=>[]}, :"CampaignAdExtensionError.Reason"=>{:fields=>[]}, :"CampaignCriterionError.Reason"=>{:fields=>[]}, :"CampaignError.Reason"=>{:fields=>[]}, :CampaignStatus=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"ConstantOperand.ConstantType"=>{:fields=>[]}, :"ConstantOperand.Unit"=>{:fields=>[]}, :ContentLabelType=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.BidType"=>{:fields=>[]}, :"ConversionOptimizerBiddingScheme.PricingMode"=>{:fields=>[]}, :"ConversionOptimizerEligibility.RejectionReason"=>{:fields=>[]}, :"Criterion.Type"=>{:fields=>[]}, :"CriterionError.Reason"=>{:fields=>[]}, :CriterionTypeGroup=>{:fields=>[]}, :CriterionUse=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DateRangeError.Reason"=>{:fields=>[]}, :DayOfWeek=>{:fields=>[]}, :"DeprecatedAd.Type"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityAccessDenied.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :ExperimentDataStatus=>{:fields=>[]}, :ExperimentDeltaStatus=>{:fields=>[]}, :"ExperimentError.Reason"=>{:fields=>[]}, :"FeedAttributeReferenceError.Reason"=>{:fields=>[]}, :"FeedItem.Status"=>{:fields=>[]}, :FeedItemApprovalStatus=>{:fields=>[]}, :"FeedItemError.Reason"=>{:fields=>[]}, :FeedItemValidationStatus=>{:fields=>[]}, :"ForwardCompatibilityError.Reason"=>{:fields=>[]}, :"Function.Operator"=>{:fields=>[]}, :"FunctionError.Reason"=>{:fields=>[]}, :"FunctionParsingError.Reason"=>{:fields=>[]}, :"Gender.GenderType"=>{:fields=>[]}, :"GeoTargetTypeSetting.NegativeGeoTargetType"=>{:fields=>[]}, :"GeoTargetTypeSetting.PositiveGeoTargetType"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"ImageError.Reason"=>{:fields=>[]}, :IncomeTier=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"JobError.Reason"=>{:fields=>[]}, :KeywordMatchType=>{:fields=>[]}, :"Label.Status"=>{:fields=>[]}, :Level=>{:fields=>[]}, :"LocationExtension.Source"=>{:fields=>[]}, :LocationTargetingStatus=>{:fields=>[]}, :MarkupLanguageType=>{:fields=>[]}, :"Media.MediaType"=>{:fields=>[]}, :"Media.MimeType"=>{:fields=>[]}, :"Media.Size"=>{:fields=>[]}, :"MediaError.Reason"=>{:fields=>[]}, :MinuteOfHour=>{:fields=>[]}, :"MobileDevice.DeviceType"=>{:fields=>[]}, :"MultiplierError.Reason"=>{:fields=>[]}, :MultiplierSource=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperatingSystemVersion.OperatorType"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PageOnePromotedBiddingScheme.StrategyGoal"=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"PlacesOfInterestOperand.Category"=>{:fields=>[]}, :"PolicyViolationError.Reason"=>{:fields=>[]}, :"ProductCanonicalCondition.Condition"=>{:fields=>[]}, :ProductDimensionType=>{:fields=>[]}, :ProductPartitionType=>{:fields=>[]}, :"Proximity.DistanceUnits"=>{:fields=>[]}, :"QueryError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RegionCodeError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"RichMediaAd.AdAttribute"=>{:fields=>[]}, :"RichMediaAd.RichMediaAdType"=>{:fields=>[]}, :"SelectorError.Reason"=>{:fields=>[]}, :ServingStatus=>{:fields=>[]}, :"SettingError.Reason"=>{:fields=>[]}, :ShoppingProductChannel=>{:fields=>[]}, :ShoppingProductChannelExclusivity=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :"StatsQueryError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :SystemServingStatus=>{:fields=>[]}, :"TargetError.Reason"=>{:fields=>[]}, :"TemplateElementField.Type"=>{:fields=>[]}, :"ThirdPartyRedirectAd.ExpandingDirection"=>{:fields=>[]}, :TimeUnit=>{:fields=>[]}, :"UrlError.Reason"=>{:fields=>[]}, :"CriterionUserList.MembershipStatus"=>{:fields=>[]}, :UserStatus=>{:fields=>[]}, :VideoType=>{:fields=>[]}, :WebpageConditionOperand=>{:fields=>[]}} + MUTATEJOBSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return MUTATEJOBSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return MUTATEJOBSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return MUTATEJOBSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, MutateJobServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/offline_conversion_feed_service.rb b/adwords_api/lib/adwords_api/v201502/offline_conversion_feed_service.rb new file mode 100755 index 000000000..0143b6601 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/offline_conversion_feed_service.rb @@ -0,0 +1,34 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:39. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/offline_conversion_feed_service_registry' + +module AdwordsApi; module V201502; module OfflineConversionFeedService + class OfflineConversionFeedService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return OfflineConversionFeedServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::OfflineConversionFeedService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/offline_conversion_feed_service_registry.rb b/adwords_api/lib/adwords_api/v201502/offline_conversion_feed_service_registry.rb new file mode 100755 index 000000000..e13d8d919 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/offline_conversion_feed_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:39. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module OfflineConversionFeedService + class OfflineConversionFeedServiceRegistry + OFFLINECONVERSIONFEEDSERVICE_METHODS = {:mutate=>{:input=>[{:name=>:operations, :type=>"OfflineConversionFeedOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"OfflineConversionFeedReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + OFFLINECONVERSIONFEEDSERVICE_TYPES = {: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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CurrencyCodeError=>{:fields=>[{:name=>:reason, :type=>"CurrencyCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :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"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OfflineConversionError=>{:fields=>[{:name=>:reason, :type=>"OfflineConversionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OfflineConversionFeed=>{:fields=>[{:name=>:google_click_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_time, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_value, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:conversion_currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :OfflineConversionFeedOperation=>{:fields=>[{:name=>:operand, :type=>"OfflineConversionFeed", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :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"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RegionCodeError=>{:fields=>[{:name=>:reason, :type=>"RegionCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{: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}]}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :OfflineConversionFeedReturnValue=>{:fields=>[{:name=>:value, :type=>"OfflineConversionFeed", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:partial_failure_errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"CurrencyCodeError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OfflineConversionError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RegionCodeError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :"StringFormatError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + OFFLINECONVERSIONFEEDSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return OFFLINECONVERSIONFEEDSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return OFFLINECONVERSIONFEEDSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return OFFLINECONVERSIONFEEDSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, OfflineConversionFeedServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/report_definition_service.rb b/adwords_api/lib/adwords_api/v201502/report_definition_service.rb new file mode 100755 index 000000000..7d374880f --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/report_definition_service.rb @@ -0,0 +1,34 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:40. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/report_definition_service_registry' + +module AdwordsApi; module V201502; module ReportDefinitionService + class ReportDefinitionService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get_report_fields(*args, &block) + return execute_action('get_report_fields', args, &block) + end + + private + + def get_service_registry() + return ReportDefinitionServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::ReportDefinitionService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/report_definition_service_registry.rb b/adwords_api/lib/adwords_api/v201502/report_definition_service_registry.rb new file mode 100755 index 000000000..c328684f7 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/report_definition_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:40. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module ReportDefinitionService + class ReportDefinitionServiceRegistry + REPORTDEFINITIONSERVICE_METHODS = {:get_report_fields=>{:input=>[{:name=>:report_type, :type=>"ReportDefinition.ReportType", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_report_fields_response", :fields=>[{:name=>:rval, :type=>"ReportDefinitionField", :min_occurs=>0, :max_occurs=>:unbounded}]}}} + REPORTDEFINITIONSERVICE_TYPES = {: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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :EnumValuePair=>{:fields=>[{:name=>:enum_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:enum_display_value, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :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"}, :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"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReportDefinitionError=>{:fields=>[{:name=>:reason, :type=>"ReportDefinitionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :ReportDefinitionField=>{:fields=>[{:name=>:field_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_field_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:xml_attribute_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:field_behavior, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:enum_values, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:can_select, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:can_filter, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_enum_type, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_beta, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_zero_row_compatible, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:enum_value_pairs, :type=>"EnumValuePair", :min_occurs=>0, :max_occurs=>:unbounded}]}, :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"}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"CollectionSizeError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DateError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NotWhitelistedError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"ReportDefinition.ReportType"=>{:fields=>[]}, :"ReportDefinitionError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + REPORTDEFINITIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return REPORTDEFINITIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return REPORTDEFINITIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return REPORTDEFINITIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, ReportDefinitionServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/shared_criterion_service.rb b/adwords_api/lib/adwords_api/v201502/shared_criterion_service.rb new file mode 100755 index 000000000..e7e3a10bc --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/shared_criterion_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:41. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/shared_criterion_service_registry' + +module AdwordsApi; module V201502; module SharedCriterionService + class SharedCriterionService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return SharedCriterionServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::SharedCriterionService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/shared_criterion_service_registry.rb b/adwords_api/lib/adwords_api/v201502/shared_criterion_service_registry.rb new file mode 100755 index 000000000..3a8d15e08 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/shared_criterion_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:41. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module SharedCriterionService + class SharedCriterionServiceRegistry + SHAREDCRITERIONSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"SharedCriterionPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"SharedCriterionOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"SharedCriterionReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + SHAREDCRITERIONSERVICE_TYPES = {: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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CriterionError=>{:fields=>[{:name=>:reason, :type=>"CriterionError.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"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :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"}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :SharedCriterionError=>{:fields=>[{:name=>:reason, :type=>"SharedCriterionError.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=>: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion"}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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}]}, :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}]}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :SharedCriterion=>{:fields=>[{:name=>:shared_set_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion, :type=>"Criterion", :min_occurs=>0, :max_occurs=>1}, {:name=>:negative, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}]}, :SharedCriterionOperation=>{:fields=>[{:name=>:operand, :type=>"SharedCriterion", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :SharedCriterionPage=>{:fields=>[{:name=>:entries, :type=>"SharedCriterion", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Page"}, :SharedCriterionReturnValue=>{:fields=>[{:name=>:value, :type=>"SharedCriterion", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :ListReturnValue=>{:fields=>[{:name=>:list_return_value_type, :original_name=>"ListReturnValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :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}, :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}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"Criterion.Type"=>{:fields=>[]}, :"CriterionError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :KeywordMatchType=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SharedCriterionError.Reason"=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}, :"CriterionUserList.MembershipStatus"=>{:fields=>[]}} + SHAREDCRITERIONSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return SHAREDCRITERIONSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return SHAREDCRITERIONSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return SHAREDCRITERIONSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, SharedCriterionServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/shared_set_service.rb b/adwords_api/lib/adwords_api/v201502/shared_set_service.rb new file mode 100755 index 000000000..d753b7a71 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/shared_set_service.rb @@ -0,0 +1,38 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:42. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/shared_set_service_registry' + +module AdwordsApi; module V201502; module SharedSetService + class SharedSetService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/cm/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + def mutate(*args, &block) + return execute_action('mutate', args, &block) + end + + private + + def get_service_registry() + return SharedSetServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::SharedSetService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/shared_set_service_registry.rb b/adwords_api/lib/adwords_api/v201502/shared_set_service_registry.rb new file mode 100755 index 000000000..47907e1b3 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/shared_set_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:42. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module SharedSetService + class SharedSetServiceRegistry + SHAREDSETSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"Selector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"SharedSetPage", :min_occurs=>0, :max_occurs=>1}]}}, :mutate=>{:input=>[{:name=>:operations, :type=>"SharedSetOperation", :min_occurs=>0, :max_occurs=>:unbounded}], :output=>{:name=>"mutate_response", :fields=>[{:name=>:rval, :type=>"SharedSetReturnValue", :min_occurs=>0, :max_occurs=>1}]}}} + SHAREDSETSERVICE_TYPES = {: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"}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.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"}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :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"}, :NewEntityCreationError=>{:fields=>[{:name=>:reason, :type=>"NewEntityCreationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.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}]}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}]}, :PagingError=>{:fields=>[{:name=>:reason, :type=>"PagingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :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"}, :SharedSet=>{:fields=>[{:name=>:shared_set_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"SharedSetType", :min_occurs=>0, :max_occurs=>1}, {:name=>:member_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:reference_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:status, :type=>"SharedSet.Status", :min_occurs=>0, :max_occurs=>1}]}, :SharedSetError=>{:fields=>[{:name=>:reason, :type=>"SharedSetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SharedSetOperation=>{:fields=>[{:name=>:operand, :type=>"SharedSet", :min_occurs=>0, :max_occurs=>1}], :base=>"Operation"}, :SharedSetPage=>{:fields=>[{:name=>:entries, :type=>"SharedSet", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"NullStatsPage"}, :SharedSetReturnValue=>{:fields=>[{:name=>:value, :type=>"SharedSet", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ListReturnValue"}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :SoapHeader=>{:fields=>[{: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}]}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.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}, :NullStatsPage=>{:fields=>[], :abstract=>true, :base=>"Page"}, :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}, :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}, :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}]}, :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}]}, :"AuthenticationError.Reason"=>{:fields=>[]}, :"AuthorizationError.Reason"=>{:fields=>[]}, :"ClientTermsError.Reason"=>{:fields=>[]}, :"DatabaseError.Reason"=>{:fields=>[]}, :"DistinctError.Reason"=>{:fields=>[]}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[]}, :"EntityNotFound.Reason"=>{:fields=>[]}, :"IdError.Reason"=>{:fields=>[]}, :"InternalApiError.Reason"=>{:fields=>[]}, :"NewEntityCreationError.Reason"=>{:fields=>[]}, :"NotEmptyError.Reason"=>{:fields=>[]}, :"NullError.Reason"=>{:fields=>[]}, :"OperationAccessDenied.Reason"=>{:fields=>[]}, :Operator=>{:fields=>[]}, :"OperatorError.Reason"=>{:fields=>[]}, :"PagingError.Reason"=>{:fields=>[]}, :"Predicate.Operator"=>{:fields=>[]}, :"QuotaCheckError.Reason"=>{:fields=>[]}, :"RangeError.Reason"=>{:fields=>[]}, :"RateExceededError.Reason"=>{:fields=>[]}, :"ReadOnlyError.Reason"=>{:fields=>[]}, :"RejectedError.Reason"=>{:fields=>[]}, :"RequestError.Reason"=>{:fields=>[]}, :"RequiredError.Reason"=>{:fields=>[]}, :"SharedSet.Status"=>{:fields=>[]}, :"SharedSetError.Reason"=>{:fields=>[]}, :SharedSetType=>{:fields=>[]}, :"SizeLimitError.Reason"=>{:fields=>[]}, :SortOrder=>{:fields=>[]}, :"StringLengthError.Reason"=>{:fields=>[]}} + SHAREDSETSERVICE_NAMESPACES = [] + + def self.get_method_signature(method_name) + return SHAREDSETSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return SHAREDSETSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return SHAREDSETSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, SharedSetServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/targeting_idea_service.rb b/adwords_api/lib/adwords_api/v201502/targeting_idea_service.rb new file mode 100755 index 000000000..d91836998 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/targeting_idea_service.rb @@ -0,0 +1,34 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:43. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/targeting_idea_service_registry' + +module AdwordsApi; module V201502; module TargetingIdeaService + class TargetingIdeaService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/o/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + private + + def get_service_registry() + return TargetingIdeaServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::TargetingIdeaService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/targeting_idea_service_registry.rb b/adwords_api/lib/adwords_api/v201502/targeting_idea_service_registry.rb new file mode 100755 index 000000000..3386d0ea4 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/targeting_idea_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:43. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module TargetingIdeaService + class TargetingIdeaServiceRegistry + TARGETINGIDEASERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"TargetingIdeaSelector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"TargetingIdeaPage", :min_occurs=>0, :max_occurs=>1}]}}} + TARGETINGIDEASERVICE_TYPES = {:AdGroupCriterionError=>{:fields=>[{:name=>:reason, :type=>"AdGroupCriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AdGroupCriterionLimitExceeded=>{:fields=>[{:name=>:limit_type, :type=>"AdGroupCriterionLimitExceeded.CriteriaLimitType", :min_occurs=>0, :max_occurs=>1}], :base=>"EntityCountLimitExceeded", :ns=>0}, :AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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, :ns=>0}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException", :ns=>0}, :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}], :ns=>0}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :BiddingError=>{:fields=>[{:name=>:reason, :type=>"BiddingError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :BudgetError=>{:fields=>[{:name=>:reason, :type=>"BudgetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :ns=>0}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :CriterionError=>{:fields=>[{:name=>:reason, :type=>"CriterionError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :CriterionPolicyError=>{:fields=>[], :base=>"PolicyViolationError", :ns=>0}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue", :ns=>0}, :EntityCountLimitExceeded=>{:fields=>[{:name=>:reason, :type=>"EntityCountLimitExceeded.Reason", :min_occurs=>0, :max_occurs=>1}, {:name=>:enclosing_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:limit, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:account_limit_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:existing_count, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Language=>{:fields=>[{:name=>:code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Location=>{:fields=>[{:name=>:location_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_status, :type=>"LocationTargetingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion", :ns=>0}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue", :ns=>0}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue", :ns=>0}, :NetworkSetting=>{:fields=>[{:name=>:target_google_search, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_search_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_content_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_partner_search_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue", :ns=>0}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :Paging=>{:fields=>[{:name=>:start_index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:number_results, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Platform=>{:fields=>[{:name=>:platform_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :PolicyViolationError=>{:fields=>[{:name=>:key, :type=>"PolicyViolationKey", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:external_policy_description, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_exemptable, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_parts, :type=>"PolicyViolationError.Part", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApiError", :ns=>0}, :"PolicyViolationError.Part"=>{:fields=>[{:name=>:index, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:length, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :PolicyViolationKey=>{:fields=>[{:name=>:policy_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:violating_text, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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", :ns=>0}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RegionCodeError=>{:fields=>[{:name=>:reason, :type=>"RegionCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SoapHeader=>{:fields=>[{: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}], :ns=>0}, :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}], :ns=>0}, :StatsQueryError=>{:fields=>[{:name=>:reason, :type=>"StatsQueryError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :TargetError=>{:fields=>[{:name=>:reason, :type=>"TargetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion", :ns=>0}, :"AdGroupCriterionError.Reason"=>{:fields=>[], :ns=>0}, :"AdGroupCriterionLimitExceeded.CriteriaLimitType"=>{:fields=>[], :ns=>0}, :"AdxError.Reason"=>{:fields=>[], :ns=>0}, :"AuthenticationError.Reason"=>{:fields=>[], :ns=>0}, :"AuthorizationError.Reason"=>{:fields=>[], :ns=>0}, :"BiddingError.Reason"=>{:fields=>[], :ns=>0}, :"BudgetError.Reason"=>{:fields=>[], :ns=>0}, :"ClientTermsError.Reason"=>{:fields=>[], :ns=>0}, :"CollectionSizeError.Reason"=>{:fields=>[], :ns=>0}, :"Criterion.Type"=>{:fields=>[], :ns=>0}, :"CriterionError.Reason"=>{:fields=>[], :ns=>0}, :"DatabaseError.Reason"=>{:fields=>[], :ns=>0}, :"DateError.Reason"=>{:fields=>[], :ns=>0}, :"DistinctError.Reason"=>{:fields=>[], :ns=>0}, :"EntityCountLimitExceeded.Reason"=>{:fields=>[], :ns=>0}, :"EntityNotFound.Reason"=>{:fields=>[], :ns=>0}, :"IdError.Reason"=>{:fields=>[], :ns=>0}, :"InternalApiError.Reason"=>{:fields=>[], :ns=>0}, :KeywordMatchType=>{:fields=>[], :ns=>0}, :LocationTargetingStatus=>{:fields=>[], :ns=>0}, :"NotEmptyError.Reason"=>{:fields=>[], :ns=>0}, :"NullError.Reason"=>{:fields=>[], :ns=>0}, :"OperationAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :"QuotaCheckError.Reason"=>{:fields=>[], :ns=>0}, :"RangeError.Reason"=>{:fields=>[], :ns=>0}, :"RateExceededError.Reason"=>{:fields=>[], :ns=>0}, :"ReadOnlyError.Reason"=>{:fields=>[], :ns=>0}, :"RegionCodeError.Reason"=>{:fields=>[], :ns=>0}, :"RejectedError.Reason"=>{:fields=>[], :ns=>0}, :"RequestError.Reason"=>{:fields=>[], :ns=>0}, :"RequiredError.Reason"=>{:fields=>[], :ns=>0}, :"SizeLimitError.Reason"=>{:fields=>[], :ns=>0}, :"StatsQueryError.Reason"=>{:fields=>[], :ns=>0}, :"StringFormatError.Reason"=>{:fields=>[], :ns=>0}, :"StringLengthError.Reason"=>{:fields=>[], :ns=>0}, :"TargetError.Reason"=>{:fields=>[], :ns=>0}, :"CriterionUserList.MembershipStatus"=>{:fields=>[], :ns=>0}, :AdFormatSpec=>{:fields=>[{:name=>:format, :type=>"SiteConstants.AdFormat", :min_occurs=>0, :max_occurs=>1}]}, :AdFormatSpecListAttribute=>{:fields=>[{:name=>:value, :type=>"AdFormatSpec", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Attribute"}, :AdSpec=>{:fields=>[], :choices=>[{:name=>:display_ad_spec, :original_name=>"DisplayAdSpec", :type=>"DisplayAdSpec", :min_occurs=>1, :max_occurs=>1}, {:name=>:in_stream_ad_spec, :original_name=>"InStreamAdSpec", :type=>"InStreamAdSpec", :min_occurs=>1, :max_occurs=>1}, {:name=>:text_ad_spec, :original_name=>"TextAdSpec", :type=>"TextAdSpec", :min_occurs=>1, :max_occurs=>1}]}, :AdSpecListAttribute=>{:fields=>[{:name=>:value, :type=>"AdSpec", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Attribute"}, :Attribute=>{:fields=>[{:name=>:attribute_type, :original_name=>"Attribute.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :BooleanAttribute=>{:fields=>[{:name=>:value, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :CategoryProductsAndServicesSearchParameter=>{:fields=>[{:name=>:category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"SearchParameter"}, :CompetitionSearchParameter=>{:fields=>[{:name=>:levels, :type=>"CompetitionSearchParameter.Level", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"SearchParameter"}, :CriterionAttribute=>{:fields=>[{:name=>:value, :type=>"Criterion", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :CurrencyCodeError=>{:fields=>[{:name=>:reason, :type=>"CurrencyCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :DisplayAdSpec=>{:fields=>[{:name=>:display_types, :type=>"DisplayType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:activation_options, :type=>"DisplayAdSpec.ActivationOption", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:ad_size_specs, :type=>"DisplayAdSpec.AdSizeSpec", :min_occurs=>0, :max_occurs=>:unbounded}]}, :"DisplayAdSpec.AdSizeSpec"=>{:fields=>[{:name=>:width, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:height, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:activation_option_filter, :type=>"DisplayAdSpec.ActivationOption", :min_occurs=>0, :max_occurs=>:unbounded}]}, :DisplayType=>{:fields=>[], :choices=>[{:name=>:flash_display_type, :original_name=>"FlashDisplayType", :type=>"FlashDisplayType", :min_occurs=>1, :max_occurs=>1}, {:name=>:html_display_type, :original_name=>"HtmlDisplayType", :type=>"HtmlDisplayType", :min_occurs=>1, :max_occurs=>1}, {:name=>:image_display_type, :original_name=>"ImageDisplayType", :type=>"ImageDisplayType", :min_occurs=>1, :max_occurs=>1}]}, :DoubleAttribute=>{:fields=>[{:name=>:value, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :ExcludedKeywordSearchParameter=>{:fields=>[{:name=>:keywords, :type=>"Keyword", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"SearchParameter"}, :FlashDisplayType=>{:fields=>[]}, :HtmlDisplayType=>{:fields=>[{:name=>:html_option, :type=>"HtmlDisplayType.HtmlOption", :min_occurs=>0, :max_occurs=>1}]}, :IdeaTextFilterSearchParameter=>{:fields=>[{:name=>:included, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:excluded, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"SearchParameter"}, :IdeaTypeAttribute=>{:fields=>[{:name=>:value, :type=>"IdeaType", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :ImageDisplayType=>{:fields=>[]}, :InStreamAdInfo=>{:fields=>[{: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=>"int", :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, :type=>"double", :min_occurs=>0, :max_occurs=>1}]}, :InStreamAdInfoAttribute=>{:fields=>[{:name=>:value, :type=>"InStreamAdInfo", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :InStreamAdSpec=>{:fields=>[{:name=>:in_stream_types, :type=>"InStreamAdSpec.InStreamType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:durations, :type=>"long", :min_occurs=>0, :max_occurs=>:unbounded}]}, :IncludeAdultContentSearchParameter=>{:fields=>[], :base=>"SearchParameter"}, :IntegerAttribute=>{:fields=>[{:name=>:value, :type=>"int", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :IntegerSetAttribute=>{:fields=>[{:name=>:value, :type=>"int", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Attribute"}, :KeywordAttribute=>{:fields=>[{:name=>:value, :type=>"Keyword", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :LanguageSearchParameter=>{:fields=>[{:name=>:languages, :type=>"Language", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"SearchParameter"}, :LocationSearchParameter=>{:fields=>[{:name=>:locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"SearchParameter"}, :LongAttribute=>{:fields=>[{:name=>:value, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :LongComparisonOperation=>{:fields=>[{:name=>:minimum, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:maximum, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :LongRangeAttribute=>{:fields=>[{:name=>:value, :type=>"Range", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :MoneyAttribute=>{:fields=>[{:name=>:value, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :MonthlySearchVolume=>{:fields=>[{:name=>:year, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:month, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:count, :type=>"long", :min_occurs=>0, :max_occurs=>1}]}, :MonthlySearchVolumeAttribute=>{:fields=>[{:name=>:value, :type=>"MonthlySearchVolume", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Attribute"}, :NetworkSearchParameter=>{:fields=>[{:name=>:network_setting, :type=>"NetworkSetting", :min_occurs=>0, :max_occurs=>1}], :base=>"SearchParameter"}, :PlacementAttribute=>{:fields=>[{:name=>:value, :type=>"Placement", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :PlacementTypeAttribute=>{:fields=>[{:name=>:value, :type=>"SiteConstants.PlacementType", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :Range=>{:fields=>[{:name=>:min, :type=>"ComparableValue", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"ComparableValue", :min_occurs=>0, :max_occurs=>1}]}, :RelatedToQuerySearchParameter=>{:fields=>[{:name=>:queries, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"SearchParameter"}, :RelatedToUrlSearchParameter=>{:fields=>[{:name=>:urls, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:include_sub_urls, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"SearchParameter"}, :SearchParameter=>{:fields=>[{:name=>:search_parameter_type, :original_name=>"SearchParameter.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :SearchVolumeSearchParameter=>{:fields=>[{:name=>:operation, :type=>"LongComparisonOperation", :min_occurs=>0, :max_occurs=>1}], :base=>"SearchParameter"}, :SeedAdGroupIdSearchParameter=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"SearchParameter"}, :StringAttribute=>{:fields=>[{:name=>:value, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :TargetingIdea=>{:fields=>[{:name=>:data, :type=>"Type_AttributeMapEntry", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TargetingIdeaError=>{:fields=>[{:name=>:reason, :type=>"TargetingIdeaError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TargetingIdeaPage=>{:fields=>[{:name=>:total_num_entries, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:entries, :type=>"TargetingIdea", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TargetingIdeaSelector=>{:fields=>[{:name=>:search_parameters, :type=>"SearchParameter", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:idea_type, :type=>"IdeaType", :min_occurs=>0, :max_occurs=>1}, {:name=>:request_type, :type=>"RequestType", :min_occurs=>0, :max_occurs=>1}, {:name=>:requested_attribute_types, :type=>"AttributeType", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:paging, :type=>"Paging", :min_occurs=>0, :max_occurs=>1}, {:name=>:locale_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:currency_code, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :TextAdSpec=>{:fields=>[]}, :TrafficEstimatorError=>{:fields=>[{:name=>:reason, :type=>"TrafficEstimatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Type_AttributeMapEntry=>{:fields=>[{:name=>:key, :type=>"AttributeType", :min_occurs=>0, :max_occurs=>1}, {:name=>:value, :type=>"Attribute", :min_occurs=>0, :max_occurs=>1}]}, :WebpageDescriptor=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:title, :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :WebpageDescriptorAttribute=>{:fields=>[{:name=>:value, :type=>"WebpageDescriptor", :min_occurs=>0, :max_occurs=>1}], :base=>"Attribute"}, :AttributeType=>{:fields=>[]}, :"CompetitionSearchParameter.Level"=>{:fields=>[]}, :"CurrencyCodeError.Reason"=>{:fields=>[]}, :"DisplayAdSpec.ActivationOption"=>{:fields=>[]}, :"HtmlDisplayType.HtmlOption"=>{:fields=>[]}, :IdeaType=>{:fields=>[]}, :"InStreamAdSpec.InStreamType"=>{:fields=>[]}, :RequestType=>{:fields=>[]}, :"SiteConstants.AdFormat"=>{:fields=>[]}, :"SiteConstants.PlacementType"=>{:fields=>[]}, :"TargetingIdeaError.Reason"=>{:fields=>[]}, :"TrafficEstimatorError.Reason"=>{:fields=>[]}} + TARGETINGIDEASERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201502"] + + def self.get_method_signature(method_name) + return TARGETINGIDEASERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return TARGETINGIDEASERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return TARGETINGIDEASERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, TargetingIdeaServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/traffic_estimator_service.rb b/adwords_api/lib/adwords_api/v201502/traffic_estimator_service.rb new file mode 100755 index 000000000..4f3896a8c --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/traffic_estimator_service.rb @@ -0,0 +1,34 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:44. + +require 'ads_common/savon_service' +require 'adwords_api/v201502/traffic_estimator_service_registry' + +module AdwordsApi; module V201502; module TrafficEstimatorService + class TrafficEstimatorService < AdsCommon::SavonService + def initialize(config, endpoint) + namespace = 'https://adwords.google.com/api/adwords/o/v201502' + super(config, endpoint, namespace, :v201502) + end + + def get(*args, &block) + return execute_action('get', args, &block) + end + + private + + def get_service_registry() + return TrafficEstimatorServiceRegistry + end + + def get_module() + return AdwordsApi::V201502::TrafficEstimatorService + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/v201502/traffic_estimator_service_registry.rb b/adwords_api/lib/adwords_api/v201502/traffic_estimator_service_registry.rb new file mode 100755 index 000000000..9e6a653e1 --- /dev/null +++ b/adwords_api/lib/adwords_api/v201502/traffic_estimator_service_registry.rb @@ -0,0 +1,46 @@ +# Encoding: utf-8 +# +# This is auto-generated code, changes will be overwritten. +# +# Copyright:: Copyright 2015, Google Inc. All Rights Reserved. +# License:: Licensed under the Apache License, Version 2.0. +# +# Code generated by AdsCommon library 0.9.8 on 2015-03-12 10:31:44. + +require 'adwords_api/errors' + +module AdwordsApi; module V201502; module TrafficEstimatorService + class TrafficEstimatorServiceRegistry + TRAFFICESTIMATORSERVICE_METHODS = {:get=>{:input=>[{:name=>:selector, :type=>"TrafficEstimatorSelector", :min_occurs=>0, :max_occurs=>1}], :output=>{:name=>"get_response", :fields=>[{:name=>:rval, :type=>"TrafficEstimatorResult", :min_occurs=>0, :max_occurs=>1}]}}} + TRAFFICESTIMATORSERVICE_TYPES = {:AdxError=>{:fields=>[{:name=>:reason, :type=>"AdxError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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, :ns=>0}, :ApiException=>{:fields=>[{:name=>:errors, :type=>"ApiError", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"ApplicationException", :ns=>0}, :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}], :ns=>0}, :AuthenticationError=>{:fields=>[{:name=>:reason, :type=>"AuthenticationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :AuthorizationError=>{:fields=>[{:name=>:reason, :type=>"AuthorizationError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ClientTermsError=>{:fields=>[{:name=>:reason, :type=>"ClientTermsError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :CollectionSizeError=>{:fields=>[{:name=>:reason, :type=>"CollectionSizeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :ComparableValue=>{:fields=>[{:name=>:comparable_value_type, :original_name=>"ComparableValue.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true, :ns=>0}, :Criterion=>{:fields=>[{:name=>:id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:type, :type=>"Criterion.Type", :min_occurs=>0, :max_occurs=>1}, {:name=>:criterion_type, :original_name=>"Criterion.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :DatabaseError=>{:fields=>[{:name=>:reason, :type=>"DatabaseError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DateError=>{:fields=>[{:name=>:reason, :type=>"DateError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DistinctError=>{:fields=>[{:name=>:reason, :type=>"DistinctError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :DoubleValue=>{:fields=>[{:name=>:number, :type=>"double", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue", :ns=>0}, :EntityAccessDenied=>{:fields=>[{:name=>:reason, :type=>"EntityAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :EntityNotFound=>{:fields=>[{:name=>:reason, :type=>"EntityNotFound.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :IdError=>{:fields=>[{:name=>:reason, :type=>"IdError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :InternalApiError=>{:fields=>[{:name=>:reason, :type=>"InternalApiError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :Keyword=>{:fields=>[{:name=>:text, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:match_type, :type=>"KeywordMatchType", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Language=>{:fields=>[{:name=>:code, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Location=>{:fields=>[{:name=>:location_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_type, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:targeting_status, :type=>"LocationTargetingStatus", :min_occurs=>0, :max_occurs=>1}, {:name=>:parent_locations, :type=>"Location", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion", :ns=>0}, :LongValue=>{:fields=>[{:name=>:number, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"NumberValue", :ns=>0}, :MobileAppCategory=>{:fields=>[{:name=>:mobile_app_category_id, :type=>"int", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :MobileApplication=>{:fields=>[{:name=>:app_id, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:display_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Money=>{:fields=>[{:name=>:micro_amount, :type=>"long", :min_occurs=>0, :max_occurs=>1}], :base=>"ComparableValue", :ns=>0}, :NetworkSetting=>{:fields=>[{:name=>:target_google_search, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_search_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_content_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}, {:name=>:target_partner_search_network, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :ns=>0}, :NotEmptyError=>{:fields=>[{:name=>:reason, :type=>"NotEmptyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NullError=>{:fields=>[{:name=>:reason, :type=>"NullError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :NumberValue=>{:fields=>[], :abstract=>true, :base=>"ComparableValue", :ns=>0}, :OperationAccessDenied=>{:fields=>[{:name=>:reason, :type=>"OperationAccessDenied.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :OperatorError=>{:fields=>[{:name=>:reason, :type=>"OperatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :Placement=>{:fields=>[{:name=>:url, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Platform=>{:fields=>[{:name=>:platform_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :QuotaCheckError=>{:fields=>[{:name=>:reason, :type=>"QuotaCheckError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RangeError=>{:fields=>[{:name=>:reason, :type=>"RangeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :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", :ns=>0}, :ReadOnlyError=>{:fields=>[{:name=>:reason, :type=>"ReadOnlyError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RegionCodeError=>{:fields=>[{:name=>:reason, :type=>"RegionCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RejectedError=>{:fields=>[{:name=>:reason, :type=>"RejectedError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequestError=>{:fields=>[{:name=>:reason, :type=>"RequestError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :RequiredError=>{:fields=>[{:name=>:reason, :type=>"RequiredError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SizeLimitError=>{:fields=>[{:name=>:reason, :type=>"SizeLimitError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :SoapHeader=>{:fields=>[{: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}], :ns=>0}, :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}], :ns=>0}, :StringFormatError=>{:fields=>[{:name=>:reason, :type=>"StringFormatError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :StringLengthError=>{:fields=>[{:name=>:reason, :type=>"StringLengthError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :TargetError=>{:fields=>[{:name=>:reason, :type=>"TargetError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError", :ns=>0}, :CriterionUserInterest=>{:fields=>[{:name=>:user_interest_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_interest_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :CriterionUserList=>{:fields=>[{:name=>:user_list_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_name, :type=>"string", :min_occurs=>0, :max_occurs=>1}, {:name=>:user_list_membership_status, :type=>"CriterionUserList.MembershipStatus", :min_occurs=>0, :max_occurs=>1}], :base=>"Criterion", :ns=>0}, :Vertical=>{:fields=>[{:name=>:vertical_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:vertical_parent_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:path, :type=>"string", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Criterion", :ns=>0}, :"AdxError.Reason"=>{:fields=>[], :ns=>0}, :"AuthenticationError.Reason"=>{:fields=>[], :ns=>0}, :"AuthorizationError.Reason"=>{:fields=>[], :ns=>0}, :"ClientTermsError.Reason"=>{:fields=>[], :ns=>0}, :"CollectionSizeError.Reason"=>{:fields=>[], :ns=>0}, :"Criterion.Type"=>{:fields=>[], :ns=>0}, :"DatabaseError.Reason"=>{:fields=>[], :ns=>0}, :"DateError.Reason"=>{:fields=>[], :ns=>0}, :"DistinctError.Reason"=>{:fields=>[], :ns=>0}, :"EntityAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :"EntityNotFound.Reason"=>{:fields=>[], :ns=>0}, :"IdError.Reason"=>{:fields=>[], :ns=>0}, :"InternalApiError.Reason"=>{:fields=>[], :ns=>0}, :KeywordMatchType=>{:fields=>[], :ns=>0}, :LocationTargetingStatus=>{:fields=>[], :ns=>0}, :"NotEmptyError.Reason"=>{:fields=>[], :ns=>0}, :"NullError.Reason"=>{:fields=>[], :ns=>0}, :"OperationAccessDenied.Reason"=>{:fields=>[], :ns=>0}, :"OperatorError.Reason"=>{:fields=>[], :ns=>0}, :"QuotaCheckError.Reason"=>{:fields=>[], :ns=>0}, :"RangeError.Reason"=>{:fields=>[], :ns=>0}, :"RateExceededError.Reason"=>{:fields=>[], :ns=>0}, :"ReadOnlyError.Reason"=>{:fields=>[], :ns=>0}, :"RegionCodeError.Reason"=>{:fields=>[], :ns=>0}, :"RejectedError.Reason"=>{:fields=>[], :ns=>0}, :"RequestError.Reason"=>{:fields=>[], :ns=>0}, :"RequiredError.Reason"=>{:fields=>[], :ns=>0}, :"SizeLimitError.Reason"=>{:fields=>[], :ns=>0}, :"StringFormatError.Reason"=>{:fields=>[], :ns=>0}, :"StringLengthError.Reason"=>{:fields=>[], :ns=>0}, :"TargetError.Reason"=>{:fields=>[], :ns=>0}, :"CriterionUserList.MembershipStatus"=>{:fields=>[], :ns=>0}, :AdGroupEstimate=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:keyword_estimates, :type=>"KeywordEstimate", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Estimate"}, :AdGroupEstimateRequest=>{:fields=>[{:name=>:ad_group_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:keyword_estimate_requests, :type=>"KeywordEstimateRequest", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:max_cpc, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"EstimateRequest"}, :CampaignEstimate=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_estimates, :type=>"AdGroupEstimate", :min_occurs=>0, :max_occurs=>:unbounded}], :base=>"Estimate"}, :CampaignEstimateRequest=>{:fields=>[{:name=>:campaign_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:ad_group_estimate_requests, :type=>"AdGroupEstimateRequest", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:criteria, :type=>"Criterion", :min_occurs=>0, :max_occurs=>:unbounded}, {:name=>:network_setting, :type=>"NetworkSetting", :min_occurs=>0, :max_occurs=>1}, {:name=>:daily_budget, :type=>"Money", :min_occurs=>0, :max_occurs=>1}], :base=>"EstimateRequest"}, :CurrencyCodeError=>{:fields=>[{:name=>:reason, :type=>"CurrencyCodeError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :Estimate=>{:fields=>[{:name=>:estimate_type, :original_name=>"Estimate.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}]}, :EstimateRequest=>{:fields=>[{:name=>:estimate_request_type, :original_name=>"EstimateRequest.Type", :type=>"string", :min_occurs=>0, :max_occurs=>1}], :abstract=>true}, :KeywordEstimate=>{:fields=>[{:name=>:criterion_id, :type=>"long", :min_occurs=>0, :max_occurs=>1}, {:name=>:min, :type=>"StatsEstimate", :min_occurs=>0, :max_occurs=>1}, {:name=>:max, :type=>"StatsEstimate", :min_occurs=>0, :max_occurs=>1}], :base=>"Estimate"}, :KeywordEstimateRequest=>{:fields=>[{:name=>:keyword, :type=>"Keyword", :min_occurs=>0, :max_occurs=>1}, {:name=>:max_cpc, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:is_negative, :type=>"boolean", :min_occurs=>0, :max_occurs=>1}], :base=>"EstimateRequest"}, :StatsEstimate=>{:fields=>[{:name=>:average_cpc, :type=>"Money", :min_occurs=>0, :max_occurs=>1}, {:name=>:average_position, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:click_through_rate, :type=>"double", :min_occurs=>0, :max_occurs=>1}, {:name=>:clicks_per_day, :type=>"float", :min_occurs=>0, :max_occurs=>1}, {:name=>:impressions_per_day, :type=>"float", :min_occurs=>0, :max_occurs=>1}, {:name=>:total_cost, :type=>"Money", :min_occurs=>0, :max_occurs=>1}]}, :TrafficEstimatorError=>{:fields=>[{:name=>:reason, :type=>"TrafficEstimatorError.Reason", :min_occurs=>0, :max_occurs=>1}], :base=>"ApiError"}, :TrafficEstimatorResult=>{:fields=>[{:name=>:campaign_estimates, :type=>"CampaignEstimate", :min_occurs=>0, :max_occurs=>:unbounded}]}, :TrafficEstimatorSelector=>{:fields=>[{:name=>:campaign_estimate_requests, :type=>"CampaignEstimateRequest", :min_occurs=>0, :max_occurs=>:unbounded}]}, :"CurrencyCodeError.Reason"=>{:fields=>[]}, :"TrafficEstimatorError.Reason"=>{:fields=>[]}} + TRAFFICESTIMATORSERVICE_NAMESPACES = ["https://adwords.google.com/api/adwords/cm/v201502"] + + def self.get_method_signature(method_name) + return TRAFFICESTIMATORSERVICE_METHODS[method_name.to_sym] + end + + def self.get_type_signature(type_name) + return TRAFFICESTIMATORSERVICE_TYPES[type_name.to_sym] + end + + def self.get_namespace(index) + return TRAFFICESTIMATORSERVICE_NAMESPACES[index] + end + end + + # Base class for exceptions. + class ApplicationException < AdwordsApi::Errors::ApiException + attr_reader :message # string + attr_reader :application_exception_type # string + end + + # Exception class for holding a list of service errors. + class ApiException < ApplicationException + attr_reader :errors # ApiError + def initialize(exception_fault) + @array_fields ||= [] + @array_fields << 'errors' + super(exception_fault, TrafficEstimatorServiceRegistry) + end + end +end; end; end diff --git a/adwords_api/lib/adwords_api/version.rb b/adwords_api/lib/adwords_api/version.rb index 58f0f7f0a..144996668 100755 --- a/adwords_api/lib/adwords_api/version.rb +++ b/adwords_api/lib/adwords_api/version.rb @@ -21,6 +21,6 @@ module AdwordsApi module ApiConfig - CLIENT_LIB_VERSION = '0.14.1' + CLIENT_LIB_VERSION = '0.14.2' end end diff --git a/adwords_api/test/adwords_api/test_adwords_api.rb b/adwords_api/test/adwords_api/test_adwords_api.rb index 1cea2f11d..0e1aa6bf5 100755 --- a/adwords_api/test/adwords_api/test_adwords_api.rb +++ b/adwords_api/test/adwords_api/test_adwords_api.rb @@ -36,7 +36,7 @@ def warn(message) class TestAdwordsApi < Test::Unit::TestCase - API_VERSION = :v201406 + API_VERSION = :v201409 def setup() @logger = LoggerStub.new @@ -100,15 +100,4 @@ def test_prod_env() }) service = adwords_api.service(:ManagedCustomerService, API_VERSION) end - - def test_clientlogin_error() - adwords_api = AdwordsApi::Api.new({ - :library => {:logger => @logger}, - :authentication => {:method => 'ClientLogin'}, - :service => {:environment => 'PRODUCTION'} - }) - assert_raise AdsCommon::Errors::AuthError do - service = adwords_api.service(:CampaignService, API_VERSION) - end - end end diff --git a/adwords_api/test/templates/v201406/basic_operations_get_campaigns.def b/adwords_api/test/templates/v201406/basic_operations_get_campaigns.def index 53b851331..b1fd06923 100755 --- a/adwords_api/test/templates/v201406/basic_operations_get_campaigns.def +++ b/adwords_api/test/templates/v201406/basic_operations_get_campaigns.def @@ -22,7 +22,7 @@ def setup_mocks() {"env:Envelope"=> {"env:Header"=> {"wsdl:RequestHeader"=> - {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.0, Common-Ruby/0.9.6, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", + {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.1, Common-Ruby/0.9.8, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", "developerToken"=>"dev_token123", "clientCustomerId"=>"123-456-7890", "authToken"=>"abcAuthbcd", diff --git a/adwords_api/test/templates/v201406/misc_use_oauth2_jwt.def b/adwords_api/test/templates/v201406/misc_use_oauth2_jwt.def index 30f4c4ad0..bebdc30e5 100755 --- a/adwords_api/test/templates/v201406/misc_use_oauth2_jwt.def +++ b/adwords_api/test/templates/v201406/misc_use_oauth2_jwt.def @@ -40,7 +40,7 @@ def setup_mocks() {"env:Envelope"=> {"env:Header"=> {"wsdl:RequestHeader"=> - {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.0, Common-Ruby/0.9.6, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", + {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.1, Common-Ruby/0.9.8, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", "developerToken"=>"dev_token123", "clientCustomerId"=>"123-456-7890", "xmlns"=>"https://adwords.google.com/api/adwords/cm/v201406"}}, diff --git a/adwords_api/test/templates/v201409/basic_operations_get_campaigns.def b/adwords_api/test/templates/v201409/basic_operations_get_campaigns.def index ee5f11b01..c423e1122 100755 --- a/adwords_api/test/templates/v201409/basic_operations_get_campaigns.def +++ b/adwords_api/test/templates/v201409/basic_operations_get_campaigns.def @@ -22,7 +22,7 @@ def setup_mocks() {"env:Envelope"=> {"env:Header"=> {"wsdl:RequestHeader"=> - {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.0, Common-Ruby/0.9.6, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", + {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.1, Common-Ruby/0.9.8, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", "developerToken"=>"dev_token123", "clientCustomerId"=>"123-456-7890", "authToken"=>"abcAuthbcd", diff --git a/adwords_api/test/templates/v201409/misc_use_oauth2_jwt.def b/adwords_api/test/templates/v201409/misc_use_oauth2_jwt.def index d5482e481..c16f800a8 100755 --- a/adwords_api/test/templates/v201409/misc_use_oauth2_jwt.def +++ b/adwords_api/test/templates/v201409/misc_use_oauth2_jwt.def @@ -40,7 +40,7 @@ def setup_mocks() {"env:Envelope"=> {"env:Header"=> {"wsdl:RequestHeader"=> - {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.0, Common-Ruby/0.9.6, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", + {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.1, Common-Ruby/0.9.8, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", "developerToken"=>"dev_token123", "clientCustomerId"=>"123-456-7890", "xmlns"=>"https://adwords.google.com/api/adwords/cm/v201409"}}, diff --git a/adwords_api/test/templates/v201502/basic_operations_get_campaigns.def b/adwords_api/test/templates/v201502/basic_operations_get_campaigns.def new file mode 100755 index 000000000..d370064bd --- /dev/null +++ b/adwords_api/test/templates/v201502/basic_operations_get_campaigns.def @@ -0,0 +1,114 @@ +def setup_mocks() + $api_config = { + :service => {:environment => 'PRODUCTION'}, + :authentication => { + :method => 'ClientLogin', + :email => 'noreply@google.com', + :password => 'noreply_password', + :developer_token => 'dev_token123', + :client_customer_id => '123-456-7890', + :user_agent => 'ruby-tests' + } + } + + stub_request(:post, "https://www.google.com/accounts/ClientLogin"). + with(:body => {"Email"=>"noreply@google.com", "Passwd"=>"noreply_password", "accountType"=>"GOOGLE", "service"=>"adwords"}). + to_return(:status => 200, :body => "SID=abcSIDbcd\nLSID=abcLSIDbcd\nAuth=abcAuthbcd\n", :headers => {}) + + stub_request(:post, "https://adwords.google.com/api/adwords/cm/v201502/CampaignService"). + with( + :body => + # autogenerated code + {"env:Envelope"=> + {"env:Header"=> + {"wsdl:RequestHeader"=> + {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.1, Common-Ruby/0.9.8, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", + "developerToken"=>"dev_token123", + "clientCustomerId"=>"123-456-7890", + "authToken"=>"abcAuthbcd", + "xmlns"=>"https://adwords.google.com/api/adwords/cm/v201502"}}, + "env:Body"=> + {"get"=> + {"serviceSelector"=> + {"fields"=>["Id", "Name", "Status"], + "ordering"=>{"field"=>"Name", "sortOrder"=>"ASCENDING"}, + "paging"=>{"startIndex"=>"0", "numberResults"=>"5"}}, + "xmlns"=>"https://adwords.google.com/api/adwords/cm/v201502"}}, + "xmlns:xsd"=>"http://www.w3.org/2001/XMLSchema", + "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance", + "xmlns:wsdl"=>"https://adwords.google.com/api/adwords/cm/v201502", + "xmlns:env"=>"http://schemas.xmlsoap.org/soap/envelope/"}}, + # end of auto-generated code. + :headers => { + 'SOAPAction' => '"get"', + 'Content-Type' => 'text/xml;charset=UTF-8' + } + ). + to_return( + :status => 200, + :body => ' + + + 0004c + CampaignService + get + 42 + 84 + 42 + + + + + + 2 + CampaignPage + + DAILYMoney + 0 + + + 15Campaign name 1PAUSEDALL + CampaignStats0 + + + 16Campaign name 2ACTIVEALL + CampaignStats150 + + + + + ', + :headers => {'content-type' => 'text/xml;'} + ) +end + +def run_asserts() + assert_equal(2, $latest_result[:total_num_entries]) + assert_equal('CampaignPage', $latest_result[:page_type]) + entries = $latest_result[:entries] + assert_equal(2, entries.size) + + if entries[0][:id] == 15 + assert_campaign_15(entries[0]) + assert_campaign_16(entries[1]) + else + assert_campaign_15(entries[1]) + assert_campaign_16(entries[0]) + end +end + +def assert_campaign_15(entry) + assert_equal(15, entry[:id]) + assert_equal('Campaign name 1', entry[:name]) + assert_equal('PAUSED', entry[:status]) + assert_equal({:network=>"ALL", :stats_type=>"CampaignStats"}, entry[:campaign_stats]) + assert_equal({:impressions=>0}, entry[:frequency_cap]) +end + +def assert_campaign_16(entry) + assert_equal(16, entry[:id]) + assert_equal('Campaign name 2', entry[:name]) + assert_equal('ACTIVE', entry[:status]) + assert_equal({:network=>"ALL", :stats_type=>"CampaignStats"}, entry[:campaign_stats]) + assert_equal({:impressions=>150}, entry[:frequency_cap]) +end diff --git a/adwords_api/test/templates/v201502/misc_use_oauth2_jwt.def b/adwords_api/test/templates/v201502/misc_use_oauth2_jwt.def new file mode 100755 index 000000000..08d1158a3 --- /dev/null +++ b/adwords_api/test/templates/v201502/misc_use_oauth2_jwt.def @@ -0,0 +1,131 @@ +def setup_mocks() + file_name = 'privatekey.p12' + file_contents = 'file contents' + key_secret = 'not-secret' + + $api_config = { + :service => {:environment => 'PRODUCTION'}, + :authentication => { + :method => 'OAUTH2_JWT', + :oauth2_issuer => 'not-valid@developer.gserviceaccount.com', + :oauth2_secret => key_secret, + :oauth2_keyfile => file_name, + :developer_token => 'dev_token123', + :client_customer_id => '123-456-7890', + :user_agent => 'ruby-tests' + } + } + + stub(File).file?(file_name) { true } + stub.proxy(File).file? + + stub(File).read(file_name) { file_contents } + stub.proxy(File).read + + key = mock!.key { 'pkcs12 key' } + stub(OpenSSL::PKCS12).new.with(file_contents, key_secret) { key } + + stub_request(:post, "https://accounts.google.com/o/oauth2/token"). + with(:body => hash_including({"grant_type"=>"urn:ietf:params:oauth:grant-type:jwt-bearer"}), + :headers => {'Accept'=>'*/*', 'Cache-Control'=>'no-store', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Ruby'}). + with(:body => /assertion=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9/). + to_return(:status => 200, + :body => "{\n \"access_token\" : \"ab01.CBEF2GHi3JKlMnOpqRstUvW4X-YzaBcdEFG5IjKLMNPPqRStuV\",\n \"token_type\" : \"Bearer\",\n \"expires_in\" : 3600\n}", + :headers => {"Content-Type"=>"application/json"}) + + stub_request(:post, "https://adwords.google.com/api/adwords/cm/v201502/CampaignService"). + with( + :body => + # autogenerated code + {"env:Envelope"=> + {"env:Header"=> + {"wsdl:RequestHeader"=> + {"userAgent"=>"ruby-tests (AwApi-Ruby/0.14.1, Common-Ruby/0.9.8, Savon/1.2.0, ruby/1.9.3, HTTPI/1.1.1, net_http)", + "developerToken"=>"dev_token123", + "clientCustomerId"=>"123-456-7890", + "xmlns"=>"https://adwords.google.com/api/adwords/cm/v201502"}}, + "env:Body"=> + {"get"=> + {"serviceSelector"=> + {"fields"=>["Id", "Name", "Status"], + "ordering"=>{"field"=>"Name", "sortOrder"=>"ASCENDING"}}, + "xmlns"=>"https://adwords.google.com/api/adwords/cm/v201502"}}, + "xmlns:xsd"=>"http://www.w3.org/2001/XMLSchema", + "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance", + "xmlns:wsdl"=>"https://adwords.google.com/api/adwords/cm/v201502", + "xmlns:env"=>"http://schemas.xmlsoap.org/soap/envelope/"}}, + # end of auto-generated code. + :headers => { + 'SOAPAction' => '"get"', + 'Content-Type' => 'text/xml;charset=UTF-8', + 'Authorization' => 'Bearer ab01.CBEF2GHi3JKlMnOpqRstUvW4X-YzaBcdEFG5IjKLMNPPqRStuV' + } + ). + to_return( + :status => 200, + :body => ' + + + 0004c + CampaignService + get + 42 + 84 + 42 + + + + + + 2 + CampaignPage + + DAILYMoney + 0 + + + 15Campaign name 1PAUSEDALL + CampaignStats0 + + + 16Campaign name 2ACTIVEALL + CampaignStats150 + + + + + ', + :headers => {'content-type' => 'text/xml;'} + ) +end + +def run_asserts() + assert_equal(2, $latest_result[:total_num_entries]) + assert_equal('CampaignPage', $latest_result[:page_type]) + entries = $latest_result[:entries] + assert_equal(2, entries.size) + + if entries[0][:id] == 15 + assert_campaign_15(entries[0]) + assert_campaign_16(entries[1]) + else + assert_campaign_15(entries[1]) + assert_campaign_16(entries[0]) + end +end + +def assert_campaign_15(entry) + assert_equal(15, entry[:id]) + assert_equal('Campaign name 1', entry[:name]) + assert_equal('PAUSED', entry[:status]) + assert_equal({:network=>"ALL", :stats_type=>"CampaignStats"}, entry[:campaign_stats]) + assert_equal({:impressions=>0}, entry[:frequency_cap]) +end + +def assert_campaign_16(entry) + assert_equal(16, entry[:id]) + assert_equal('Campaign name 2', entry[:name]) + assert_equal('ACTIVE', entry[:status]) + assert_equal({:network=>"ALL", :stats_type=>"CampaignStats"}, entry[:campaign_stats]) + assert_equal({:impressions=>150}, entry[:frequency_cap]) +end