From 8b65e407e438c3a07578d5c1344174028b078586 Mon Sep 17 00:00:00 2001 From: mcloonan Date: Wed, 13 Jun 2018 12:46:08 -0400 Subject: [PATCH] Release v0_1 (#3) Adding support for Google Ads API v0_1. --- ChangeLog | 5 +- .../recommendations/apply_recommendation.rb | 119 ++++++++ .../get_text_ad_recommendations.rb | 116 ++++++++ .../{v0/services => }/credentials.rb | 16 +- lib/google/ads/googleads/path_lookup_util.rb | 18 ++ lib/google/ads/googleads/proto_lookup_util.rb | 87 +++++- lib/google/ads/googleads/v0/common/ad_pb.rb | 4 + .../ads/googleads/v0/common/criteria_pb.rb | 71 +++++ .../googleads/v0/enums/ad_group_type_pb.rb | 1 + .../ads/googleads/v0/enums/ad_type_pb.rb | 1 + .../v0/enums/advertising_channel_type_pb.rb | 1 + .../ads/googleads/v0/enums/bid_source_pb.rb | 29 -- .../googleads/v0/enums/bidding_source_pb.rb | 29 ++ .../googleads/v0/enums/criterion_type_pb.rb | 3 + .../listing_custom_attribute_index_pb.rb | 31 +++ .../v0/enums/listing_group_type_pb.rb | 28 ++ .../v0/enums/recommendation_type_pb.rb | 30 ++ ...arget_cpa_opt_in_recommendation_goal_pb.rb | 30 ++ .../ads/googleads/v0/errors/ad_error_pb.rb | 1 + .../errors/ad_group_bid_modifier_error_pb.rb | 28 ++ .../v0/errors/ad_group_criterion_error_pb.rb | 18 +- .../v0/errors/authentication_error_pb.rb | 4 - .../v0/errors/authorization_error_pb.rb | 1 + .../googleads/v0/errors/campaign_error_pb.rb | 3 + .../googleads/v0/errors/context_error_pb.rb | 27 ++ .../googleads/v0/errors/criterion_error_pb.rb | 2 + .../ads/googleads/v0/errors/errors_pb.rb | 8 + .../ads/googleads/v0/errors/field_error_pb.rb | 31 +++ .../googleads/v0/errors/internal_error_pb.rb | 1 + .../googleads/v0/errors/mutate_error_pb.rb | 3 - .../ads/googleads/v0/errors/query_error_pb.rb | 2 + .../v0/errors/recommendation_error_pb.rb | 32 +++ .../v0/resources/ad_group_bid_modifier_pb.rb | 33 +++ .../v0/resources/ad_group_criterion_pb.rb | 9 +- .../v0/resources/campaign_criterion_pb.rb | 3 + .../ads/googleads/v0/resources/campaign_pb.rb | 5 + .../ads/googleads/v0/resources/customer_pb.rb | 1 + .../v0/resources/geo_target_constant_pb.rb | 27 ++ .../v0/resources/recommendation_pb.rb | 85 ++++++ .../v0/services/ad_group_ad_service_client.rb | 6 +- .../ad_group_bid_modifier_service_client.rb | 263 ++++++++++++++++++ ...up_bid_modifier_service_client_config.json | 36 +++ .../ad_group_bid_modifier_service_pb.rb | 47 ++++ ..._group_bid_modifier_service_services_pb.rb | 52 ++++ .../ad_group_criterion_service_client.rb | 6 +- .../v0/services/ad_group_service_client.rb | 6 +- .../bidding_strategy_service_client.rb | 6 +- .../campaign_budget_service_client.rb | 6 +- .../campaign_criterion_service_client.rb | 6 +- .../v0/services/campaign_service_client.rb | 6 +- .../v0/services/customer_service_client.rb | 6 +- .../geo_target_constant_service_client.rb | 214 ++++++++++++++ ...target_constant_service_client_config.json | 31 +++ .../geo_target_constant_service_pb.rb | 24 ++ ...geo_target_constant_service_services_pb.rb | 49 ++++ .../google_ads_field_service_client.rb | 6 +- ...oogle_ads_field_service_client_config.json | 4 +- .../v0/services/google_ads_service_client.rb | 6 +- .../google_ads_service_client_config.json | 2 +- .../v0/services/google_ads_service_pb.rb | 6 + .../services/keyword_view_service_client.rb | 6 +- .../services/recommendation_service_client.rb | 262 +++++++++++++++++ .../recommendation_service_client_config.json | 36 +++ .../v0/services/recommendation_service_pb.rb | 73 +++++ .../recommendation_service_services_pb.rb | 51 ++++ lib/google/ads/googleads/version.rb | 2 +- test/test_path_lookup_util.rb | 9 + 67 files changed, 2065 insertions(+), 105 deletions(-) create mode 100644 examples/recommendations/apply_recommendation.rb create mode 100755 examples/recommendations/get_text_ad_recommendations.rb rename lib/google/ads/googleads/{v0/services => }/credentials.rb (60%) delete mode 100644 lib/google/ads/googleads/v0/enums/bid_source_pb.rb create mode 100644 lib/google/ads/googleads/v0/enums/bidding_source_pb.rb create mode 100644 lib/google/ads/googleads/v0/enums/listing_custom_attribute_index_pb.rb create mode 100644 lib/google/ads/googleads/v0/enums/listing_group_type_pb.rb create mode 100644 lib/google/ads/googleads/v0/enums/recommendation_type_pb.rb create mode 100644 lib/google/ads/googleads/v0/enums/target_cpa_opt_in_recommendation_goal_pb.rb create mode 100644 lib/google/ads/googleads/v0/errors/ad_group_bid_modifier_error_pb.rb create mode 100644 lib/google/ads/googleads/v0/errors/context_error_pb.rb create mode 100644 lib/google/ads/googleads/v0/errors/field_error_pb.rb create mode 100644 lib/google/ads/googleads/v0/errors/recommendation_error_pb.rb create mode 100644 lib/google/ads/googleads/v0/resources/ad_group_bid_modifier_pb.rb create mode 100644 lib/google/ads/googleads/v0/resources/geo_target_constant_pb.rb create mode 100644 lib/google/ads/googleads/v0/resources/recommendation_pb.rb create mode 100644 lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_client.rb create mode 100644 lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_client_config.json create mode 100644 lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_pb.rb create mode 100644 lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_services_pb.rb create mode 100644 lib/google/ads/googleads/v0/services/geo_target_constant_service_client.rb create mode 100644 lib/google/ads/googleads/v0/services/geo_target_constant_service_client_config.json create mode 100644 lib/google/ads/googleads/v0/services/geo_target_constant_service_pb.rb create mode 100644 lib/google/ads/googleads/v0/services/geo_target_constant_service_services_pb.rb create mode 100644 lib/google/ads/googleads/v0/services/recommendation_service_client.rb create mode 100644 lib/google/ads/googleads/v0/services/recommendation_service_client_config.json create mode 100644 lib/google/ads/googleads/v0/services/recommendation_service_pb.rb create mode 100644 lib/google/ads/googleads/v0/services/recommendation_service_services_pb.rb diff --git a/ChangeLog b/ChangeLog index 0d814c507..52530b11e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,2 +1,5 @@ +0.2.0: + - Adding support for Google Ads API v0_1. + 0.1.0: - - Initial release with support for Google Ads API V0. + - Initial release with support for Google Ads API v0. diff --git a/examples/recommendations/apply_recommendation.rb b/examples/recommendations/apply_recommendation.rb new file mode 100644 index 000000000..2e00b2671 --- /dev/null +++ b/examples/recommendations/apply_recommendation.rb @@ -0,0 +1,119 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright 2018 Google LLC +# +# 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 +# +# https://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 applies a given recommendation. To retrieve recommendations for +# text ads, run get_text_ad_recommendations.rb. + +require 'optparse' +require 'google/ads/googleads' + +def apply_recommendation(customer_id, recommendation_id) + # GoogleadsClient will read a config file from ENV['HOME']/googleads_config.rb + # when called without parameters + client = Google::Ads::Googleads::GoogleadsClient.new + + recommendation_resource = + client.path.recommendation(customer_id, recommendation_id) + apply_recommendation_operation = client.operation(:ApplyRecommendation) + apply_recommendation_operation.resource_name = recommendation_resource + + # Each recommendation type has optional parameters to override the recommended + # values. This is an example to override a recommended ad when a + # TextAdRecommendation is applied. + # For details, please read + # https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v0.services#google.ads.googleads.v0.services.ApplyRecommendationOperation + # + # overriding_ad = client.resource(:Ad) + # overriding_ad.id = client.wrapper.int64('INSERT_AD_ID_AS_INTEGER_HERE') + # text_ad_parameters = client.resource(:TextAdParameters) + # text_ad_parameters.ad = overriding_ad + # apply_recommendation_operation.text_ad = text_ad_parameters + + # Issues a mutate request to apply the recommendation. + recommendation_service = client.service(:Recommendation) + response = recommendation_service.apply_recommendation(customer_id, + [apply_recommendation_operation]) + applied_recommendation = response.results.first + + puts sprintf('Applied recommendation with resource name: "%s".', + applied_recommendation.resource_name) +end + +if __FILE__ == $0 + PAGE_SIZE = 1000 + + options = {} + # The following parameter(s) should be provided to run the example. You can + # either specify these by changing the INSERT_XXX_ID_HERE values below, or on + # the command line. + # + # Parameters passed on the command line will override any parameters set in + # code. + # + # Running the example with -h will print the command line usage. + options[:customer_id] = 'INSERT_CUSTOMER_ID_HERE' + # Recommendation ID is the last alphanumeric portion of the value from the + # resource_name field of a Recommendation, which has the format of + # customers//recommendations/. + # Its example can be retrieved from get_text_ad_recommendations.rb. + options[:recommendation_id] = 'INSERT_RECOMMENDATION_ID_HERE' + + OptionParser.new do |opts| + opts.banner = sprintf('Usage: %s [options]', File.basename(__FILE__)) + + opts.separator '' + opts.separator 'Options:' + + opts.on('-C', '--customer-id CUSTOMER-ID', String, 'Customer ID') do |v| + options[:customer_id] = v + end + + opts.on('-r', '--recommendation-id RECOMMENDATION-ID', String, + 'Recommendation ID') do |v| + options[:recommendation_id] = v + end + + opts.separator '' + opts.separator 'Help:' + + opts.on_tail('-h', '--help', 'Show this message') do + puts opts + exit + end + end.parse! + + begin + apply_recommendation(options[:customer_id], options[:recommendation_id]) + rescue Google::Ads::Googleads::Errors::GoogleAdsError => e + e.failure.errors.each do |error| + STDERR.printf("Error with message: %s\n", error.message) + if error.location + error.location.field_path_elements.each do |field_path_element| + STDERR.printf("\tOn field: %s\n", field_path_element.field_name) + end + end + error.error_code.to_h.each do |k, v| + next if v == :UNSPECIFIED + STDERR.printf("\tType: %s\n\tCode: %s\n", k, v) + end + end + rescue Google::Gax::RetryError => e + STDERR.printf("Error: '%s'\n\tCause: '%s'\n\tCode: %d\n\tDetails: '%s'\n" \ + "\tRequest-Id: '%s'\n", e.message, e.cause.message, e.cause.code, + e.cause.details, e.cause.metadata['request-id']) + end +end diff --git a/examples/recommendations/get_text_ad_recommendations.rb b/examples/recommendations/get_text_ad_recommendations.rb new file mode 100755 index 000000000..04c637bf2 --- /dev/null +++ b/examples/recommendations/get_text_ad_recommendations.rb @@ -0,0 +1,116 @@ +#!/usr/bin/env ruby +# Encoding: utf-8 +# +# Copyright 2018 Google LLC +# +# 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 +# +# https://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 TEXT_AD recommendations. + +require 'optparse' +require 'google/ads/googleads' + +def get_text_ad_recommendations(customer_id) + # GoogleadsClient will read a config file from ENV['HOME']/googleads_config.rb + # when called without parameters + client = Google::Ads::Googleads::GoogleadsClient.new + + ga_service = client.service(:GoogleAds) + + query = <<~QUERY + SELECT recommendation.type, recommendation.campaign, + recommendation.text_ad_recommendation + FROM recommendation + WHERE recommendation.type = TEXT_AD + QUERY + + response = ga_service.search(customer_id, query, page_size: PAGE_SIZE) + + response.each do |row| + recommendation = row.recommendation + recommended_ad = recommendation.text_ad_recommendation.ad + + puts sprintf('Recommendation ("%s") was found for campaign "%s".', + recommendation.resource_name, recommendation.campaign) + if recommended_ad.expanded_text_ad + eta = recommended_ad.expanded_text_ad + puts sprintf("\tHeadline 1 = '%s'\n\tHeadline2 = '%s'\n" + + "\tDescription = '%s'", eta.headline_part1, eta.headline_part2, + eta.description) + end + if recommended_ad.display_url + puts sprintf("\tDisplay URL = '%s'", recommended_ad.display_url) + end + recommended_ad.final_urls.each do |url| + puts sprintf("\tFinal Url = '%s'", url) + end + recommended_ad.final_mobile_urls.each do |url| + puts sprintf("\tFinal Mobile Url = '%s'", url) + end + end +end + +if __FILE__ == $0 + PAGE_SIZE = 1000 + + options = {} + # The following parameter(s) should be provided to run the example. You can + # either specify these by changing the INSERT_XXX_ID_HERE values below, or on + # the command line. + # + # Parameters passed on the command line will override any parameters set in + # code. + # + # Running the example with -h will print the command line usage. + options[:customer_id] = 'INSERT_CUSTOMER_ID_HERE' + + OptionParser.new do |opts| + opts.banner = sprintf('Usage: %s [options]', File.basename(__FILE__)) + + opts.separator '' + opts.separator 'Options:' + + opts.on('-C', '--customer-id CUSTOMER-ID', String, 'Customer ID') do |v| + options[:customer_id] = v + end + + opts.separator '' + opts.separator 'Help:' + + opts.on_tail('-h', '--help', 'Show this message') do + puts opts + exit + end + end.parse! + + begin + get_text_ad_recommendations(options[:customer_id]) + rescue Google::Ads::Googleads::Errors::GoogleAdsError => e + e.failure.errors.each do |error| + STDERR.printf("Error with message: %s\n", error.message) + if error.location + error.location.field_path_elements.each do |field_path_element| + STDERR.printf("\tOn field: %s\n", field_path_element.field_name) + end + end + error.error_code.to_h.each do |k, v| + next if v == :UNSPECIFIED + STDERR.printf("\tType: %s\n\tCode: %s\n", k, v) + end + end + rescue Google::Gax::RetryError => e + STDERR.printf("Error: '%s'\n\tCause: '%s'\n\tCode: %d\n\tDetails: '%s'\n" \ + "\tRequest-Id: '%s'\n", e.message, e.cause.message, e.cause.code, + e.cause.details, e.cause.metadata['request-id']) + end +end diff --git a/lib/google/ads/googleads/v0/services/credentials.rb b/lib/google/ads/googleads/credentials.rb similarity index 60% rename from lib/google/ads/googleads/v0/services/credentials.rb rename to lib/google/ads/googleads/credentials.rb index dd445af16..ce6660518 100644 --- a/lib/google/ads/googleads/v0/services/credentials.rb +++ b/lib/google/ads/googleads/credentials.rb @@ -17,16 +17,12 @@ module Google module Ads module Googleads - module V0 - module Services - class Credentials < Google::Auth::Credentials - SCOPE = [ - ].freeze - PATH_ENV_VARS = %w(GOOGLEADS_KEYFILE GOOGLE_CLOUD_KEYFILE GCLOUD_KEYFILE) - JSON_ENV_VARS = %w(GOOGLEADS_KEYFILE_JSON GOOGLE_CLOUD_KEYFILE_JSON GCLOUD_KEYFILE_JSON) - DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"] - end - end + class Credentials < Google::Auth::Credentials + SCOPE = [ + ].freeze + PATH_ENV_VARS = %w(GOOGLEADS_KEYFILE GOOGLE_CLOUD_KEYFILE GCLOUD_KEYFILE) + JSON_ENV_VARS = %w(GOOGLEADS_KEYFILE_JSON GOOGLE_CLOUD_KEYFILE_JSON GCLOUD_KEYFILE_JSON) + DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"] end end end diff --git a/lib/google/ads/googleads/path_lookup_util.rb b/lib/google/ads/googleads/path_lookup_util.rb index ef6dcf1f1..18849ddc5 100644 --- a/lib/google/ads/googleads/path_lookup_util.rb +++ b/lib/google/ads/googleads/path_lookup_util.rb @@ -29,6 +29,14 @@ def ad_group_ad(customer_id, ad_group_id, ad_id) customer_id.to_s, sprintf('%s_%s', ad_group_id.to_s, ad_id.to_s)) end + def ad_group_bid_modifier(customer_id, ad_group_id, criterion_id) + @proto_lookup_util.service(:AdGroupBidModifier). + ad_group_bid_modifier_path( + customer_id.to_s, + sprintf('%s_%s', ad_group_id.to_s, criterion_id.to_s) + ) + end + def ad_group_criterion(customer_id, ad_group_id, criterion_id) @proto_lookup_util.service(:AdGroupCriterion).ad_group_criteria_path( customer_id.to_s, @@ -67,6 +75,11 @@ def customer(customer_id) @proto_lookup_util.service(:Customer).customer_path(customer_id.to_s) end + def geo_target_constant(geo_target_constant_id) + @proto_lookup_util.service(:GeoTargetConstant). + geo_target_constant_path(geo_target_constant_id.to_s) + end + def google_ads_field(google_ads_field) @proto_lookup_util.service(:GoogleAdsField).google_ads_field_path( google_ads_field.to_s) @@ -78,6 +91,11 @@ def keyword_view(customer_id, ad_group_id, criterion_id) sprintf('%s_%s', ad_group_id.to_s, criterion_id.to_s) ) end + + def recommendation(customer_id, recommendation_id) + @proto_lookup_util.service(:Recommendation).recommendation_path( + customer_id.to_s, recommendation_id.to_s) + end end end end diff --git a/lib/google/ads/googleads/proto_lookup_util.rb b/lib/google/ads/googleads/proto_lookup_util.rb index 7481ed57e..7869dbcd1 100644 --- a/lib/google/ads/googleads/proto_lookup_util.rb +++ b/lib/google/ads/googleads/proto_lookup_util.rb @@ -47,6 +47,8 @@ class ProtoLookupUtil PositionEstimates: ['resources', 'ad_group_criterion_pb', 'AdGroupCriterion::PositionEstimates'], AdGroup: ['resources', 'ad_group_pb', 'AdGroup'], + AdGroupBidModifier: ['resources', 'ad_group_bid_modifier_pb', + 'AdGroupBidModifier'], BiddingStrategy: ['resources', 'bidding_strategy_pb', 'BiddingStrategy'], CampaignBudget: ['resources', 'campaign_budget_pb', 'CampaignBudget'], @@ -55,12 +57,33 @@ class ProtoLookupUtil Campaign: ['resources', 'campaign_pb', 'Campaign'], NetworkSettings: ['resources', 'campaign_pb', 'Campaign::NetworkSettings'], + HotelSettingInfo: ['resources', 'campaign_pb', + 'Campaign::HotelSettingInfo'], DynamicSearchAdsSetting: ['resources', 'campaign_pb', 'Campaign::DynamicSearchAdsSetting'], Customer: ['resources', 'customer_pb', 'Customer'], + GeoTargetConstant: ['resources', 'geo_target_constant_pb', + 'GeoTargetConstant'], GoogleAdsField: ['resources', 'google_ads_field_pb', 'GoogleAdsField'], KeywordView: ['resources', 'keyword_view_pb', 'KeywordView'], + Recommendation: ['resources', 'recommendation_pb', 'Recommendation'], + RecommendationImpact: ['resources', 'recommendation_pb', + 'Recommendation::RecommendationImpact'], + RecommendationMetrics: ['resources', 'recommendation_pb', + 'Recommendation::RecommendationMetrics'], + CampaignBudgetRecommendation: ['resources', 'recommendation_pb', + 'Recommendation::CampaignBudgetRecommendation'], + CampaignBudgetRecommendationOption: ['resources', 'recommendation_pb', + 'Recommendation::CampaignBudgetRecommendation::CampaignBudgetRecommendationOption'], + KeywordRecommendation: ['resources', 'recommendation_pb', + 'Recommendation::KeywordRecommendation'], + TextAdRecommendation: ['resources', 'recommendation_pb', + 'Recommendation::TextAdRecommendation'], + TargetCpaOptInRecommendation: ['resources', 'recommendation_pb', + 'Recommendation::TargetCpaOptInRecommendation'], + TargetCpaOptInRecommendationOption: ['resources', 'recommendation_pb', + 'Recommendation::TargetCpaOptInRecommendation::TargetCpaOptInRecommendationOption'], Ad: ['common', 'ad_pb', 'Ad'], TextAdInfo: ['common', 'ad_pb', 'TextAdInfo'], ExpandedTextAdInfo: ['common', 'ad_pb', 'ExpandedTextAdInfo'], @@ -70,6 +93,7 @@ class ProtoLookupUtil CallOnlyAdInfo: ['common', 'ad_pb', 'CallOnlyAdInfo'], ExpandedDynamicSearchAdInfo: ['common', 'ad_pb', 'ExpandedDynamicSearchAdInfo'], + HotelAdInfo: ['common', 'ad_pb', 'HotelAdInfo'], EnhancedCpc: ['common', 'bidding_pb', 'EnhancedCpc'], ManualCpc: ['common', 'bidding_pb', 'ManualCpc'], ManualCpm: ['common', 'bidding_pb', 'ManualCpm'], @@ -82,10 +106,39 @@ class ProtoLookupUtil TargetRoas: ['common', 'bidding_pb', 'TargetRoas'], TargetSpend: ['common', 'bidding_pb', 'TargetSpend'], KeywordInfo: ['common', 'criteria_pb', 'KeywordInfo'], + LocationInfo: ['common', 'criteria_pb', 'LocationInfo'], + PlatformInfo: ['common', 'criteria_pb', 'PlatformInfo'], + ListingGroupInfo: ['common', 'criteria_pb', 'ListingGroupInfo'], + ListingDimensionInfo: ['common', 'criteria_pb', + 'ListingDimensionInfo'], + ListingBrandInfo: ['common', 'criteria_pb', 'ListingBrandInfo'], + HotelIdInfo: ['common', 'criteria_pb', 'HotelIdInfo'], + HotelClassInfo: ['common', 'criteria_pb', 'HotelClassInfo'], + HotelCountryRegionInfo: ['common', 'criteria_pb', + 'HotelCountryRegionInfo'], + HotelStateInfo: ['common', 'criteria_pb', 'HotelStateInfo'], + HotelCityInfo: ['common', 'criteria_pb', 'HotelCityInfo'], + ListingCustomAttributeInfo: ['common', 'criteria_pb', + 'ListingCustomAttributeInfo'], + HotelDateSelectionTypeInfo: ['common', 'criteria_pb', + 'HotelDateSelectionTypeInfo'], + HotelAdvanceBookingWindowInfo: ['common', 'criteria_pb', + 'HotelAdvanceBookingWindowInfo'], + HotelLengthOfStayInfo: ['common', 'criteria_pb', + 'HotelLengthOfStayInfo'], + HotelCheckInDayInfo: ['common', 'criteria_pb', 'HotelCheckInDayInfo'], CustomParameter: ['common', 'custom_parameter_pb', 'CustomParameter'], Metrics: ['common', 'metrics_pb', 'Metrics'], PolicyViolationKey: ['common', 'policy_pb', 'PolicyViolationKey'], - Value: ['common', 'value_pb', 'Value'] + Value: ['common', 'value_pb', 'Value'], + CampaignBudgetParameters: ['services', 'recommendation_service_pb', + 'ApplyRecommendationOperation::CampaignBudgetParameters'], + TextAdParameters: ['services', 'recommendation_service_pb', + 'ApplyRecommendationOperation::TextAdParameters'], + KeywordParameters: ['services', 'recommendation_service_pb', + 'ApplyRecommendationOperation::KeywordParameters'], + TargetCpaOptInParameters: ['services', 'recommendation_service_pb', + 'ApplyRecommendationOperation::TargetCpaOptInParameters'] }.freeze ENUMS = { @@ -102,7 +155,7 @@ class ProtoLookupUtil 'AdvertisingChannelSubType'], AdvertisingChannelType: ['advertising_channel_type_pb', 'AdvertisingChannelType'], - BidSource: ['bid_source_pb', 'BidSource'], + BiddingSource: ['bidding_source_pb', 'BiddingSource'], BiddingStrategyType: ['bidding_strategy_type_pb', 'BiddingStrategyType'], BudgetDeliveryMethod: ['budget_delivery_method_pb', @@ -118,14 +171,23 @@ class ProtoLookupUtil GoogleAdsFieldDataType: ['google_ads_field_data_type_pb', 'GoogleAdsFieldDataType'], KeywordMatchType: ['keyword_match_type_pb', 'KeywordMatchType'], + ListingCustomAttributeIndex: ['listing_custom_attribute_index_pb', + 'ListingCustomAttributeIndex'], + ListingGroupType: ['listing_group_type_pb', 'ListingGroupType'], PageOnePromotedStrategyGoal: ['page_one_promoted_strategy_goal_pb', 'PageOnePromotedStrategyGoal'], QualityScoreBucket: ['quality_score_bucket_pb', 'QualityScoreBucket'], - Slot: ['slot_pb', 'Slot'] + RecommendationType: ['recommendation_type_pb', 'RecommendationType'], + Slot: ['slot_pb', 'Slot'], + TargetCpaOptInRecommendationGoal: [ + 'target_cpa_opt_in_recommendation_goal_pb', + 'TargetCpaOptInRecommendationGoal'] }.freeze SERVICES = { AdGroupAd: ['ad_group_ad_service_client', 'AdGroupAdServiceClient'], + AdGroupBidModifier: ['ad_group_bid_modifier_service_client', + 'AdGroupBidModifierServiceClient'], AdGroupCriterion: ['ad_group_criterion_service_client', 'AdGroupCriterionServiceClient'], AdGroup: ['ad_group_service_client', 'AdGroupServiceClient'], @@ -137,18 +199,26 @@ class ProtoLookupUtil 'CampaignCriterionServiceClient'], Campaign: ['campaign_service_client', 'CampaignServiceClient'], Customer: ['customer_service_client', 'CustomerServiceClient'], + GeoTargetConstant: ['geo_target_constant_service_client', + 'GeoTargetConstantServiceClient'], GoogleAdsField: ['google_ads_field_service_client', 'GoogleAdsFieldServiceClient'], GoogleAds: ['google_ads_service_client', 'GoogleAdsServiceClient'], KeywordView: ['keyword_view_service_client', - 'KeywordViewServiceClient'] - } + 'KeywordViewServiceClient'], + Recommendation: ['recommendation_service_client', + 'RecommendationServiceClient'] + }.freeze OPERATIONS = { AdGroupAd: ['ad_group_ad_service_pb', 'AdGroupAdOperation'], + AdGroupBidModifier: ['ad_group_bid_modifier_service_pb', + 'AdGroupBidModifierOperation'], AdGroupCriterion: ['ad_group_criterion_service_pb', 'AdGroupCriterionOperation'], AdGroup: ['ad_group_service_pb', 'AdGroupOperation'], + ApplyRecommendation: ['recommendation_service_pb', + 'ApplyRecommendationOperation'], BiddingStrategy: ['bidding_strategy_service_pb', 'BiddingStrategyOperation'], CampaignBudget: ['campaign_budget_service_pb', @@ -156,7 +226,7 @@ class ProtoLookupUtil CampaignCriterion: ['campaign_criterion_service_pb', 'CampaignCriterionOperation'], Campaign: ['campaign_service_pb', 'CampaignOperation'], - } + }.freeze def initialize(version) @version = version @@ -176,8 +246,9 @@ def resource(name) resource_info[1]) require require_path - class_path = resource_info.first == 'resources' ? - RESOURCE_CLASS_PATH : COMMON_CLASS_PATH + class_path = RESOURCE_CLASS_PATH + class_path = COMMON_CLASS_PATH if resource_info.first == 'common' + class_path = SERVICE_CLASS_PATH if resource_info.first == 'services' class_path = sprintf(class_path, @version, resource_info[2]) return class_for_path(class_path) end diff --git a/lib/google/ads/googleads/v0/common/ad_pb.rb b/lib/google/ads/googleads/v0/common/ad_pb.rb index f93123f94..4a4dd0c7c 100644 --- a/lib/google/ads/googleads/v0/common/ad_pb.rb +++ b/lib/google/ads/googleads/v0/common/ad_pb.rb @@ -22,6 +22,7 @@ optional :responsive_display_ad, :message, 9, "google.ads.googleads.v0.common.ResponsiveDisplayAdInfo" optional :call_only_ad, :message, 13, "google.ads.googleads.v0.common.CallOnlyAdInfo" optional :expanded_dynamic_search_ad, :message, 14, "google.ads.googleads.v0.common.ExpandedDynamicSearchAdInfo" + optional :hotel_ad, :message, 15, "google.ads.googleads.v0.common.HotelAdInfo" end end add_message "google.ads.googleads.v0.common.TextAdInfo" do @@ -59,6 +60,8 @@ add_message "google.ads.googleads.v0.common.ExpandedDynamicSearchAdInfo" do optional :description, :message, 1, "google.protobuf.StringValue" end + add_message "google.ads.googleads.v0.common.HotelAdInfo" do + end end module Google @@ -73,6 +76,7 @@ module Common ResponsiveDisplayAdInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.ResponsiveDisplayAdInfo").msgclass CallOnlyAdInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.CallOnlyAdInfo").msgclass ExpandedDynamicSearchAdInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.ExpandedDynamicSearchAdInfo").msgclass + HotelAdInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelAdInfo").msgclass end end end diff --git a/lib/google/ads/googleads/v0/common/criteria_pb.rb b/lib/google/ads/googleads/v0/common/criteria_pb.rb index 3510ba947..14dfd0029 100644 --- a/lib/google/ads/googleads/v0/common/criteria_pb.rb +++ b/lib/google/ads/googleads/v0/common/criteria_pb.rb @@ -4,12 +4,68 @@ require 'google/protobuf' require 'google/ads/googleads/v0/enums/keyword_match_type_pb' +require 'google/ads/googleads/v0/enums/listing_custom_attribute_index_pb' +require 'google/ads/googleads/v0/enums/listing_group_type_pb' require 'google/protobuf/wrappers_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message "google.ads.googleads.v0.common.KeywordInfo" do optional :text, :message, 1, "google.protobuf.StringValue" optional :match_type, :enum, 2, "google.ads.googleads.v0.enums.KeywordMatchTypeEnum.KeywordMatchType" end + add_message "google.ads.googleads.v0.common.LocationInfo" do + end + add_message "google.ads.googleads.v0.common.PlatformInfo" do + end + add_message "google.ads.googleads.v0.common.ListingGroupInfo" do + optional :type, :enum, 1, "google.ads.googleads.v0.enums.ListingGroupTypeEnum.ListingGroupType" + optional :case_value, :message, 2, "google.ads.googleads.v0.common.ListingDimensionInfo" + optional :parent_criterion_id, :message, 3, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.common.ListingDimensionInfo" do + oneof :dimension do + optional :listing_brand, :message, 1, "google.ads.googleads.v0.common.ListingBrandInfo" + optional :hotel_id, :message, 2, "google.ads.googleads.v0.common.HotelIdInfo" + optional :hotel_class, :message, 3, "google.ads.googleads.v0.common.HotelClassInfo" + optional :hotel_country_region, :message, 4, "google.ads.googleads.v0.common.HotelCountryRegionInfo" + optional :hotel_state, :message, 5, "google.ads.googleads.v0.common.HotelStateInfo" + optional :hotel_city, :message, 6, "google.ads.googleads.v0.common.HotelCityInfo" + optional :listing_custom_attribute, :message, 7, "google.ads.googleads.v0.common.ListingCustomAttributeInfo" + end + end + add_message "google.ads.googleads.v0.common.ListingBrandInfo" do + optional :value, :message, 1, "google.protobuf.StringValue" + end + add_message "google.ads.googleads.v0.common.HotelIdInfo" do + optional :value, :message, 1, "google.protobuf.StringValue" + end + add_message "google.ads.googleads.v0.common.HotelClassInfo" do + optional :value, :message, 1, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.common.HotelCountryRegionInfo" do + optional :country_region_criterion, :message, 1, "google.protobuf.StringValue" + end + add_message "google.ads.googleads.v0.common.HotelStateInfo" do + optional :state_criterion, :message, 1, "google.protobuf.StringValue" + end + add_message "google.ads.googleads.v0.common.HotelCityInfo" do + optional :city_criterion, :message, 1, "google.protobuf.StringValue" + end + add_message "google.ads.googleads.v0.common.ListingCustomAttributeInfo" do + optional :value, :message, 1, "google.protobuf.StringValue" + optional :index, :enum, 2, "google.ads.googleads.v0.enums.ListingCustomAttributeIndexEnum.ListingCustomAttributeIndex" + end + add_message "google.ads.googleads.v0.common.HotelDateSelectionTypeInfo" do + end + add_message "google.ads.googleads.v0.common.HotelAdvanceBookingWindowInfo" do + optional :min_days, :message, 1, "google.protobuf.Int64Value" + optional :max_days, :message, 2, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.common.HotelLengthOfStayInfo" do + optional :min_nights, :message, 1, "google.protobuf.Int64Value" + optional :max_nights, :message, 2, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.common.HotelCheckInDayInfo" do + end end module Google @@ -18,6 +74,21 @@ module Googleads module V0 module Common KeywordInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.KeywordInfo").msgclass + LocationInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.LocationInfo").msgclass + PlatformInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.PlatformInfo").msgclass + ListingGroupInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.ListingGroupInfo").msgclass + ListingDimensionInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.ListingDimensionInfo").msgclass + ListingBrandInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.ListingBrandInfo").msgclass + HotelIdInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelIdInfo").msgclass + HotelClassInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelClassInfo").msgclass + HotelCountryRegionInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelCountryRegionInfo").msgclass + HotelStateInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelStateInfo").msgclass + HotelCityInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelCityInfo").msgclass + ListingCustomAttributeInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.ListingCustomAttributeInfo").msgclass + HotelDateSelectionTypeInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelDateSelectionTypeInfo").msgclass + HotelAdvanceBookingWindowInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelAdvanceBookingWindowInfo").msgclass + HotelLengthOfStayInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelLengthOfStayInfo").msgclass + HotelCheckInDayInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.common.HotelCheckInDayInfo").msgclass end end end diff --git a/lib/google/ads/googleads/v0/enums/ad_group_type_pb.rb b/lib/google/ads/googleads/v0/enums/ad_group_type_pb.rb index 5ae543f03..6dc86e813 100644 --- a/lib/google/ads/googleads/v0/enums/ad_group_type_pb.rb +++ b/lib/google/ads/googleads/v0/enums/ad_group_type_pb.rb @@ -10,6 +10,7 @@ value :UNSPECIFIED, 0 value :UNKNOWN, 1 value :SEARCH_STANDARD, 2 + value :HOTEL_ADS, 6 end end diff --git a/lib/google/ads/googleads/v0/enums/ad_type_pb.rb b/lib/google/ads/googleads/v0/enums/ad_type_pb.rb index 891c06a7c..464f74269 100644 --- a/lib/google/ads/googleads/v0/enums/ad_type_pb.rb +++ b/lib/google/ads/googleads/v0/enums/ad_type_pb.rb @@ -15,6 +15,7 @@ value :RESPONSIVE_DISPLAY_AD, 5 value :CALL_ONLY_AD, 6 value :EXPANDED_DYNAMIC_SEARCH_AD, 7 + value :HOTEL_AD, 8 end end diff --git a/lib/google/ads/googleads/v0/enums/advertising_channel_type_pb.rb b/lib/google/ads/googleads/v0/enums/advertising_channel_type_pb.rb index cd5ce1df1..695197fc6 100644 --- a/lib/google/ads/googleads/v0/enums/advertising_channel_type_pb.rb +++ b/lib/google/ads/googleads/v0/enums/advertising_channel_type_pb.rb @@ -10,6 +10,7 @@ value :UNSPECIFIED, 0 value :UNKNOWN, 1 value :SEARCH, 2 + value :HOTEL, 5 end end diff --git a/lib/google/ads/googleads/v0/enums/bid_source_pb.rb b/lib/google/ads/googleads/v0/enums/bid_source_pb.rb deleted file mode 100644 index d87dd1d3a..000000000 --- a/lib/google/ads/googleads/v0/enums/bid_source_pb.rb +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/ads/googleads/v0/enums/bid_source.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "google.ads.googleads.v0.enums.BidSourceEnum" do - end - add_enum "google.ads.googleads.v0.enums.BidSourceEnum.BidSource" do - value :UNSPECIFIED, 0 - value :UNKNOWN, 1 - value :ADGROUP, 2 - value :CRITERION, 3 - value :CAMPAIGN_BIDDING_STRATEGY, 5 - end -end - -module Google - module Ads - module Googleads - module V0 - module Enums - BidSourceEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.BidSourceEnum").msgclass - BidSourceEnum::BidSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.BidSourceEnum.BidSource").enummodule - end - end - end - end -end diff --git a/lib/google/ads/googleads/v0/enums/bidding_source_pb.rb b/lib/google/ads/googleads/v0/enums/bidding_source_pb.rb new file mode 100644 index 000000000..104add36f --- /dev/null +++ b/lib/google/ads/googleads/v0/enums/bidding_source_pb.rb @@ -0,0 +1,29 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/enums/bidding_source.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.enums.BiddingSourceEnum" do + end + add_enum "google.ads.googleads.v0.enums.BiddingSourceEnum.BiddingSource" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :ADGROUP, 2 + value :CRITERION, 3 + value :CAMPAIGN_BIDDING_STRATEGY, 5 + end +end + +module Google + module Ads + module Googleads + module V0 + module Enums + BiddingSourceEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.BiddingSourceEnum").msgclass + BiddingSourceEnum::BiddingSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.BiddingSourceEnum.BiddingSource").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/enums/criterion_type_pb.rb b/lib/google/ads/googleads/v0/enums/criterion_type_pb.rb index ca75fc94a..6d3fdd0ff 100644 --- a/lib/google/ads/googleads/v0/enums/criterion_type_pb.rb +++ b/lib/google/ads/googleads/v0/enums/criterion_type_pb.rb @@ -10,6 +10,9 @@ value :UNSPECIFIED, 0 value :UNKNOWN, 1 value :KEYWORD, 2 + value :PLATFORM, 6 + value :LOCATION, 7 + value :LISTING_GROUP, 8 end end diff --git a/lib/google/ads/googleads/v0/enums/listing_custom_attribute_index_pb.rb b/lib/google/ads/googleads/v0/enums/listing_custom_attribute_index_pb.rb new file mode 100644 index 000000000..d79f59144 --- /dev/null +++ b/lib/google/ads/googleads/v0/enums/listing_custom_attribute_index_pb.rb @@ -0,0 +1,31 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/enums/listing_custom_attribute_index.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.enums.ListingCustomAttributeIndexEnum" do + end + add_enum "google.ads.googleads.v0.enums.ListingCustomAttributeIndexEnum.ListingCustomAttributeIndex" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :CUSTOM_ATTRIBUTE_0, 2 + value :CUSTOM_ATTRIBUTE_1, 3 + value :CUSTOM_ATTRIBUTE_2, 4 + value :CUSTOM_ATTRIBUTE_3, 5 + value :CUSTOM_ATTRIBUTE_4, 6 + end +end + +module Google + module Ads + module Googleads + module V0 + module Enums + ListingCustomAttributeIndexEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.ListingCustomAttributeIndexEnum").msgclass + ListingCustomAttributeIndexEnum::ListingCustomAttributeIndex = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.ListingCustomAttributeIndexEnum.ListingCustomAttributeIndex").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/enums/listing_group_type_pb.rb b/lib/google/ads/googleads/v0/enums/listing_group_type_pb.rb new file mode 100644 index 000000000..ff58e9eb6 --- /dev/null +++ b/lib/google/ads/googleads/v0/enums/listing_group_type_pb.rb @@ -0,0 +1,28 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/enums/listing_group_type.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.enums.ListingGroupTypeEnum" do + end + add_enum "google.ads.googleads.v0.enums.ListingGroupTypeEnum.ListingGroupType" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :SUBDIVISION, 2 + value :UNIT, 3 + end +end + +module Google + module Ads + module Googleads + module V0 + module Enums + ListingGroupTypeEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.ListingGroupTypeEnum").msgclass + ListingGroupTypeEnum::ListingGroupType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.ListingGroupTypeEnum.ListingGroupType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/enums/recommendation_type_pb.rb b/lib/google/ads/googleads/v0/enums/recommendation_type_pb.rb new file mode 100644 index 000000000..9f152cc48 --- /dev/null +++ b/lib/google/ads/googleads/v0/enums/recommendation_type_pb.rb @@ -0,0 +1,30 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/enums/recommendation_type.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.enums.RecommendationTypeEnum" do + end + add_enum "google.ads.googleads.v0.enums.RecommendationTypeEnum.RecommendationType" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :CAMPAIGN_BUDGET, 2 + value :KEYWORD, 3 + value :TEXT_AD, 4 + value :TARGET_CPA_OPT_IN, 5 + end +end + +module Google + module Ads + module Googleads + module V0 + module Enums + RecommendationTypeEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.RecommendationTypeEnum").msgclass + RecommendationTypeEnum::RecommendationType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.RecommendationTypeEnum.RecommendationType").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/enums/target_cpa_opt_in_recommendation_goal_pb.rb b/lib/google/ads/googleads/v0/enums/target_cpa_opt_in_recommendation_goal_pb.rb new file mode 100644 index 000000000..6026985ea --- /dev/null +++ b/lib/google/ads/googleads/v0/enums/target_cpa_opt_in_recommendation_goal_pb.rb @@ -0,0 +1,30 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/enums/target_cpa_opt_in_recommendation_goal.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.enums.TargetCpaOptInRecommendationGoalEnum" do + end + add_enum "google.ads.googleads.v0.enums.TargetCpaOptInRecommendationGoalEnum.TargetCpaOptInRecommendationGoal" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :SAME_COST, 2 + value :SAME_CONVERSIONS, 3 + value :SAME_CPA, 4 + value :CLOSEST_CPA, 5 + end +end + +module Google + module Ads + module Googleads + module V0 + module Enums + TargetCpaOptInRecommendationGoalEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.TargetCpaOptInRecommendationGoalEnum").msgclass + TargetCpaOptInRecommendationGoalEnum::TargetCpaOptInRecommendationGoal = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.enums.TargetCpaOptInRecommendationGoalEnum.TargetCpaOptInRecommendationGoal").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/errors/ad_error_pb.rb b/lib/google/ads/googleads/v0/errors/ad_error_pb.rb index c4a195756..df97f429d 100644 --- a/lib/google/ads/googleads/v0/errors/ad_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/ad_error_pb.rb @@ -137,6 +137,7 @@ value :CANNOT_DISABLE_CALL_CONVERSION_AND_SET_CONVERSION_TYPE_ID, 127 value :CANNOT_SET_PATH2_WITHOUT_PATH1, 128 value :MISSING_DYNAMIC_SEARCH_ADS_SETTING_DOMAIN_NAME, 129 + value :INCOMPATIBLE_WITH_RESTRICTION_TYPE, 130 end end diff --git a/lib/google/ads/googleads/v0/errors/ad_group_bid_modifier_error_pb.rb b/lib/google/ads/googleads/v0/errors/ad_group_bid_modifier_error_pb.rb new file mode 100644 index 000000000..8f0895f25 --- /dev/null +++ b/lib/google/ads/googleads/v0/errors/ad_group_bid_modifier_error_pb.rb @@ -0,0 +1,28 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/errors/ad_group_bid_modifier_error.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.errors.AdGroupBidModifierErrorEnum" do + end + add_enum "google.ads.googleads.v0.errors.AdGroupBidModifierErrorEnum.AdGroupBidModifierError" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :CRITERION_ID_NOT_SUPPORTED, 2 + value :CANNOT_OVERRIDE_OPTED_OUT_CAMPAIGN_CRITERION_BID_MODIFIER, 3 + end +end + +module Google + module Ads + module Googleads + module V0 + module Errors + AdGroupBidModifierErrorEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.errors.AdGroupBidModifierErrorEnum").msgclass + AdGroupBidModifierErrorEnum::AdGroupBidModifierError = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.errors.AdGroupBidModifierErrorEnum.AdGroupBidModifierError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/errors/ad_group_criterion_error_pb.rb b/lib/google/ads/googleads/v0/errors/ad_group_criterion_error_pb.rb index e360db38a..13c2d5f6f 100644 --- a/lib/google/ads/googleads/v0/errors/ad_group_criterion_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/ad_group_criterion_error_pb.rb @@ -25,15 +25,6 @@ value :INVALID_USER_STATUS, 15 value :CANNOT_ADD_CRITERIA_TYPE, 16 value :CANNOT_EXCLUDE_CRITERIA_TYPE, 17 - value :INVALID_PRODUCT_PARTITION_HIERARCHY, 18 - value :PRODUCT_PARTITION_UNIT_CANNOT_HAVE_CHILDREN, 19 - value :PRODUCT_PARTITION_SUBDIVISION_REQUIRES_OTHERS_CASE, 20 - value :PRODUCT_PARTITION_REQUIRES_SAME_DIMENSION_TYPE_AS_SIBLINGS, 21 - value :PRODUCT_PARTITION_ALREADY_EXISTS, 22 - value :PRODUCT_PARTITION_DOES_NOT_EXIST, 23 - value :PRODUCT_PARTITION_CANNOT_BE_REMOVED, 24 - value :INVALID_PRODUCT_PARTITION_TYPE, 25 - value :PRODUCT_PARTITION_ADD_MAY_ONLY_USE_TEMP_ID, 26 value :CAMPAIGN_TYPE_NOT_COMPATIBLE_WITH_PARTIAL_FAILURE, 27 value :OPERATIONS_FOR_TOO_MANY_SHOPPING_ADGROUPS, 28 value :CANNOT_MODIFY_URL_FIELDS_WITH_DUPLICATE_ELEMENTS, 29 @@ -46,6 +37,15 @@ value :CANNOT_SET_BOTH_DESTINATION_URL_AND_TRACKING_URL_TEMPLATE, 36 value :FINAL_URLS_NOT_SUPPORTED_FOR_CRITERION_TYPE, 37 value :FINAL_MOBILE_URLS_NOT_SUPPORTED_FOR_CRITERION_TYPE, 38 + value :INVALID_LISTING_GROUP_HIERARCHY, 39 + value :LISTING_GROUP_UNIT_CANNOT_HAVE_CHILDREN, 40 + value :LISTING_GROUP_SUBDIVISION_REQUIRES_OTHERS_CASE, 41 + value :LISTING_GROUP_REQUIRES_SAME_DIMENSION_TYPE_AS_SIBLINGS, 42 + value :LISTING_GROUP_ALREADY_EXISTS, 43 + value :LISTING_GROUP_DOES_NOT_EXIST, 44 + value :LISTING_GROUP_CANNOT_BE_REMOVED, 45 + value :INVALID_LISTING_GROUP_TYPE, 46 + value :LISTING_GROUP_ADD_MAY_ONLY_USE_TEMP_ID, 47 end end diff --git a/lib/google/ads/googleads/v0/errors/authentication_error_pb.rb b/lib/google/ads/googleads/v0/errors/authentication_error_pb.rb index 590d8b566..d95cd9778 100644 --- a/lib/google/ads/googleads/v0/errors/authentication_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/authentication_error_pb.rb @@ -10,11 +10,7 @@ value :UNSPECIFIED, 0 value :UNKNOWN, 1 value :AUTHENTICATION_ERROR, 2 - value :CLIENT_CUSTOMER_ID_IS_REQUIRED, 3 - value :CLIENT_EMAIL_REQUIRED, 4 value :CLIENT_CUSTOMER_ID_INVALID, 5 - value :CLIENT_EMAIL_INVALID, 6 - value :CLIENT_EMAIL_FAILED_TO_AUTHENTICATE, 7 value :CUSTOMER_NOT_FOUND, 8 value :GOOGLE_ACCOUNT_DELETED, 9 value :GOOGLE_ACCOUNT_COOKIE_INVALID, 10 diff --git a/lib/google/ads/googleads/v0/errors/authorization_error_pb.rb b/lib/google/ads/googleads/v0/errors/authorization_error_pb.rb index 8f5ad1a69..1253f07d8 100644 --- a/lib/google/ads/googleads/v0/errors/authorization_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/authorization_error_pb.rb @@ -13,6 +13,7 @@ value :DEVELOPER_TOKEN_NOT_WHITELISTED, 3 value :DEVELOPER_TOKEN_PROHIBITED, 4 value :PROJECT_DISABLED, 5 + value :AUTHORIZATION_ERROR, 6 end end diff --git a/lib/google/ads/googleads/v0/errors/campaign_error_pb.rb b/lib/google/ads/googleads/v0/errors/campaign_error_pb.rb index b790838fc..38e501e09 100644 --- a/lib/google/ads/googleads/v0/errors/campaign_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/campaign_error_pb.rb @@ -43,6 +43,9 @@ value :CANNOT_SET_AD_ROTATION_MODE, 34 value :CANNOT_MODIFY_START_DATE_IF_ALREADY_STARTED, 35 value :CANNOT_SET_DATE_TO_PAST, 36 + value :MISSING_HOTEL_CUSTOMER_LINK, 37 + value :INVALID_HOTEL_CUSTOMER_LINK, 38 + value :MISSING_HOTEL_SETTING, 39 end end diff --git a/lib/google/ads/googleads/v0/errors/context_error_pb.rb b/lib/google/ads/googleads/v0/errors/context_error_pb.rb new file mode 100644 index 000000000..0e83cb9a4 --- /dev/null +++ b/lib/google/ads/googleads/v0/errors/context_error_pb.rb @@ -0,0 +1,27 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/errors/context_error.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.errors.ContextErrorEnum" do + end + add_enum "google.ads.googleads.v0.errors.ContextErrorEnum.ContextError" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :OPERATION_NOT_PERMITTED_FOR_CONTEXT, 2 + end +end + +module Google + module Ads + module Googleads + module V0 + module Errors + ContextErrorEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.errors.ContextErrorEnum").msgclass + ContextErrorEnum::ContextError = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.errors.ContextErrorEnum.ContextError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/errors/criterion_error_pb.rb b/lib/google/ads/googleads/v0/errors/criterion_error_pb.rb index 6817114cf..95c9b4c4e 100644 --- a/lib/google/ads/googleads/v0/errors/criterion_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/criterion_error_pb.rb @@ -89,6 +89,8 @@ value :LOCATION_FILTER_NOT_ALLOWED, 79 value :LOCATION_FILTER_INVALID, 80 value :CANNOT_ATTACH_CRITERIA_AT_CAMPAIGN_AND_ADGROUP, 81 + value :HOTEL_LENGTH_OF_STAY_OVERLAPS_WITH_EXISTING_CRITERION, 82 + value :HOTEL_ADVANCE_BOOKING_WINDOW_OVERLAPS_WITH_EXISTING_CRITERION, 83 end end diff --git a/lib/google/ads/googleads/v0/errors/errors_pb.rb b/lib/google/ads/googleads/v0/errors/errors_pb.rb index eb93de7cf..48e6d9862 100644 --- a/lib/google/ads/googleads/v0/errors/errors_pb.rb +++ b/lib/google/ads/googleads/v0/errors/errors_pb.rb @@ -8,6 +8,7 @@ require 'google/ads/googleads/v0/errors/ad_customizer_error_pb' require 'google/ads/googleads/v0/errors/ad_error_pb' require 'google/ads/googleads/v0/errors/ad_group_ad_error_pb' +require 'google/ads/googleads/v0/errors/ad_group_bid_modifier_error_pb' require 'google/ads/googleads/v0/errors/ad_group_criterion_error_pb' require 'google/ads/googleads/v0/errors/ad_group_error_pb' require 'google/ads/googleads/v0/errors/ad_sharing_error_pb' @@ -20,11 +21,13 @@ require 'google/ads/googleads/v0/errors/campaign_criterion_error_pb' require 'google/ads/googleads/v0/errors/campaign_error_pb' require 'google/ads/googleads/v0/errors/collection_size_error_pb' +require 'google/ads/googleads/v0/errors/context_error_pb' require 'google/ads/googleads/v0/errors/criterion_error_pb' require 'google/ads/googleads/v0/errors/date_error_pb' require 'google/ads/googleads/v0/errors/date_range_error_pb' require 'google/ads/googleads/v0/errors/distinct_error_pb' require 'google/ads/googleads/v0/errors/feed_attribute_reference_error_pb' +require 'google/ads/googleads/v0/errors/field_error_pb' require 'google/ads/googleads/v0/errors/field_mask_error_pb' require 'google/ads/googleads/v0/errors/function_error_pb' require 'google/ads/googleads/v0/errors/function_parsing_error_pb' @@ -44,6 +47,7 @@ require 'google/ads/googleads/v0/errors/query_error_pb' require 'google/ads/googleads/v0/errors/quota_error_pb' require 'google/ads/googleads/v0/errors/range_error_pb' +require 'google/ads/googleads/v0/errors/recommendation_error_pb' require 'google/ads/googleads/v0/errors/region_code_error_pb' require 'google/ads/googleads/v0/errors/request_error_pb' require 'google/ads/googleads/v0/errors/resource_access_denied_error_pb' @@ -106,6 +110,7 @@ optional :null_error, :enum, 47, "google.ads.googleads.v0.errors.NullErrorEnum.NullError" optional :operator_error, :enum, 48, "google.ads.googleads.v0.errors.OperatorErrorEnum.OperatorError" optional :range_error, :enum, 49, "google.ads.googleads.v0.errors.RangeErrorEnum.RangeError" + optional :recommendation_error, :enum, 58, "google.ads.googleads.v0.errors.RecommendationErrorEnum.RecommendationError" optional :region_code_error, :enum, 51, "google.ads.googleads.v0.errors.RegionCodeErrorEnum.RegionCodeError" optional :setting_error, :enum, 52, "google.ads.googleads.v0.errors.SettingErrorEnum.SettingError" optional :string_format_error, :enum, 53, "google.ads.googleads.v0.errors.StringFormatErrorEnum.StringFormatError" @@ -113,6 +118,9 @@ optional :operation_access_denied_error, :enum, 55, "google.ads.googleads.v0.errors.OperationAccessDeniedErrorEnum.OperationAccessDeniedError" optional :resource_access_denied_error, :enum, 56, "google.ads.googleads.v0.errors.ResourceAccessDeniedErrorEnum.ResourceAccessDeniedError" optional :resource_count_limit_exceeded_error, :enum, 57, "google.ads.googleads.v0.errors.ResourceCountLimitExceededErrorEnum.ResourceCountLimitExceededError" + optional :ad_group_bid_modifier_error, :enum, 59, "google.ads.googleads.v0.errors.AdGroupBidModifierErrorEnum.AdGroupBidModifierError" + optional :context_error, :enum, 60, "google.ads.googleads.v0.errors.ContextErrorEnum.ContextError" + optional :field_error, :enum, 61, "google.ads.googleads.v0.errors.FieldErrorEnum.FieldError" end end add_message "google.ads.googleads.v0.errors.ErrorLocation" do diff --git a/lib/google/ads/googleads/v0/errors/field_error_pb.rb b/lib/google/ads/googleads/v0/errors/field_error_pb.rb new file mode 100644 index 000000000..2e2a8c7fe --- /dev/null +++ b/lib/google/ads/googleads/v0/errors/field_error_pb.rb @@ -0,0 +1,31 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/errors/field_error.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.errors.FieldErrorEnum" do + end + add_enum "google.ads.googleads.v0.errors.FieldErrorEnum.FieldError" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :REQUIRED, 2 + value :IMMUTABLE_FIELD, 3 + value :INVALID_VALUE, 4 + value :VALUE_MUST_BE_UNSET, 5 + value :REQUIRED_NONEMPTY_LIST, 6 + end +end + +module Google + module Ads + module Googleads + module V0 + module Errors + FieldErrorEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.errors.FieldErrorEnum").msgclass + FieldErrorEnum::FieldError = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.errors.FieldErrorEnum.FieldError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/errors/internal_error_pb.rb b/lib/google/ads/googleads/v0/errors/internal_error_pb.rb index 9833b69b2..0b5da9011 100644 --- a/lib/google/ads/googleads/v0/errors/internal_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/internal_error_pb.rb @@ -11,6 +11,7 @@ value :UNKNOWN, 1 value :INTERNAL_ERROR, 2 value :ERROR_CODE_NOT_PUBLISHED, 3 + value :TRANSIENT_ERROR, 4 end end diff --git a/lib/google/ads/googleads/v0/errors/mutate_error_pb.rb b/lib/google/ads/googleads/v0/errors/mutate_error_pb.rb index 68d0cfb1c..d1f3a53f1 100644 --- a/lib/google/ads/googleads/v0/errors/mutate_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/mutate_error_pb.rb @@ -10,9 +10,6 @@ value :UNSPECIFIED, 0 value :UNKNOWN, 1 value :RESOURCE_NOT_FOUND, 3 - value :REQUIRED_FIELD_MISSING, 4 - value :FIELD_NOT_CLEARABLE, 5 - value :INVALID_FIELD_VALUE, 6 value :ID_EXISTS_IN_MULTIPLE_MUTATES, 7 end end diff --git a/lib/google/ads/googleads/v0/errors/query_error_pb.rb b/lib/google/ads/googleads/v0/errors/query_error_pb.rb index 1382dc9c6..7343c8b63 100644 --- a/lib/google/ads/googleads/v0/errors/query_error_pb.rb +++ b/lib/google/ads/googleads/v0/errors/query_error_pb.rb @@ -31,8 +31,10 @@ value :EXPECTED_SINGLE_VALUE, 42 value :EXPECTED_VALUE_WITH_BETWEEN_OPERATOR, 29 value :INVALID_DATE_FORMAT, 38 + value :INVALID_STRING_VALUE, 57 value :INVALID_VALUE_WITH_BETWEEN_OPERATOR, 26 value :INVALID_VALUE_WITH_DURING_OPERATOR, 22 + value :INVALID_VALUE_WITH_LIKE_OPERATOR, 56 value :OPERATOR_FIELD_MISMATCH, 35 value :PROHIBITED_EMPTY_LIST_IN_CONDITION, 28 value :PROHIBITED_ENUM_CONSTANT, 54 diff --git a/lib/google/ads/googleads/v0/errors/recommendation_error_pb.rb b/lib/google/ads/googleads/v0/errors/recommendation_error_pb.rb new file mode 100644 index 000000000..5e07c271a --- /dev/null +++ b/lib/google/ads/googleads/v0/errors/recommendation_error_pb.rb @@ -0,0 +1,32 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/errors/recommendation_error.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.errors.RecommendationErrorEnum" do + end + add_enum "google.ads.googleads.v0.errors.RecommendationErrorEnum.RecommendationError" do + value :UNSPECIFIED, 0 + value :UNKNOWN, 1 + value :BUDGET_AMOUNT_TOO_SMALL, 2 + value :BUDGET_AMOUNT_TOO_LARGE, 3 + value :INVALID_BUDGET_AMOUNT, 4 + value :POLICY_ERROR, 5 + value :INVALID_BID_AMOUNT, 6 + value :ADGROUP_KEYWORD_LIMIT, 7 + end +end + +module Google + module Ads + module Googleads + module V0 + module Errors + RecommendationErrorEnum = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.errors.RecommendationErrorEnum").msgclass + RecommendationErrorEnum::RecommendationError = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.errors.RecommendationErrorEnum.RecommendationError").enummodule + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/resources/ad_group_bid_modifier_pb.rb b/lib/google/ads/googleads/v0/resources/ad_group_bid_modifier_pb.rb new file mode 100644 index 000000000..49c28b593 --- /dev/null +++ b/lib/google/ads/googleads/v0/resources/ad_group_bid_modifier_pb.rb @@ -0,0 +1,33 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/resources/ad_group_bid_modifier.proto + +require 'google/protobuf' + +require 'google/ads/googleads/v0/common/criteria_pb' +require 'google/protobuf/wrappers_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.resources.AdGroupBidModifier" do + optional :resource_name, :string, 1 + optional :ad_group, :message, 2, "google.protobuf.StringValue" + optional :criterion_id, :message, 3, "google.protobuf.Int64Value" + optional :bid_modifier, :message, 4, "google.protobuf.DoubleValue" + oneof :criterion do + optional :hotel_date_selection_type, :message, 5, "google.ads.googleads.v0.common.HotelDateSelectionTypeInfo" + optional :hotel_advance_booking_window, :message, 6, "google.ads.googleads.v0.common.HotelAdvanceBookingWindowInfo" + optional :hotel_length_of_stay, :message, 7, "google.ads.googleads.v0.common.HotelLengthOfStayInfo" + optional :hotel_check_in_day, :message, 8, "google.ads.googleads.v0.common.HotelCheckInDayInfo" + end + end +end + +module Google + module Ads + module Googleads + module V0 + module Resources + AdGroupBidModifier = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.AdGroupBidModifier").msgclass + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/resources/ad_group_criterion_pb.rb b/lib/google/ads/googleads/v0/resources/ad_group_criterion_pb.rb index 0d5c66716..7c2a488b5 100644 --- a/lib/google/ads/googleads/v0/resources/ad_group_criterion_pb.rb +++ b/lib/google/ads/googleads/v0/resources/ad_group_criterion_pb.rb @@ -6,7 +6,7 @@ require 'google/ads/googleads/v0/common/criteria_pb' require 'google/ads/googleads/v0/common/custom_parameter_pb' require 'google/ads/googleads/v0/enums/ad_group_criterion_status_pb' -require 'google/ads/googleads/v0/enums/bid_source_pb' +require 'google/ads/googleads/v0/enums/bidding_source_pb' require 'google/ads/googleads/v0/enums/criterion_type_pb' require 'google/ads/googleads/v0/enums/quality_score_bucket_pb' require 'google/protobuf/wrappers_pb' @@ -25,15 +25,16 @@ optional :effective_cpc_bid_micros, :message, 18, "google.protobuf.Int64Value" optional :effective_cpm_bid_micros, :message, 19, "google.protobuf.Int64Value" optional :effective_cpv_bid_micros, :message, 20, "google.protobuf.Int64Value" - optional :effective_cpc_bid_source, :enum, 21, "google.ads.googleads.v0.enums.BidSourceEnum.BidSource" - optional :effective_cpm_bid_source, :enum, 22, "google.ads.googleads.v0.enums.BidSourceEnum.BidSource" - optional :effective_cpv_bid_source, :enum, 23, "google.ads.googleads.v0.enums.BidSourceEnum.BidSource" + optional :effective_cpc_bid_source, :enum, 21, "google.ads.googleads.v0.enums.BiddingSourceEnum.BiddingSource" + optional :effective_cpm_bid_source, :enum, 22, "google.ads.googleads.v0.enums.BiddingSourceEnum.BiddingSource" + optional :effective_cpv_bid_source, :enum, 23, "google.ads.googleads.v0.enums.BiddingSourceEnum.BiddingSource" optional :position_estimates, :message, 10, "google.ads.googleads.v0.resources.AdGroupCriterion.PositionEstimates" repeated :final_urls, :message, 11, "google.protobuf.StringValue" optional :tracking_url_template, :message, 13, "google.protobuf.StringValue" repeated :url_custom_parameters, :message, 14, "google.ads.googleads.v0.common.CustomParameter" oneof :criterion do optional :keyword, :message, 27, "google.ads.googleads.v0.common.KeywordInfo" + optional :listing_group, :message, 32, "google.ads.googleads.v0.common.ListingGroupInfo" end end add_message "google.ads.googleads.v0.resources.AdGroupCriterion.QualityInfo" do diff --git a/lib/google/ads/googleads/v0/resources/campaign_criterion_pb.rb b/lib/google/ads/googleads/v0/resources/campaign_criterion_pb.rb index 3cce5fec7..a7cb10768 100644 --- a/lib/google/ads/googleads/v0/resources/campaign_criterion_pb.rb +++ b/lib/google/ads/googleads/v0/resources/campaign_criterion_pb.rb @@ -11,10 +11,13 @@ optional :resource_name, :string, 1 optional :campaign, :message, 4, "google.protobuf.StringValue" optional :criterion_id, :message, 5, "google.protobuf.Int64Value" + optional :bid_modifier, :message, 14, "google.protobuf.FloatValue" optional :negative, :message, 7, "google.protobuf.BoolValue" optional :type, :enum, 6, "google.ads.googleads.v0.enums.CriterionTypeEnum.CriterionType" oneof :criterion do optional :keyword, :message, 8, "google.ads.googleads.v0.common.KeywordInfo" + optional :location, :message, 12, "google.ads.googleads.v0.common.LocationInfo" + optional :platform, :message, 13, "google.ads.googleads.v0.common.PlatformInfo" end end end diff --git a/lib/google/ads/googleads/v0/resources/campaign_pb.rb b/lib/google/ads/googleads/v0/resources/campaign_pb.rb index 6cade429a..5322bebe4 100644 --- a/lib/google/ads/googleads/v0/resources/campaign_pb.rb +++ b/lib/google/ads/googleads/v0/resources/campaign_pb.rb @@ -25,6 +25,7 @@ optional :tracking_url_template, :message, 11, "google.protobuf.StringValue" repeated :url_custom_parameters, :message, 12, "google.ads.googleads.v0.common.CustomParameter" optional :network_settings, :message, 14, "google.ads.googleads.v0.resources.Campaign.NetworkSettings" + optional :hotel_setting, :message, 32, "google.ads.googleads.v0.resources.Campaign.HotelSettingInfo" optional :dynamic_search_ads_setting, :message, 33, "google.ads.googleads.v0.resources.Campaign.DynamicSearchAdsSetting" optional :campaign_budget, :message, 6, "google.protobuf.StringValue" optional :bidding_strategy_type, :enum, 22, "google.ads.googleads.v0.enums.BiddingStrategyTypeEnum.BiddingStrategyType" @@ -47,6 +48,9 @@ optional :target_content_network, :message, 3, "google.protobuf.BoolValue" optional :target_partner_search_network, :message, 4, "google.protobuf.BoolValue" end + add_message "google.ads.googleads.v0.resources.Campaign.HotelSettingInfo" do + optional :hotel_center_id, :message, 1, "google.protobuf.Int64Value" + end add_message "google.ads.googleads.v0.resources.Campaign.DynamicSearchAdsSetting" do optional :domain_name, :message, 1, "google.protobuf.StringValue" optional :language_code, :message, 2, "google.protobuf.StringValue" @@ -62,6 +66,7 @@ module V0 module Resources Campaign = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Campaign").msgclass Campaign::NetworkSettings = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Campaign.NetworkSettings").msgclass + Campaign::HotelSettingInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Campaign.HotelSettingInfo").msgclass Campaign::DynamicSearchAdsSetting = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Campaign.DynamicSearchAdsSetting").msgclass end end diff --git a/lib/google/ads/googleads/v0/resources/customer_pb.rb b/lib/google/ads/googleads/v0/resources/customer_pb.rb index 1ab452d87..d4ac30c9d 100644 --- a/lib/google/ads/googleads/v0/resources/customer_pb.rb +++ b/lib/google/ads/googleads/v0/resources/customer_pb.rb @@ -13,6 +13,7 @@ optional :time_zone, :message, 6, "google.protobuf.StringValue" optional :tracking_url_template, :message, 7, "google.protobuf.StringValue" optional :auto_tagging_enabled, :message, 8, "google.protobuf.BoolValue" + optional :has_partners_badge, :message, 9, "google.protobuf.BoolValue" end end diff --git a/lib/google/ads/googleads/v0/resources/geo_target_constant_pb.rb b/lib/google/ads/googleads/v0/resources/geo_target_constant_pb.rb new file mode 100644 index 000000000..16beb11f7 --- /dev/null +++ b/lib/google/ads/googleads/v0/resources/geo_target_constant_pb.rb @@ -0,0 +1,27 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/resources/geo_target_constant.proto + +require 'google/protobuf' + +require 'google/protobuf/wrappers_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.resources.GeoTargetConstant" do + optional :resource_name, :string, 1 + optional :id, :message, 3, "google.protobuf.Int64Value" + optional :name, :message, 4, "google.protobuf.StringValue" + optional :country_code, :message, 5, "google.protobuf.StringValue" + optional :target_type, :message, 6, "google.protobuf.StringValue" + end +end + +module Google + module Ads + module Googleads + module V0 + module Resources + GeoTargetConstant = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.GeoTargetConstant").msgclass + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/resources/recommendation_pb.rb b/lib/google/ads/googleads/v0/resources/recommendation_pb.rb new file mode 100644 index 000000000..61908bad6 --- /dev/null +++ b/lib/google/ads/googleads/v0/resources/recommendation_pb.rb @@ -0,0 +1,85 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/resources/recommendation.proto + +require 'google/protobuf' + +require 'google/ads/googleads/v0/common/ad_pb' +require 'google/ads/googleads/v0/common/criteria_pb' +require 'google/ads/googleads/v0/enums/recommendation_type_pb' +require 'google/ads/googleads/v0/enums/target_cpa_opt_in_recommendation_goal_pb' +require 'google/protobuf/wrappers_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.resources.Recommendation" do + optional :resource_name, :string, 1 + optional :type, :enum, 2, "google.ads.googleads.v0.enums.RecommendationTypeEnum.RecommendationType" + optional :impact, :message, 3, "google.ads.googleads.v0.resources.Recommendation.RecommendationImpact" + optional :campaign_budget, :message, 5, "google.protobuf.StringValue" + optional :campaign, :message, 6, "google.protobuf.StringValue" + optional :ad_group, :message, 7, "google.protobuf.StringValue" + oneof :recommendation do + optional :campaign_budget_recommendation, :message, 4, "google.ads.googleads.v0.resources.Recommendation.CampaignBudgetRecommendation" + optional :keyword_recommendation, :message, 8, "google.ads.googleads.v0.resources.Recommendation.KeywordRecommendation" + optional :text_ad_recommendation, :message, 9, "google.ads.googleads.v0.resources.Recommendation.TextAdRecommendation" + optional :target_cpa_opt_in_recommendation, :message, 10, "google.ads.googleads.v0.resources.Recommendation.TargetCpaOptInRecommendation" + end + end + add_message "google.ads.googleads.v0.resources.Recommendation.RecommendationImpact" do + optional :base_metrics, :message, 1, "google.ads.googleads.v0.resources.Recommendation.RecommendationMetrics" + optional :potential_metrics, :message, 2, "google.ads.googleads.v0.resources.Recommendation.RecommendationMetrics" + end + add_message "google.ads.googleads.v0.resources.Recommendation.RecommendationMetrics" do + optional :impressions, :message, 1, "google.protobuf.DoubleValue" + optional :clicks, :message, 2, "google.protobuf.DoubleValue" + optional :cost_micros, :message, 3, "google.protobuf.Int64Value" + optional :conversions, :message, 4, "google.protobuf.DoubleValue" + optional :video_views, :message, 5, "google.protobuf.DoubleValue" + end + add_message "google.ads.googleads.v0.resources.Recommendation.CampaignBudgetRecommendation" do + optional :current_budget_amount_micros, :message, 1, "google.protobuf.Int64Value" + optional :recommended_budget_amount_micros, :message, 2, "google.protobuf.Int64Value" + repeated :budget_options, :message, 3, "google.ads.googleads.v0.resources.Recommendation.CampaignBudgetRecommendation.CampaignBudgetRecommendationOption" + end + add_message "google.ads.googleads.v0.resources.Recommendation.CampaignBudgetRecommendation.CampaignBudgetRecommendationOption" do + optional :budget_amount_micros, :message, 1, "google.protobuf.Int64Value" + optional :impact, :message, 2, "google.ads.googleads.v0.resources.Recommendation.RecommendationImpact" + end + add_message "google.ads.googleads.v0.resources.Recommendation.KeywordRecommendation" do + optional :keyword, :message, 1, "google.ads.googleads.v0.common.KeywordInfo" + optional :recommended_cpc_bid_micros, :message, 2, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.resources.Recommendation.TextAdRecommendation" do + optional :ad, :message, 1, "google.ads.googleads.v0.common.Ad" + optional :creation_date, :message, 2, "google.protobuf.StringValue" + optional :auto_apply_date, :message, 3, "google.protobuf.StringValue" + end + add_message "google.ads.googleads.v0.resources.Recommendation.TargetCpaOptInRecommendation" do + repeated :options, :message, 1, "google.ads.googleads.v0.resources.Recommendation.TargetCpaOptInRecommendation.TargetCpaOptInRecommendationOption" + optional :recommended_target_cpa_micros, :message, 2, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.resources.Recommendation.TargetCpaOptInRecommendation.TargetCpaOptInRecommendationOption" do + optional :goal, :enum, 1, "google.ads.googleads.v0.enums.TargetCpaOptInRecommendationGoalEnum.TargetCpaOptInRecommendationGoal" + optional :target_cpa_micros, :message, 2, "google.protobuf.Int64Value" + optional :required_campaign_budget_amount_micros, :message, 3, "google.protobuf.Int64Value" + optional :impact, :message, 4, "google.ads.googleads.v0.resources.Recommendation.RecommendationImpact" + end +end + +module Google + module Ads + module Googleads + module V0 + module Resources + Recommendation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation").msgclass + Recommendation::RecommendationImpact = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation.RecommendationImpact").msgclass + Recommendation::RecommendationMetrics = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation.RecommendationMetrics").msgclass + Recommendation::CampaignBudgetRecommendation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation.CampaignBudgetRecommendation").msgclass + Recommendation::CampaignBudgetRecommendation::CampaignBudgetRecommendationOption = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation.CampaignBudgetRecommendation.CampaignBudgetRecommendationOption").msgclass + Recommendation::KeywordRecommendation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation.KeywordRecommendation").msgclass + Recommendation::TextAdRecommendation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation.TextAdRecommendation").msgclass + Recommendation::TargetCpaOptInRecommendation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation.TargetCpaOptInRecommendation").msgclass + Recommendation::TargetCpaOptInRecommendation::TargetCpaOptInRecommendationOption = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.resources.Recommendation.TargetCpaOptInRecommendation.TargetCpaOptInRecommendationOption").msgclass + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/ad_group_ad_service_client.rb b/lib/google/ads/googleads/v0/services/ad_group_ad_service_client.rb index a4b0c1fa1..36d72a2b6 100644 --- a/lib/google/ads/googleads/v0/services/ad_group_ad_service_client.rb +++ b/lib/google/ads/googleads/v0/services/ad_group_ad_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/ad_group_ad_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -114,10 +114,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/ad_group_ad_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_client.rb b/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_client.rb new file mode 100644 index 000000000..15b4f096b --- /dev/null +++ b/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_client.rb @@ -0,0 +1,263 @@ +# Copyright 2018 Google LLC +# +# 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 +# +# https://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. +# +# EDITING INSTRUCTIONS +# This file was generated from the file +# https://github.com/googleapis/googleapis/blob/master/google/ads/googleads/v0/services/ad_group_bid_modifier_service.proto, +# and updates to that file get reflected here through a refresh process. +# For the short term, the refresh process will only be runnable by Google +# engineers. + +require "json" +require "pathname" + +require "google/gax" + +require "google/ads/googleads/v0/services/ad_group_bid_modifier_service_pb" +require "google/ads/googleads/credentials" + +module Google + module Ads + module Googleads + module V0 + module Services + # Service to manage ad group bid modifiers. + # + # @!attribute [r] ad_group_bid_modifier_service_stub + # @return [Google::Ads::Googleads::V0::Services::AdGroupBidModifierService::Stub] + class AdGroupBidModifierServiceClient + attr_reader :ad_group_bid_modifier_service_stub + + # The default address of the service. + SERVICE_ADDRESS = "googleads.googleapis.com".freeze + + # The default port of the service. + DEFAULT_SERVICE_PORT = 443 + + DEFAULT_TIMEOUT = 30 + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service. + ALL_SCOPES = [ + ].freeze + + + AD_GROUP_BID_MODIFIER_PATH_TEMPLATE = Google::Gax::PathTemplate.new( + "customers/{customer}/adGroupBidModifiers/{ad_group_bid_modifier}" + ) + + private_constant :AD_GROUP_BID_MODIFIER_PATH_TEMPLATE + + # Returns a fully-qualified ad_group_bid_modifier resource name string. + # @param customer [String] + # @param ad_group_bid_modifier [String] + # @return [String] + def self.ad_group_bid_modifier_path customer, ad_group_bid_modifier + AD_GROUP_BID_MODIFIER_PATH_TEMPLATE.render( + :"customer" => customer, + :"ad_group_bid_modifier" => ad_group_bid_modifier + ) + end + + # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc] + # Provides the means for authenticating requests made by the client. This parameter can + # be many types. + # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for + # authenticating requests made by this client. + # A `String` will be treated as the path to the keyfile to be used for the construction of + # credentials for this client. + # A `Hash` will be treated as the contents of a keyfile to be used for the construction of + # credentials for this client. + # A `GRPC::Core::Channel` will be used to make calls through. + # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials + # should already be composed with a `GRPC::Core::CallCredentials` object. + # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the + # metadata for requests, generally, to give OAuth credentials. + # @param scopes [Array] + # The OAuth scopes for this service. This parameter is ignored if + # an updater_proc is supplied. + # @param client_config [Hash] + # A Hash for call options for each method. See + # Google::Gax#construct_settings for the structure of + # this data. Falls back to the default config if not specified + # or the specified config is missing data points. + # @param timeout [Numeric] + # The default timeout, in seconds, for calls made through this client. + # @param metadata [Hash] + # Default metadata to be sent with each request. This can be overridden on a per call basis. + # @param exception_transformer [Proc] + # An optional proc that intercepts any exceptions raised during an API call to inject + # custom error handling. + def initialize \ + credentials: nil, + scopes: ALL_SCOPES, + client_config: {}, + timeout: DEFAULT_TIMEOUT, + metadata: nil, + exception_transformer: nil, + lib_name: nil, + lib_version: "" + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "google/gax/grpc" + require "google/ads/googleads/v0/services/ad_group_bid_modifier_service_services_pb" + + credentials ||= Google::Ads::Googleads::Credentials.default + + if credentials.is_a?(String) || credentials.is_a?(Hash) + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc + end + if credentials.is_a?(GRPC::Core::Channel) + channel = credentials + end + if credentials.is_a?(GRPC::Core::ChannelCredentials) + chan_creds = credentials + end + if credentials.is_a?(Proc) + updater_proc = credentials + end + if credentials.is_a?(Google::Auth::Credentials) + updater_proc = credentials.updater_proc + end + + package_version = Gem.loaded_specs['google-ads-googleads'].version.version + + google_api_client = "gl-ruby/#{RUBY_VERSION}" + google_api_client << " #{lib_name}/#{lib_version}" if lib_name + google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}" + google_api_client << " grpc/#{GRPC::VERSION}" + google_api_client.freeze + + headers = { :"x-goog-api-client" => google_api_client } + headers.merge!(metadata) unless metadata.nil? + client_config_file = Pathname.new(__dir__).join( + "ad_group_bid_modifier_service_client_config.json" + ) + defaults = client_config_file.open do |f| + Google::Gax.construct_settings( + "google.ads.googleads.v0.services.AdGroupBidModifierService", + JSON.parse(f.read), + client_config, + Google::Gax::Grpc::STATUS_CODE_NAMES, + timeout, + errors: Google::Gax::Grpc::API_ERRORS, + metadata: headers + ) + end + + # Allow overriding the service path/port in subclasses. + service_path = self.class::SERVICE_ADDRESS + port = self.class::DEFAULT_SERVICE_PORT + @ad_group_bid_modifier_service_stub = Google::Gax::Grpc.create_stub( + service_path, + port, + chan_creds: chan_creds, + channel: channel, + updater_proc: updater_proc, + scopes: scopes, + &Google::Ads::Googleads::V0::Services::AdGroupBidModifierService::Stub.method(:new) + ) + + @get_ad_group_bid_modifier = Google::Gax.create_api_call( + @ad_group_bid_modifier_service_stub.method(:get_ad_group_bid_modifier), + defaults["get_ad_group_bid_modifier"], + exception_transformer: exception_transformer + ) + @mutate_ad_group_bid_modifiers = Google::Gax.create_api_call( + @ad_group_bid_modifier_service_stub.method(:mutate_ad_group_bid_modifiers), + defaults["mutate_ad_group_bid_modifiers"], + exception_transformer: exception_transformer + ) + end + + # Service calls + + # Returns the requested ad group bid modifier in full detail. + # + # @param resource_name [String] + # The resource name of the ad group bid modifier to fetch. + # @param options [Google::Gax::CallOptions] + # Overrides the default settings for this call, e.g, timeout, + # retries, etc. + # @yield [result, operation] Access the result along with the RPC operation + # @yieldparam result [Google::Ads::Googleads::V0::Resources::AdGroupBidModifier] + # @yieldparam operation [GRPC::ActiveCall::Operation] + # @return [Google::Ads::Googleads::V0::Resources::AdGroupBidModifier] + # @raise [Google::Gax::GaxError] if the RPC is aborted. + # @example + # require "google/ads/googleads/v0/services" + # + # ad_group_bid_modifier_service_client = Google::Ads::Googleads::V0::Services::AdGroupBidModifier.new + # formatted_resource_name = Google::Ads::Googleads::V0::Services::AdGroupBidModifierServiceClient.ad_group_bid_modifier_path("[CUSTOMER]", "[AD_GROUP_BID_MODIFIER]") + # response = ad_group_bid_modifier_service_client.get_ad_group_bid_modifier(formatted_resource_name) + + def get_ad_group_bid_modifier \ + resource_name, + options: nil, + &block + req = { + resource_name: resource_name + }.delete_if { |_, v| v.nil? } + req = Google::Gax::to_proto(req, Google::Ads::Googleads::V0::Services::GetAdGroupBidModifierRequest) + @get_ad_group_bid_modifier.call(req, options, &block) + end + + # Creates, updates, or removes ad group bid modifiers. + # Operation statuses are returned. + # + # @param customer_id [String] + # ID of the customer whose ad group bid modifiers are being modified. + # @param operations [Array] + # The list of operations to perform on individual ad group bid modifiers. + # A hash of the same form as `Google::Ads::Googleads::V0::Services::AdGroupBidModifierOperation` + # can also be provided. + # @param options [Google::Gax::CallOptions] + # Overrides the default settings for this call, e.g, timeout, + # retries, etc. + # @yield [result, operation] Access the result along with the RPC operation + # @yieldparam result [Google::Ads::Googleads::V0::Services::MutateAdGroupBidModifiersResponse] + # @yieldparam operation [GRPC::ActiveCall::Operation] + # @return [Google::Ads::Googleads::V0::Services::MutateAdGroupBidModifiersResponse] + # @raise [Google::Gax::GaxError] if the RPC is aborted. + # @example + # require "google/ads/googleads/v0/services" + # + # ad_group_bid_modifier_service_client = Google::Ads::Googleads::V0::Services::AdGroupBidModifier.new + # + # # TODO: Initialize +customer_id+: + # customer_id = '' + # + # # TODO: Initialize +operations+: + # operations = [] + # response = ad_group_bid_modifier_service_client.mutate_ad_group_bid_modifiers(customer_id, operations) + + def mutate_ad_group_bid_modifiers \ + customer_id, + operations, + options: nil, + &block + req = { + customer_id: customer_id, + operations: operations + }.delete_if { |_, v| v.nil? } + req = Google::Gax::to_proto(req, Google::Ads::Googleads::V0::Services::MutateAdGroupBidModifiersRequest) + @mutate_ad_group_bid_modifiers.call(req, options, &block) + end + end + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_client_config.json b/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_client_config.json new file mode 100644 index 000000000..c4fed0c1d --- /dev/null +++ b/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.ads.googleads.v0.services.AdGroupBidModifierService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetAdGroupBidModifier": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "MutateAdGroupBidModifiers": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_pb.rb b/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_pb.rb new file mode 100644 index 000000000..7767014e9 --- /dev/null +++ b/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/services/ad_group_bid_modifier_service.proto + +require 'google/protobuf' + +require 'google/ads/googleads/v0/resources/ad_group_bid_modifier_pb' +require 'google/api/annotations_pb' +require 'google/protobuf/field_mask_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.services.GetAdGroupBidModifierRequest" do + optional :resource_name, :string, 1 + end + add_message "google.ads.googleads.v0.services.MutateAdGroupBidModifiersRequest" do + optional :customer_id, :string, 1 + repeated :operations, :message, 2, "google.ads.googleads.v0.services.AdGroupBidModifierOperation" + end + add_message "google.ads.googleads.v0.services.AdGroupBidModifierOperation" do + optional :update_mask, :message, 4, "google.protobuf.FieldMask" + oneof :operation do + optional :create, :message, 1, "google.ads.googleads.v0.resources.AdGroupBidModifier" + optional :update, :message, 2, "google.ads.googleads.v0.resources.AdGroupBidModifier" + optional :remove, :string, 3 + end + end + add_message "google.ads.googleads.v0.services.MutateAdGroupBidModifiersResponse" do + repeated :results, :message, 2, "google.ads.googleads.v0.services.MutateAdGroupBidModifierResult" + end + add_message "google.ads.googleads.v0.services.MutateAdGroupBidModifierResult" do + optional :resource_name, :string, 1 + end +end + +module Google + module Ads + module Googleads + module V0 + module Services + GetAdGroupBidModifierRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.GetAdGroupBidModifierRequest").msgclass + MutateAdGroupBidModifiersRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.MutateAdGroupBidModifiersRequest").msgclass + AdGroupBidModifierOperation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.AdGroupBidModifierOperation").msgclass + MutateAdGroupBidModifiersResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.MutateAdGroupBidModifiersResponse").msgclass + MutateAdGroupBidModifierResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.MutateAdGroupBidModifierResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_services_pb.rb b/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_services_pb.rb new file mode 100644 index 000000000..5847390b4 --- /dev/null +++ b/lib/google/ads/googleads/v0/services/ad_group_bid_modifier_service_services_pb.rb @@ -0,0 +1,52 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v0/services/ad_group_bid_modifier_service.proto for package 'google.ads.googleads.v0.services' +# Original file comments: +# Copyright 2018 Google Inc. +# +# 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. +# + +require 'grpc' +require 'google/ads/googleads/v0/services/ad_group_bid_modifier_service_pb' + +module Google + module Ads + module Googleads + module V0 + module Services + module AdGroupBidModifierService + # Proto file describing the Ad Group Bid Modifier service. + # + # Service to manage ad group bid modifiers. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v0.services.AdGroupBidModifierService' + + # Returns the requested ad group bid modifier in full detail. + rpc :GetAdGroupBidModifier, GetAdGroupBidModifierRequest, Google::Ads::Googleads::V0::Resources::AdGroupBidModifier + # Creates, updates, or removes ad group bid modifiers. + # Operation statuses are returned. + rpc :MutateAdGroupBidModifiers, MutateAdGroupBidModifiersRequest, MutateAdGroupBidModifiersResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/ad_group_criterion_service_client.rb b/lib/google/ads/googleads/v0/services/ad_group_criterion_service_client.rb index 06ed0a3ab..e09bb31fa 100644 --- a/lib/google/ads/googleads/v0/services/ad_group_criterion_service_client.rb +++ b/lib/google/ads/googleads/v0/services/ad_group_criterion_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/ad_group_criterion_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -114,10 +114,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/ad_group_criterion_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/ad_group_service_client.rb b/lib/google/ads/googleads/v0/services/ad_group_service_client.rb index 971b748f9..51b132a19 100644 --- a/lib/google/ads/googleads/v0/services/ad_group_service_client.rb +++ b/lib/google/ads/googleads/v0/services/ad_group_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/ad_group_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -114,10 +114,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/ad_group_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/bidding_strategy_service_client.rb b/lib/google/ads/googleads/v0/services/bidding_strategy_service_client.rb index 934a59cac..0895f7565 100644 --- a/lib/google/ads/googleads/v0/services/bidding_strategy_service_client.rb +++ b/lib/google/ads/googleads/v0/services/bidding_strategy_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/bidding_strategy_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -114,10 +114,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/bidding_strategy_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/campaign_budget_service_client.rb b/lib/google/ads/googleads/v0/services/campaign_budget_service_client.rb index 9631fb451..03dc8c4c0 100644 --- a/lib/google/ads/googleads/v0/services/campaign_budget_service_client.rb +++ b/lib/google/ads/googleads/v0/services/campaign_budget_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/campaign_budget_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -114,10 +114,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/campaign_budget_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/campaign_criterion_service_client.rb b/lib/google/ads/googleads/v0/services/campaign_criterion_service_client.rb index 99b16d215..699c2fe71 100644 --- a/lib/google/ads/googleads/v0/services/campaign_criterion_service_client.rb +++ b/lib/google/ads/googleads/v0/services/campaign_criterion_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/campaign_criterion_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -114,10 +114,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/campaign_criterion_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/campaign_service_client.rb b/lib/google/ads/googleads/v0/services/campaign_service_client.rb index f9d438c2a..687e0b653 100644 --- a/lib/google/ads/googleads/v0/services/campaign_service_client.rb +++ b/lib/google/ads/googleads/v0/services/campaign_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/campaign_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -114,10 +114,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/campaign_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/customer_service_client.rb b/lib/google/ads/googleads/v0/services/customer_service_client.rb index da2d8d333..6c0c89b88 100644 --- a/lib/google/ads/googleads/v0/services/customer_service_client.rb +++ b/lib/google/ads/googleads/v0/services/customer_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/customer_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -112,10 +112,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/customer_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/geo_target_constant_service_client.rb b/lib/google/ads/googleads/v0/services/geo_target_constant_service_client.rb new file mode 100644 index 000000000..3387bc6e0 --- /dev/null +++ b/lib/google/ads/googleads/v0/services/geo_target_constant_service_client.rb @@ -0,0 +1,214 @@ +# Copyright 2018 Google LLC +# +# 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 +# +# https://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. +# +# EDITING INSTRUCTIONS +# This file was generated from the file +# https://github.com/googleapis/googleapis/blob/master/google/ads/googleads/v0/services/geo_target_constant_service.proto, +# and updates to that file get reflected here through a refresh process. +# For the short term, the refresh process will only be runnable by Google +# engineers. + +require "json" +require "pathname" + +require "google/gax" + +require "google/ads/googleads/v0/services/geo_target_constant_service_pb" +require "google/ads/googleads/credentials" + +module Google + module Ads + module Googleads + module V0 + module Services + # Service to fetch geo target constants. + # + # @!attribute [r] geo_target_constant_service_stub + # @return [Google::Ads::Googleads::V0::Services::GeoTargetConstantService::Stub] + class GeoTargetConstantServiceClient + attr_reader :geo_target_constant_service_stub + + # The default address of the service. + SERVICE_ADDRESS = "googleads.googleapis.com".freeze + + # The default port of the service. + DEFAULT_SERVICE_PORT = 443 + + DEFAULT_TIMEOUT = 30 + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service. + ALL_SCOPES = [ + ].freeze + + + GEO_TARGET_CONSTANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new( + "geoTargetConstants/{geo_target_constant}" + ) + + private_constant :GEO_TARGET_CONSTANT_PATH_TEMPLATE + + # Returns a fully-qualified geo_target_constant resource name string. + # @param geo_target_constant [String] + # @return [String] + def self.geo_target_constant_path geo_target_constant + GEO_TARGET_CONSTANT_PATH_TEMPLATE.render( + :"geo_target_constant" => geo_target_constant + ) + end + + # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc] + # Provides the means for authenticating requests made by the client. This parameter can + # be many types. + # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for + # authenticating requests made by this client. + # A `String` will be treated as the path to the keyfile to be used for the construction of + # credentials for this client. + # A `Hash` will be treated as the contents of a keyfile to be used for the construction of + # credentials for this client. + # A `GRPC::Core::Channel` will be used to make calls through. + # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials + # should already be composed with a `GRPC::Core::CallCredentials` object. + # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the + # metadata for requests, generally, to give OAuth credentials. + # @param scopes [Array] + # The OAuth scopes for this service. This parameter is ignored if + # an updater_proc is supplied. + # @param client_config [Hash] + # A Hash for call options for each method. See + # Google::Gax#construct_settings for the structure of + # this data. Falls back to the default config if not specified + # or the specified config is missing data points. + # @param timeout [Numeric] + # The default timeout, in seconds, for calls made through this client. + # @param metadata [Hash] + # Default metadata to be sent with each request. This can be overridden on a per call basis. + # @param exception_transformer [Proc] + # An optional proc that intercepts any exceptions raised during an API call to inject + # custom error handling. + def initialize \ + credentials: nil, + scopes: ALL_SCOPES, + client_config: {}, + timeout: DEFAULT_TIMEOUT, + metadata: nil, + exception_transformer: nil, + lib_name: nil, + lib_version: "" + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "google/gax/grpc" + require "google/ads/googleads/v0/services/geo_target_constant_service_services_pb" + + credentials ||= Google::Ads::Googleads::Credentials.default + + if credentials.is_a?(String) || credentials.is_a?(Hash) + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc + end + if credentials.is_a?(GRPC::Core::Channel) + channel = credentials + end + if credentials.is_a?(GRPC::Core::ChannelCredentials) + chan_creds = credentials + end + if credentials.is_a?(Proc) + updater_proc = credentials + end + if credentials.is_a?(Google::Auth::Credentials) + updater_proc = credentials.updater_proc + end + + package_version = Gem.loaded_specs['google-ads-googleads'].version.version + + google_api_client = "gl-ruby/#{RUBY_VERSION}" + google_api_client << " #{lib_name}/#{lib_version}" if lib_name + google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}" + google_api_client << " grpc/#{GRPC::VERSION}" + google_api_client.freeze + + headers = { :"x-goog-api-client" => google_api_client } + headers.merge!(metadata) unless metadata.nil? + client_config_file = Pathname.new(__dir__).join( + "geo_target_constant_service_client_config.json" + ) + defaults = client_config_file.open do |f| + Google::Gax.construct_settings( + "google.ads.googleads.v0.services.GeoTargetConstantService", + JSON.parse(f.read), + client_config, + Google::Gax::Grpc::STATUS_CODE_NAMES, + timeout, + errors: Google::Gax::Grpc::API_ERRORS, + metadata: headers + ) + end + + # Allow overriding the service path/port in subclasses. + service_path = self.class::SERVICE_ADDRESS + port = self.class::DEFAULT_SERVICE_PORT + @geo_target_constant_service_stub = Google::Gax::Grpc.create_stub( + service_path, + port, + chan_creds: chan_creds, + channel: channel, + updater_proc: updater_proc, + scopes: scopes, + &Google::Ads::Googleads::V0::Services::GeoTargetConstantService::Stub.method(:new) + ) + + @get_geo_target_constant = Google::Gax.create_api_call( + @geo_target_constant_service_stub.method(:get_geo_target_constant), + defaults["get_geo_target_constant"], + exception_transformer: exception_transformer + ) + end + + # Service calls + + # Returns the requested geo target constant in full detail. + # + # @param resource_name [String] + # The resource name of the geo target constant to fetch. + # @param options [Google::Gax::CallOptions] + # Overrides the default settings for this call, e.g, timeout, + # retries, etc. + # @yield [result, operation] Access the result along with the RPC operation + # @yieldparam result [Google::Ads::Googleads::V0::Resources::GeoTargetConstant] + # @yieldparam operation [GRPC::ActiveCall::Operation] + # @return [Google::Ads::Googleads::V0::Resources::GeoTargetConstant] + # @raise [Google::Gax::GaxError] if the RPC is aborted. + # @example + # require "google/ads/googleads/v0/services" + # + # geo_target_constant_service_client = Google::Ads::Googleads::V0::Services::GeoTargetConstant.new + # formatted_resource_name = Google::Ads::Googleads::V0::Services::GeoTargetConstantServiceClient.geo_target_constant_path("[GEO_TARGET_CONSTANT]") + # response = geo_target_constant_service_client.get_geo_target_constant(formatted_resource_name) + + def get_geo_target_constant \ + resource_name, + options: nil, + &block + req = { + resource_name: resource_name + }.delete_if { |_, v| v.nil? } + req = Google::Gax::to_proto(req, Google::Ads::Googleads::V0::Services::GetGeoTargetConstantRequest) + @get_geo_target_constant.call(req, options, &block) + end + end + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/geo_target_constant_service_client_config.json b/lib/google/ads/googleads/v0/services/geo_target_constant_service_client_config.json new file mode 100644 index 000000000..7b907e0a1 --- /dev/null +++ b/lib/google/ads/googleads/v0/services/geo_target_constant_service_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.ads.googleads.v0.services.GeoTargetConstantService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetGeoTargetConstant": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/lib/google/ads/googleads/v0/services/geo_target_constant_service_pb.rb b/lib/google/ads/googleads/v0/services/geo_target_constant_service_pb.rb new file mode 100644 index 000000000..c4bfbcb3e --- /dev/null +++ b/lib/google/ads/googleads/v0/services/geo_target_constant_service_pb.rb @@ -0,0 +1,24 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/services/geo_target_constant_service.proto + +require 'google/protobuf' + +require 'google/ads/googleads/v0/resources/geo_target_constant_pb' +require 'google/api/annotations_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.services.GetGeoTargetConstantRequest" do + optional :resource_name, :string, 1 + end +end + +module Google + module Ads + module Googleads + module V0 + module Services + GetGeoTargetConstantRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.GetGeoTargetConstantRequest").msgclass + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/geo_target_constant_service_services_pb.rb b/lib/google/ads/googleads/v0/services/geo_target_constant_service_services_pb.rb new file mode 100644 index 000000000..65877fc6c --- /dev/null +++ b/lib/google/ads/googleads/v0/services/geo_target_constant_service_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v0/services/geo_target_constant_service.proto for package 'google.ads.googleads.v0.services' +# Original file comments: +# Copyright 2018 Google Inc. +# +# 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. +# + +require 'grpc' +require 'google/ads/googleads/v0/services/geo_target_constant_service_pb' + +module Google + module Ads + module Googleads + module V0 + module Services + module GeoTargetConstantService + # Proto file describing the Geo target constant service. + # + # Service to fetch geo target constants. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v0.services.GeoTargetConstantService' + + # Returns the requested geo target constant in full detail. + rpc :GetGeoTargetConstant, GetGeoTargetConstantRequest, Google::Ads::Googleads::V0::Resources::GeoTargetConstant + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/google_ads_field_service_client.rb b/lib/google/ads/googleads/v0/services/google_ads_field_service_client.rb index dac8ee3f5..545ec28c5 100644 --- a/lib/google/ads/googleads/v0/services/google_ads_field_service_client.rb +++ b/lib/google/ads/googleads/v0/services/google_ads_field_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/google_ads_field_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -121,10 +121,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/google_ads_field_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/google_ads_field_service_client_config.json b/lib/google/ads/googleads/v0/services/google_ads_field_service_client_config.json index 2271d4140..cc6d14e48 100644 --- a/lib/google/ads/googleads/v0/services/google_ads_field_service_client_config.json +++ b/lib/google/ads/googleads/v0/services/google_ads_field_service_client_config.json @@ -21,12 +21,12 @@ }, "methods": { "GetGoogleAdsField": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default" }, "SearchGoogleAdsFields": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/lib/google/ads/googleads/v0/services/google_ads_service_client.rb b/lib/google/ads/googleads/v0/services/google_ads_service_client.rb index e336d0b91..cf38a47c6 100644 --- a/lib/google/ads/googleads/v0/services/google_ads_service_client.rb +++ b/lib/google/ads/googleads/v0/services/google_ads_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/google_ads_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -106,10 +106,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/google_ads_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/google_ads_service_client_config.json b/lib/google/ads/googleads/v0/services/google_ads_service_client_config.json index 166338a35..c5405e0e2 100644 --- a/lib/google/ads/googleads/v0/services/google_ads_service_client_config.json +++ b/lib/google/ads/googleads/v0/services/google_ads_service_client_config.json @@ -21,7 +21,7 @@ }, "methods": { "Search": { - "timeout_millis": 600000, + "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" } diff --git a/lib/google/ads/googleads/v0/services/google_ads_service_pb.rb b/lib/google/ads/googleads/v0/services/google_ads_service_pb.rb index 1eaa09074..976a9480c 100644 --- a/lib/google/ads/googleads/v0/services/google_ads_service_pb.rb +++ b/lib/google/ads/googleads/v0/services/google_ads_service_pb.rb @@ -10,13 +10,16 @@ require 'google/ads/googleads/v0/enums/slot_pb' require 'google/ads/googleads/v0/resources/ad_group_pb' require 'google/ads/googleads/v0/resources/ad_group_ad_pb' +require 'google/ads/googleads/v0/resources/ad_group_bid_modifier_pb' require 'google/ads/googleads/v0/resources/ad_group_criterion_pb' require 'google/ads/googleads/v0/resources/bidding_strategy_pb' require 'google/ads/googleads/v0/resources/campaign_pb' require 'google/ads/googleads/v0/resources/campaign_budget_pb' require 'google/ads/googleads/v0/resources/campaign_criterion_pb' require 'google/ads/googleads/v0/resources/customer_pb' +require 'google/ads/googleads/v0/resources/geo_target_constant_pb' require 'google/ads/googleads/v0/resources/keyword_view_pb' +require 'google/ads/googleads/v0/resources/recommendation_pb' require 'google/api/annotations_pb' require 'google/protobuf/field_mask_pb' require 'google/protobuf/wrappers_pb' @@ -36,13 +39,16 @@ add_message "google.ads.googleads.v0.services.GoogleAdsRow" do optional :ad_group, :message, 3, "google.ads.googleads.v0.resources.AdGroup" optional :ad_group_ad, :message, 16, "google.ads.googleads.v0.resources.AdGroupAd" + optional :ad_group_bid_modifier, :message, 24, "google.ads.googleads.v0.resources.AdGroupBidModifier" optional :ad_group_criterion, :message, 17, "google.ads.googleads.v0.resources.AdGroupCriterion" optional :bidding_strategy, :message, 18, "google.ads.googleads.v0.resources.BiddingStrategy" optional :campaign_budget, :message, 19, "google.ads.googleads.v0.resources.CampaignBudget" optional :campaign, :message, 2, "google.ads.googleads.v0.resources.Campaign" optional :campaign_criterion, :message, 20, "google.ads.googleads.v0.resources.CampaignCriterion" optional :customer, :message, 1, "google.ads.googleads.v0.resources.Customer" + optional :geo_target_constant, :message, 23, "google.ads.googleads.v0.resources.GeoTargetConstant" optional :keyword_view, :message, 21, "google.ads.googleads.v0.resources.KeywordView" + optional :recommendation, :message, 22, "google.ads.googleads.v0.resources.Recommendation" optional :metrics, :message, 4, "google.ads.googleads.v0.common.Metrics" optional :ad_network_type, :enum, 5, "google.ads.googleads.v0.enums.AdNetworkTypeEnum.AdNetworkType" optional :date, :message, 6, "google.protobuf.StringValue" diff --git a/lib/google/ads/googleads/v0/services/keyword_view_service_client.rb b/lib/google/ads/googleads/v0/services/keyword_view_service_client.rb index 5f1e318da..8e7e7aeed 100644 --- a/lib/google/ads/googleads/v0/services/keyword_view_service_client.rb +++ b/lib/google/ads/googleads/v0/services/keyword_view_service_client.rb @@ -25,7 +25,7 @@ require "google/gax" require "google/ads/googleads/v0/services/keyword_view_service_pb" -require "google/ads/googleads/v0/services/credentials" +require "google/ads/googleads/credentials" module Google module Ads @@ -114,10 +114,10 @@ def initialize \ require "google/gax/grpc" require "google/ads/googleads/v0/services/keyword_view_service_services_pb" - credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default + credentials ||= Google::Ads::Googleads::Credentials.default if credentials.is_a?(String) || credentials.is_a?(Hash) - updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials diff --git a/lib/google/ads/googleads/v0/services/recommendation_service_client.rb b/lib/google/ads/googleads/v0/services/recommendation_service_client.rb new file mode 100644 index 000000000..5cf61312f --- /dev/null +++ b/lib/google/ads/googleads/v0/services/recommendation_service_client.rb @@ -0,0 +1,262 @@ +# Copyright 2018 Google LLC +# +# 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 +# +# https://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. +# +# EDITING INSTRUCTIONS +# This file was generated from the file +# https://github.com/googleapis/googleapis/blob/master/google/ads/googleads/v0/services/recommendation_service.proto, +# and updates to that file get reflected here through a refresh process. +# For the short term, the refresh process will only be runnable by Google +# engineers. + +require "json" +require "pathname" + +require "google/gax" + +require "google/ads/googleads/v0/services/recommendation_service_pb" +require "google/ads/googleads/credentials" + +module Google + module Ads + module Googleads + module V0 + module Services + # Service to manage recommendations. + # + # @!attribute [r] recommendation_service_stub + # @return [Google::Ads::Googleads::V0::Services::RecommendationService::Stub] + class RecommendationServiceClient + attr_reader :recommendation_service_stub + + # The default address of the service. + SERVICE_ADDRESS = "googleads.googleapis.com".freeze + + # The default port of the service. + DEFAULT_SERVICE_PORT = 443 + + DEFAULT_TIMEOUT = 30 + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service. + ALL_SCOPES = [ + ].freeze + + + RECOMMENDATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new( + "customers/{customer}/recommendations/{recommendation}" + ) + + private_constant :RECOMMENDATION_PATH_TEMPLATE + + # Returns a fully-qualified recommendation resource name string. + # @param customer [String] + # @param recommendation [String] + # @return [String] + def self.recommendation_path customer, recommendation + RECOMMENDATION_PATH_TEMPLATE.render( + :"customer" => customer, + :"recommendation" => recommendation + ) + end + + # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc] + # Provides the means for authenticating requests made by the client. This parameter can + # be many types. + # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for + # authenticating requests made by this client. + # A `String` will be treated as the path to the keyfile to be used for the construction of + # credentials for this client. + # A `Hash` will be treated as the contents of a keyfile to be used for the construction of + # credentials for this client. + # A `GRPC::Core::Channel` will be used to make calls through. + # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials + # should already be composed with a `GRPC::Core::CallCredentials` object. + # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the + # metadata for requests, generally, to give OAuth credentials. + # @param scopes [Array] + # The OAuth scopes for this service. This parameter is ignored if + # an updater_proc is supplied. + # @param client_config [Hash] + # A Hash for call options for each method. See + # Google::Gax#construct_settings for the structure of + # this data. Falls back to the default config if not specified + # or the specified config is missing data points. + # @param timeout [Numeric] + # The default timeout, in seconds, for calls made through this client. + # @param metadata [Hash] + # Default metadata to be sent with each request. This can be overridden on a per call basis. + # @param exception_transformer [Proc] + # An optional proc that intercepts any exceptions raised during an API call to inject + # custom error handling. + def initialize \ + credentials: nil, + scopes: ALL_SCOPES, + client_config: {}, + timeout: DEFAULT_TIMEOUT, + metadata: nil, + exception_transformer: nil, + lib_name: nil, + lib_version: "" + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "google/gax/grpc" + require "google/ads/googleads/v0/services/recommendation_service_services_pb" + + credentials ||= Google::Ads::Googleads::Credentials.default + + if credentials.is_a?(String) || credentials.is_a?(Hash) + updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc + end + if credentials.is_a?(GRPC::Core::Channel) + channel = credentials + end + if credentials.is_a?(GRPC::Core::ChannelCredentials) + chan_creds = credentials + end + if credentials.is_a?(Proc) + updater_proc = credentials + end + if credentials.is_a?(Google::Auth::Credentials) + updater_proc = credentials.updater_proc + end + + package_version = Gem.loaded_specs['google-ads-googleads'].version.version + + google_api_client = "gl-ruby/#{RUBY_VERSION}" + google_api_client << " #{lib_name}/#{lib_version}" if lib_name + google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}" + google_api_client << " grpc/#{GRPC::VERSION}" + google_api_client.freeze + + headers = { :"x-goog-api-client" => google_api_client } + headers.merge!(metadata) unless metadata.nil? + client_config_file = Pathname.new(__dir__).join( + "recommendation_service_client_config.json" + ) + defaults = client_config_file.open do |f| + Google::Gax.construct_settings( + "google.ads.googleads.v0.services.RecommendationService", + JSON.parse(f.read), + client_config, + Google::Gax::Grpc::STATUS_CODE_NAMES, + timeout, + errors: Google::Gax::Grpc::API_ERRORS, + metadata: headers + ) + end + + # Allow overriding the service path/port in subclasses. + service_path = self.class::SERVICE_ADDRESS + port = self.class::DEFAULT_SERVICE_PORT + @recommendation_service_stub = Google::Gax::Grpc.create_stub( + service_path, + port, + chan_creds: chan_creds, + channel: channel, + updater_proc: updater_proc, + scopes: scopes, + &Google::Ads::Googleads::V0::Services::RecommendationService::Stub.method(:new) + ) + + @get_recommendation = Google::Gax.create_api_call( + @recommendation_service_stub.method(:get_recommendation), + defaults["get_recommendation"], + exception_transformer: exception_transformer + ) + @apply_recommendation = Google::Gax.create_api_call( + @recommendation_service_stub.method(:apply_recommendation), + defaults["apply_recommendation"], + exception_transformer: exception_transformer + ) + end + + # Service calls + + # Returns the requested recommendation in full detail. + # + # @param resource_name [String] + # The resource name of the recommendation to fetch. + # @param options [Google::Gax::CallOptions] + # Overrides the default settings for this call, e.g, timeout, + # retries, etc. + # @yield [result, operation] Access the result along with the RPC operation + # @yieldparam result [Google::Ads::Googleads::V0::Resources::Recommendation] + # @yieldparam operation [GRPC::ActiveCall::Operation] + # @return [Google::Ads::Googleads::V0::Resources::Recommendation] + # @raise [Google::Gax::GaxError] if the RPC is aborted. + # @example + # require "google/ads/googleads/v0/services" + # + # recommendation_service_client = Google::Ads::Googleads::V0::Services::Recommendation.new + # formatted_resource_name = Google::Ads::Googleads::V0::Services::RecommendationServiceClient.recommendation_path("[CUSTOMER]", "[RECOMMENDATION]") + # response = recommendation_service_client.get_recommendation(formatted_resource_name) + + def get_recommendation \ + resource_name, + options: nil, + &block + req = { + resource_name: resource_name + }.delete_if { |_, v| v.nil? } + req = Google::Gax::to_proto(req, Google::Ads::Googleads::V0::Services::GetRecommendationRequest) + @get_recommendation.call(req, options, &block) + end + + # Applies given recommendations with corresponding apply parameters. + # + # @param customer_id [String] + # The ID of the customer with the recommendation. + # @param operations [Array] + # The list of operations to apply recommendations. + # A hash of the same form as `Google::Ads::Googleads::V0::Services::ApplyRecommendationOperation` + # can also be provided. + # @param options [Google::Gax::CallOptions] + # Overrides the default settings for this call, e.g, timeout, + # retries, etc. + # @yield [result, operation] Access the result along with the RPC operation + # @yieldparam result [Google::Ads::Googleads::V0::Services::ApplyRecommendationResponse] + # @yieldparam operation [GRPC::ActiveCall::Operation] + # @return [Google::Ads::Googleads::V0::Services::ApplyRecommendationResponse] + # @raise [Google::Gax::GaxError] if the RPC is aborted. + # @example + # require "google/ads/googleads/v0/services" + # + # recommendation_service_client = Google::Ads::Googleads::V0::Services::Recommendation.new + # + # # TODO: Initialize +customer_id+: + # customer_id = '' + # + # # TODO: Initialize +operations+: + # operations = [] + # response = recommendation_service_client.apply_recommendation(customer_id, operations) + + def apply_recommendation \ + customer_id, + operations, + options: nil, + &block + req = { + customer_id: customer_id, + operations: operations + }.delete_if { |_, v| v.nil? } + req = Google::Gax::to_proto(req, Google::Ads::Googleads::V0::Services::ApplyRecommendationRequest) + @apply_recommendation.call(req, options, &block) + end + end + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/recommendation_service_client_config.json b/lib/google/ads/googleads/v0/services/recommendation_service_client_config.json new file mode 100644 index 000000000..b485d748c --- /dev/null +++ b/lib/google/ads/googleads/v0/services/recommendation_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.ads.googleads.v0.services.RecommendationService": { + "retry_codes": { + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "non_idempotent": [] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetRecommendation": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ApplyRecommendation": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/lib/google/ads/googleads/v0/services/recommendation_service_pb.rb b/lib/google/ads/googleads/v0/services/recommendation_service_pb.rb new file mode 100644 index 000000000..394b18b9f --- /dev/null +++ b/lib/google/ads/googleads/v0/services/recommendation_service_pb.rb @@ -0,0 +1,73 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/ads/googleads/v0/services/recommendation_service.proto + +require 'google/protobuf' + +require 'google/ads/googleads/v0/common/ad_pb' +require 'google/ads/googleads/v0/enums/keyword_match_type_pb' +require 'google/ads/googleads/v0/resources/recommendation_pb' +require 'google/api/annotations_pb' +require 'google/protobuf/wrappers_pb' +require 'google/rpc/status_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_message "google.ads.googleads.v0.services.GetRecommendationRequest" do + optional :resource_name, :string, 1 + end + add_message "google.ads.googleads.v0.services.ApplyRecommendationRequest" do + optional :customer_id, :string, 1 + repeated :operations, :message, 2, "google.ads.googleads.v0.services.ApplyRecommendationOperation" + end + add_message "google.ads.googleads.v0.services.ApplyRecommendationOperation" do + optional :resource_name, :string, 1 + oneof :apply_parameters do + optional :campaign_budget, :message, 2, "google.ads.googleads.v0.services.ApplyRecommendationOperation.CampaignBudgetParameters" + optional :text_ad, :message, 3, "google.ads.googleads.v0.services.ApplyRecommendationOperation.TextAdParameters" + optional :keyword, :message, 4, "google.ads.googleads.v0.services.ApplyRecommendationOperation.KeywordParameters" + optional :target_cpa_opt_in, :message, 5, "google.ads.googleads.v0.services.ApplyRecommendationOperation.TargetCpaOptInParameters" + end + end + add_message "google.ads.googleads.v0.services.ApplyRecommendationOperation.CampaignBudgetParameters" do + optional :new_budget_amount_micros, :message, 1, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.services.ApplyRecommendationOperation.TextAdParameters" do + optional :ad, :message, 1, "google.ads.googleads.v0.common.Ad" + end + add_message "google.ads.googleads.v0.services.ApplyRecommendationOperation.KeywordParameters" do + optional :ad_group, :message, 1, "google.protobuf.StringValue" + optional :match_type, :enum, 2, "google.ads.googleads.v0.enums.KeywordMatchTypeEnum.KeywordMatchType" + optional :cpc_bid_micros, :message, 3, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.services.ApplyRecommendationOperation.TargetCpaOptInParameters" do + optional :target_cpa_micros, :message, 1, "google.protobuf.Int64Value" + optional :new_campaign_budget_amount_micros, :message, 2, "google.protobuf.Int64Value" + end + add_message "google.ads.googleads.v0.services.ApplyRecommendationResponse" do + repeated :results, :message, 1, "google.ads.googleads.v0.services.ApplyRecommendationResult" + end + add_message "google.ads.googleads.v0.services.ApplyRecommendationResult" do + oneof :result do + optional :resource_name, :string, 1 + optional :status, :message, 2, "google.rpc.Status" + end + end +end + +module Google + module Ads + module Googleads + module V0 + module Services + GetRecommendationRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.GetRecommendationRequest").msgclass + ApplyRecommendationRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.ApplyRecommendationRequest").msgclass + ApplyRecommendationOperation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.ApplyRecommendationOperation").msgclass + ApplyRecommendationOperation::CampaignBudgetParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.ApplyRecommendationOperation.CampaignBudgetParameters").msgclass + ApplyRecommendationOperation::TextAdParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.ApplyRecommendationOperation.TextAdParameters").msgclass + ApplyRecommendationOperation::KeywordParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.ApplyRecommendationOperation.KeywordParameters").msgclass + ApplyRecommendationOperation::TargetCpaOptInParameters = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.ApplyRecommendationOperation.TargetCpaOptInParameters").msgclass + ApplyRecommendationResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.ApplyRecommendationResponse").msgclass + ApplyRecommendationResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.ads.googleads.v0.services.ApplyRecommendationResult").msgclass + end + end + end + end +end diff --git a/lib/google/ads/googleads/v0/services/recommendation_service_services_pb.rb b/lib/google/ads/googleads/v0/services/recommendation_service_services_pb.rb new file mode 100644 index 000000000..2698286ca --- /dev/null +++ b/lib/google/ads/googleads/v0/services/recommendation_service_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/ads/googleads/v0/services/recommendation_service.proto for package 'google.ads.googleads.v0.services' +# Original file comments: +# Copyright 2018 Google Inc. +# +# 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. +# + +require 'grpc' +require 'google/ads/googleads/v0/services/recommendation_service_pb' + +module Google + module Ads + module Googleads + module V0 + module Services + module RecommendationService + # Proto file describing the Recommendation service. + # + # Service to manage recommendations. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.ads.googleads.v0.services.RecommendationService' + + # Returns the requested recommendation in full detail. + rpc :GetRecommendation, GetRecommendationRequest, Google::Ads::Googleads::V0::Resources::Recommendation + # Applies given recommendations with corresponding apply parameters. + rpc :ApplyRecommendation, ApplyRecommendationRequest, ApplyRecommendationResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/lib/google/ads/googleads/version.rb b/lib/google/ads/googleads/version.rb index 0a948a3bf..67eba595b 100644 --- a/lib/google/ads/googleads/version.rb +++ b/lib/google/ads/googleads/version.rb @@ -19,7 +19,7 @@ module Google module Ads module Googleads - CLIENT_LIB_VERSION = '0.1.0'.freeze + CLIENT_LIB_VERSION = '0.2.0'.freeze end end end diff --git a/test/test_path_lookup_util.rb b/test/test_path_lookup_util.rb index 5d778b870..6120d5e0a 100644 --- a/test/test_path_lookup_util.rb +++ b/test/test_path_lookup_util.rb @@ -31,6 +31,9 @@ def test_path_generation() expected = 'customers/1234/adGroupAds/567_890' assert_equal(expected, util.ad_group_ad(1234, 567, 890)) + expected = 'customers/1234/adGroupBidModifiers/567_890' + assert_equal(expected, util.ad_group_bid_modifier(1234, 567, 890)) + expected = 'customers/1234/adGroupCriteria/567_890' assert_equal(expected, util.ad_group_criterion(1234, 567, 890)) @@ -52,11 +55,17 @@ def test_path_generation() expected = 'customers/123456' assert_equal(expected, util.customer(123456)) + expected = 'geoTargetConstants/123456' + assert_equal(expected, util.geo_target_constant(123456)) + expected = 'googleAdsFields/test_field' assert_equal(expected, util.google_ads_field('test_field')) expected = 'customers/1234/keywordViews/567_890' assert_equal(expected, util.keyword_view(1234, 567, 890)) + + expected = 'customers/1234/recommendations/5678' + assert_equal(expected, util.recommendation(1234, 5678)) end def test_malformed_path_input()